Advertisement
Guest User

hudit.mod.gml

a guest
Feb 21st, 2017
1,255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #define init
  2. for(var index = 0; index < maxp; index += 1)
  3. {
  4.     global.xpBarX[index] = 4;
  5.     global.xpBarY[index] = 4;
  6.     global.hpBarX[index] = 22;
  7.     global.hpBarY[index] = 7;
  8.     global.wepX[index] = 24;
  9.     global.wepY[index] = 16;
  10.     global.bwepX[index] = 68;
  11.     global.bwepY[index] = 16;
  12.     global.bulletX[index] = 2;
  13.     global.bulletY[index] = 32;
  14.     global.shellX[index] = 12;
  15.     global.shellY[index] = 32;
  16.     global.boltX[index] = 22;
  17.     global.boltY[index] = 32;
  18.     global.exploX[index] = 32;
  19.     global.exploY[index] = 32;
  20.     global.energyX[index] = 42;
  21.     global.energyY[index] = 32;
  22.     global.lowAmmoX[index] = 54;
  23.     global.lowAmmoY[index] = 34;
  24.     global.lowHealthX[index] = 110;
  25.     global.lowHealthY[index] = 7;
  26. }
  27.  
  28. #define step
  29. with(Player)
  30. {
  31.     player_set_show_hud(index, index, 0);
  32.     with(Player)
  33.     {
  34.         player_set_show_hud(index, other.index, 0);
  35.     }
  36.    
  37.     if(button_check(index, "talk"))
  38.     {
  39.         reload = max(reload, 2);
  40.         can_shoot = 0;
  41.         clicked = 0;
  42.         if(button_pressed(index, "fire"))
  43.         {
  44.             if(mouse_x[index] >= view_xview[index]+global.xpBarX[index]-4
  45.             && mouse_x[index] < view_yview[index]+global.xpBarX[index]+4
  46.             && mouse_y[index] >= view_xview[index]+global.xpBarY[index]-4
  47.             && mouse_y[index] < view_yview[index]+global.xpBarY[index]+4)
  48.             {
  49.                 while(button_check(index, "fire"))
  50.                 {
  51.                     global.xpBarX[index] = mouse_x[index]-view_xview[index];
  52.                     global.xpBarY[index] = mouse_y[index]-view_yview[index];
  53.                     wait(1);
  54.                 }
  55.             }
  56.             else if(mouse_x[index] >= view_xview[index]+global.hpBarX[index]-4
  57.             && mouse_x[index] < view_yview[index]+global.hpBarX[index]+4
  58.             && mouse_y[index] >= view_xview[index]+global.hpBarY[index]-4
  59.             && mouse_y[index] < view_yview[index]+global.hpBarY[index]+4)
  60.             {
  61.                 while(button_check(index, "fire"))
  62.                 {
  63.                     global.hpBarX[index] = mouse_x[index]-view_xview[index];
  64.                     global.hpBarY[index] = mouse_y[index]-view_yview[index];
  65.                     wait(1);
  66.                 }
  67.             }
  68.             else if(mouse_x[index] >= view_xview[index]+global.wepX[index]-4
  69.             && mouse_x[index] < view_yview[index]+global.wepX[index]+4
  70.             && mouse_y[index] >= view_xview[index]+global.wepY[index]-4
  71.             && mouse_y[index] < view_yview[index]+global.wepY[index]+4)
  72.             {
  73.                 while(button_check(index, "fire"))
  74.                 {
  75.                     global.wepX[index] = mouse_x[index]-view_xview[index];
  76.                     global.wepY[index] = mouse_y[index]-view_yview[index];
  77.                     wait(1);
  78.                 }
  79.             }
  80.             else if(mouse_x[index] >= view_xview[index]+global.bwepX[index]-4
  81.             && mouse_x[index] < view_yview[index]+global.bwepX[index]+4
  82.             && mouse_y[index] >= view_xview[index]+global.bwepY[index]-4
  83.             && mouse_y[index] < view_yview[index]+global.bwepY[index]+4)
  84.             {
  85.                 while(button_check(index, "fire"))
  86.                 {
  87.                     global.bwepX[index] = mouse_x[index]-view_xview[index];
  88.                     global.bwepY[index] = mouse_y[index]-view_yview[index];
  89.                     wait(1);
  90.                 }
  91.             }
  92.             else if(mouse_x[index] >= view_xview[index]+global.bulletX[index]-4
  93.             && mouse_x[index] < view_yview[index]+global.bulletX[index]+4
  94.             && mouse_y[index] >= view_xview[index]+global.bulletY[index]-4
  95.             && mouse_y[index] < view_yview[index]+global.bulletY[index]+4)
  96.             {
  97.                 while(button_check(index, "fire"))
  98.                 {
  99.                     global.bulletX[index] = mouse_x[index]-view_xview[index];
  100.                     global.bulletY[index] = mouse_y[index]-view_yview[index];
  101.                     wait(1);
  102.                 }
  103.             }
  104.             else if(mouse_x[index] >= view_xview[index]+global.shellX[index]-4
  105.             && mouse_x[index] < view_yview[index]+global.shellX[index]+4
  106.             && mouse_y[index] >= view_xview[index]+global.shellY[index]-4
  107.             && mouse_y[index] < view_yview[index]+global.shellY[index]+4)
  108.             {
  109.                 while(button_check(index, "fire"))
  110.                 {
  111.                     global.shellX[index] = mouse_x[index]-view_xview[index];
  112.                     global.shellY[index] = mouse_y[index]-view_yview[index];
  113.                     wait(1);
  114.                 }
  115.             }
  116.             else if(mouse_x[index] >= view_xview[index]+global.boltX[index]-4
  117.             && mouse_x[index] < view_yview[index]+global.boltX[index]+4
  118.             && mouse_y[index] >= view_xview[index]+global.boltY[index]-4
  119.             && mouse_y[index] < view_yview[index]+global.boltY[index]+4)
  120.             {
  121.                 while(button_check(index, "fire"))
  122.                 {
  123.                     global.boltX[index] = mouse_x[index]-view_xview[index];
  124.                     global.boltY[index] = mouse_y[index]-view_yview[index];
  125.                     wait(1);
  126.                 }
  127.             }
  128.             else if(mouse_x[index] >= view_xview[index]+global.exploX[index]-4
  129.             && mouse_x[index] < view_yview[index]+global.exploX[index]+4
  130.             && mouse_y[index] >= view_xview[index]+global.exploY[index]-4
  131.             && mouse_y[index] < view_yview[index]+global.exploY[index]+4)
  132.             {
  133.                 while(button_check(index, "fire"))
  134.                 {
  135.                     global.exploX[index] = mouse_x[index]-view_xview[index];
  136.                     global.exploY[index] = mouse_y[index]-view_yview[index];
  137.                     wait(1);
  138.                 }
  139.             }
  140.             else if(mouse_x[index] >= view_xview[index]+global.energyX[index]-4
  141.             && mouse_x[index] < view_yview[index]+global.energyX[index]+4
  142.             && mouse_y[index] >= view_xview[index]+global.energyY[index]-4
  143.             && mouse_y[index] < view_yview[index]+global.energyY[index]+4)
  144.             {
  145.                 while(button_check(index, "fire"))
  146.                 {
  147.                     global.energyX[index] = mouse_x[index]-view_xview[index];
  148.                     global.energyY[index] = mouse_y[index]-view_yview[index];
  149.                     wait(1);
  150.                 }
  151.             }
  152.             else if(mouse_x[index] >= view_xview[index]+global.lowAmmoX[index]-4
  153.             && mouse_x[index] < view_yview[index]+global.lowAmmoX[index]+4
  154.             && mouse_y[index] >= view_xview[index]+global.lowAmmoY[index]-4
  155.             && mouse_y[index] < view_yview[index]+global.lowAmmoY[index]+4)
  156.             {
  157.                 while(button_check(index, "fire"))
  158.                 {
  159.                     global.lowAmmoX[index] = mouse_x[index]-view_xview[index];
  160.                     global.lowAmmoY[index] = mouse_y[index]-view_yview[index];
  161.                     wait(1);
  162.                 }
  163.             }
  164.             else if(mouse_x[index] >= view_xview[index]+global.lowHealthX[index]-4
  165.             && mouse_x[index] < view_yview[index]+global.lowHealthX[index]+4
  166.             && mouse_y[index] >= view_xview[index]+global.lowHealthY[index]-4
  167.             && mouse_y[index] < view_yview[index]+global.lowHealthY[index]+4)
  168.             {
  169.                 while(button_check(index, "fire"))
  170.                 {
  171.                     global.lowHealthX[index] = mouse_x[index]-view_xview[index];
  172.                     global.lowHealthY[index] = mouse_y[index]-view_yview[index];
  173.                     wait(1);
  174.                 }
  175.             }
  176.         }
  177.     }
  178. }
  179.  
  180. #define draw_gui
  181. with(Player)
  182. {
  183.     // set clientside
  184.     with(Player)
  185.     {
  186.         draw_set_visible(index, 0);
  187.     }
  188.     draw_set_visible(index, 1);
  189.    
  190.     // xp bar
  191.     draw_sprite(sprExpBar, 0, 0+global.xpBarX[index], 0+global.xpBarY[index]);
  192.  
  193.     // hp bar
  194.     draw_sprite(sprHealthBar, 2, 0+global.hpBarX[index]-2, 0+global.hpBarY[index]-3);
  195.  
  196.     if(maxhealth > 0)
  197.     {
  198.         //draw_sprite_ext(sprHealthFill, 2, 0+global.hpBarX[index], 0+global.hpBarY[index], max(0, 84*(lsthealth/maxhealth)), 1, 0, c_white, 1);
  199.         //draw_sprite_ext(sprHealthFill, 1, 0+global.hpBarX[index], 0+global.hpBarY[index], max(0, 84*(my_health/maxhealth)), 1, 0, c_white, 1);
  200.        
  201.         draw_set_color(merge_color(player_get_color(index), c_black, 0.5));
  202.         draw_rectangle(0+global.hpBarX[index], 0+global.hpBarY[index], 0+global.hpBarX[index]+max(0, 84*(lsthealth/maxhealth))-1, 0+global.hpBarY[index]+7, 0);
  203.         draw_set_color(player_get_color(index));
  204.         draw_rectangle(0+global.hpBarX[index], 0+global.hpBarY[index], 0+global.hpBarX[index]+max(0, 84*(my_health/maxhealth))-1, 0+global.hpBarY[index]+7, 0);
  205.         draw_set_color(c_white);
  206.        
  207.         if(((sprite_index == spr_hurt
  208.           && image_index < 1
  209.           && !instance_exists(Portal))
  210.          || lsthealth < my_health)
  211.         && !instance_exists(GenCont)
  212.         && !instance_exists(LevCont))
  213.         {
  214.             draw_sprite_ext(sprHealthFill, 0, 0+global.hpBarX[index], 0+global.hpBarY[index], max(0, 84*(my_health/maxhealth)), 1, 0, c_white, 1);
  215.         }
  216.     }
  217.    
  218.     // hp text
  219.     draw_set_halign(fa_center);
  220.     if((!((sprite_index == spr_hurt
  221.         && image_index < 1
  222.         && !instance_exists(Portal))
  223.        || lsthealth < my_health)
  224.     || sin(wave) > 0)
  225.     || instance_exists(GenCont)
  226.     || instance_exists(LevCont))
  227.     {
  228.         draw_set_color(c_black);
  229.         draw_text(0+global.hpBarX[index]+1+44, 0+global.hpBarY[index]+1, string(round(my_health))+"/"+string(maxhealth));
  230.         draw_text(0+global.hpBarX[index]+1+45, 0+global.hpBarY[index]+1, string(round(my_health))+"/"+string(maxhealth));
  231.         draw_text(0+global.hpBarX[index]+1+45, 0+global.hpBarY[index], string(round(my_health))+"/"+string(maxhealth));
  232.         draw_set_color(c_white);
  233.         draw_text(0+global.hpBarX[index]+1+44, 0+global.hpBarY[index], string(round(my_health))+"/"+string(maxhealth));
  234.     }
  235.    
  236.     // bwep
  237.     if(bwep != "")
  238.     {
  239.         var spr, col, wid;
  240.         spr = weapon_get_sprt(bwep);
  241.         wid = 16;
  242.         if(weapon_get_type(bwep) == 0)
  243.         {
  244.             wid = 32;
  245.         }
  246.         col = c_dkgray;
  247.         if(race == "steroids")
  248.         {
  249.             col = c_white;
  250.         }
  251.         if(col == c_white
  252.         || instance_exists(GenCont)
  253.         || instance_exists(LevCont))
  254.         {
  255.             draw_sprite_part_ext(spr, 1, sprite_get_xoffset(spr), sprite_get_yoffset(spr)-8, wid, 14, 0+global.bwepX[index]-1, 0+global.bwepY[index], 1, 1, col, 1);
  256.             draw_sprite_part_ext(spr, 1, sprite_get_xoffset(spr), sprite_get_yoffset(spr)-8, wid, 14, 0+global.bwepX[index]+1, 0+global.bwepY[index], 1, 1, col, 1);
  257.             draw_sprite_part_ext(spr, 1, sprite_get_xoffset(spr), sprite_get_yoffset(spr)-8, wid, 14, 0+global.bwepX[index], 0+global.bwepY[index]-1, 1, 1, col, 1);
  258.             draw_sprite_part_ext(spr, 1, sprite_get_xoffset(spr), sprite_get_yoffset(spr)-8, wid, 14, 0+global.bwepX[index], 0+global.bwepY[index]+1, 1, 1, col, 1);
  259.         }
  260.        
  261.         draw_sprite_part_ext(spr, 1, sprite_get_xoffset(spr), sprite_get_yoffset(spr)-8, wid, 14, 0+global.bwepX[index], 0+global.bwepY[index], 1, 1, c_black, 1);
  262.         draw_sprite_part_ext(spr, 1, sprite_get_xoffset(spr), sprite_get_yoffset(spr)-8, max(0, wid*min(weapon_get_load(bwep), breload/weapon_get_load(bwep))), 14, 0+global.bwepX[index], 0+global.bwepY[index], 1, 1, c_white, 0.2);
  263.        
  264.         if(weapon_get_type(bwep) != 0)
  265.         {
  266.             draw_set_halign(fa_left);
  267.             draw_set_color(c_black);
  268.             draw_text(0+global.bwepX[index]+18, 0+global.bwepY[index]+6, string(ammo[weapon_get_type(bwep)]));
  269.             draw_text(0+global.bwepX[index]+19, 0+global.bwepY[index]+6, string(ammo[weapon_get_type(bwep)]));
  270.             draw_text(0+global.bwepX[index]+19, 0+global.bwepY[index]+5, string(ammo[weapon_get_type(bwep)]));
  271.             if(race == "steroids"
  272.             || weapon_get_type(wep) == weapon_get_type(bwep))
  273.             {
  274.                 draw_set_color(c_white);
  275.             }
  276.             else
  277.             {
  278.                 draw_set_color(c_silver);
  279.             }
  280.             if(ammo[weapon_get_type(bwep)] <= typ_ammo[weapon_get_type(bwep)])
  281.             {
  282.                 if(race == "steroids"
  283.                 || weapon_get_type(wep) == weapon_get_type(bwep))
  284.                     draw_set_color(c_red);
  285.                 else
  286.                     draw_set_color(c_gray);
  287.             }
  288.             if(ammo[weapon_get_type(bwep)] == 0)
  289.             {
  290.                 draw_set_color(c_dkgray);
  291.             }
  292.             draw_text(0+global.bwepX[index]+18, 0+global.bwepY[index]+5, string(ammo[weapon_get_type(bwep)]));
  293.         }
  294.     }
  295.    
  296.    
  297.     // wep
  298.     var spr, wid;
  299.     spr = weapon_get_sprite(wep)
  300.     wid = 16
  301.     if weapon_get_type(wep) = 0
  302.     wid = 32
  303.     if(wep != "")
  304.     {
  305.         draw_sprite_part_ext(spr, 1, sprite_get_xoffset(spr), sprite_get_yoffset(spr)-8, wid, 14, 0+global.wepX[index]+1, 0+global.wepY[index], 1, 1, c_white, 1);
  306.         draw_sprite_part_ext(spr, 1, sprite_get_xoffset(spr), sprite_get_yoffset(spr)-8, wid, 14, 0+global.wepX[index]-1, 0+global.wepY[index], 1, 1, c_white, 1);
  307.         draw_sprite_part_ext(spr, 1, sprite_get_xoffset(spr), sprite_get_yoffset(spr)-8, wid, 14, 0+global.wepX[index], 0+global.wepY[index]+1 , 1, 1, c_white, 1);
  308.         draw_sprite_part_ext(spr, 1, sprite_get_xoffset(spr), sprite_get_yoffset(spr)-8, wid, 14, 0+global.wepX[index], 0+global.wepY[index]-1 , 1, 1, c_white, 1);
  309.        
  310.         draw_sprite_part_ext(spr, 1, sprite_get_xoffset(spr), sprite_get_yoffset(spr)-8, wid, 14, 0+global.wepX[index], 0+global.wepY[index], 1, 1, c_black, 1);
  311.         draw_sprite_part_ext(spr, 1, sprite_get_xoffset(spr), sprite_get_yoffset(spr)-8, max(0, wid*min(weapon_get_load(wep), reload/weapon_get_load(wep))), 14, 0+global.wepX[index], 0+global.wepY[index], 1, 1, c_white, 0.2);
  312.     }
  313.    
  314.     if(weapon_get_type(wep) != 0)
  315.     {
  316.         draw_set_halign(fa_left);
  317.         draw_set_color(c_black);
  318.         draw_text(0+global.wepX[index]+18, 0+global.wepY[index]+6, string(ammo[weapon_get_type(wep)]));
  319.         draw_text(0+global.wepX[index]+19, 0+global.wepY[index]+5, string(ammo[weapon_get_type(wep)]));
  320.         draw_text(0+global.wepX[index]+19, 0+global.wepY[index]+6, string(ammo[weapon_get_type(wep)]));
  321.        
  322.         draw_set_color(c_white);
  323.         if(ammo[weapon_get_type(wep)] <= typ_ammo[weapon_get_type(wep)])
  324.         {
  325.             draw_set_color(c_red);
  326.         }
  327.         if(ammo[weapon_get_type(wep)] == 0)
  328.         {
  329.             draw_set_color(c_dkgray);
  330.         }
  331.         draw_text(0+global.wepX[index]+18, 0+global.wepY[index]+5, string(ammo[weapon_get_type(wep)]));
  332.     }
  333.    
  334.     // xp bar
  335.     draw_set_halign(fa_center);
  336.     if(GameCont.skillpoints > 0)
  337.     {
  338.         draw_sprite(sprExpBarLevel, 0, 0+global.xpBarX[index], 0+global.xpBarY[index]);
  339.     }
  340.     draw_sprite(sprExpBar, (GameCont.rad/(60*GameCont.level))*16, 0+global.xpBarX[index], 0+global.xpBarY[index]);
  341.     if(GameCont.level == 10)
  342.     {
  343.         draw_set_color(c_white);
  344.         draw_sprite(sprUltraLevel, 0, 0+global.xpBarX[index]+7, 0+global.xpBarY[index]+12);
  345.     }
  346.     else
  347.     {
  348.         draw_set_color(c_black);
  349.         draw_text(0+global.xpBarX[index]+7, 0+global.xpBarY[index]+13-string_height("A")/2, string(GameCont.level));
  350.         draw_text(0+global.xpBarX[index]+8, 0+global.xpBarY[index]+13-string_height("A")/2, string(GameCont.level));
  351.         draw_text(0+global.xpBarX[index]+8, 0+global.xpBarY[index]+12-string_height("A")/2, string(GameCont.level));
  352.         draw_set_color(c_white);
  353.         draw_text(0+global.xpBarX[index]+7, 0+global.xpBarY[index]+12-string_height("A")/2, string(GameCont.level));
  354.     }
  355.    
  356.     // ammo icons
  357.     var img = 0;
  358.     if(weapon_get_type(bwep) == 1)
  359.     {
  360.         img = 1;
  361.     }
  362.     if(weapon_get_type(wep) == 1
  363.     || (race == "steroids" && weapon_get_type(bwep) == 1))
  364.     {
  365.         img = 2;
  366.     }
  367.     draw_sprite(sprBulletIconBG, img, 0+global.bulletX[index], 0+global.bulletY[index]);
  368.     draw_sprite(sprBulletIcon, 7-ceil((ammo[1]/typ_amax[1])*7), 0+global.bulletX[index], 0+global.bulletY[index]);
  369.    
  370.     var img = 0;
  371.     if(weapon_get_type(bwep) == 2)
  372.     {
  373.         img = 1;
  374.     }
  375.     if(weapon_get_type(wep) == 2
  376.     || (race == "steroids" && weapon_get_type(bwep) == 2))
  377.     {
  378.         img = 2;
  379.     }
  380.     draw_sprite(sprShotIconBG, img, 0+global.shellX[index], 0+global.shellY[index]);
  381.     draw_sprite(sprShotIcon, 7-ceil((ammo[2]/typ_amax[2])*7), 0+global.shellX[index], 0+global.shellY[index]);
  382.    
  383.     var img = 0;
  384.     if(weapon_get_type(bwep) == 3)
  385.     {
  386.         img = 1;
  387.     }
  388.     if(weapon_get_type(wep) == 3
  389.     || (race == "steroids" && weapon_get_type(bwep) == 3))
  390.     {
  391.         img = 2;
  392.     }
  393.     draw_sprite(sprBoltIconBG, img, 0+global.boltX[index], 0+global.boltY[index]);
  394.     draw_sprite(sprBoltIcon, 7-ceil((ammo[3]/typ_amax[3])*7), 0+global.boltX[index], 0+global.boltY[index]);
  395.    
  396.     var img = 0;
  397.     if(weapon_get_type(bwep) == 4)
  398.     {
  399.         img = 1;
  400.     }
  401.     if(weapon_get_type(wep) == 4
  402.     || (race == "steroids" && weapon_get_type(bwep) == 4))
  403.     {
  404.         img = 2;
  405.     }
  406.     draw_sprite(sprExploIconBG, img, 0+global.exploX[index], 0+global.exploY[index]);
  407.     draw_sprite(sprExploIcon, 7-ceil((ammo[4]/typ_amax[4])*7), 0+global.exploX[index], 0+global.exploY[index]);
  408.    
  409.     var img = 0;
  410.     if(weapon_get_type(bwep) == 5)
  411.     {
  412.         img = 1;
  413.     }
  414.     if(weapon_get_type(wep) == 5
  415.     || (race == "steroids" && weapon_get_type(bwep) == 5))
  416.     {
  417.         img = 2;
  418.     }
  419.     draw_sprite(sprEnergyIconBG, img, 0+global.energyX[index], 0+global.energyY[index]);
  420.     draw_sprite(sprEnergyIcon, 7-ceil((ammo[5]/typ_amax[5])*7), 0+global.energyX[index], 0+global.energyY[index]);
  421.    
  422.     // low ammo warning
  423.    
  424.     if(ammo[weapon_get_type(wep)] <= typ_ammo[weapon_get_type(wep)]
  425.     && sin(wave) > 0
  426.     && drawempty > 0)
  427.     {
  428.         if(drawempty == 10
  429.         && ammo[weapon_get_type(wep)] > typ_ammo[weapon_get_type(wep)]-weapon_get_cost(wep))
  430.         {
  431.             sound_play(snd_lowa);
  432.         }
  433.         drawempty -= 1;
  434.        
  435.         var txt = "LOW "+string(typ_name[weapon_get_type(wep)]);
  436.         if(ammo[weapon_get_type(wep)] < weapon_get_cost(wep))
  437.         {
  438.             if(ammo[weapon_get_type(wep)] > 0)
  439.             {
  440.                 txt = "NOT ENOUGH "+string(typ_name[weapon_get_type(wep)]);
  441.             }
  442.             else
  443.             {
  444.                 txt = "EMPTY[index]";
  445.             }
  446.         }
  447.         draw_set_halign(fa_left);
  448.         draw_set_color(c_black);
  449.         draw_text(0+global.lowAmmoX[index]+1, 0+global.lowAmmoY[index], string(txt));
  450.         draw_text(0+global.lowAmmoX[index]+1, 0+global.lowAmmoY[index]+1, string(txt));
  451.         draw_text(0+global.lowAmmoX[index], 0+global.lowAmmoY[index]+1, string(txt));
  452.         draw_set_color(c_red);
  453.         draw_text(0+global.lowAmmoX[index], 0+global.lowAmmoY[index], string(txt));
  454.     }
  455.    
  456.    
  457.     // low hp warning
  458.    
  459.     if(my_health <= 4
  460.     && my_health != maxhealth
  461.     && sin(wave) > 0
  462.     && drawlowhp > 0)
  463.     {
  464.         drawlowhp -= 1;
  465.         draw_set_halign(fa_left);
  466.         draw_set_color(c_black);
  467.         draw_text(0+global.lowHealthX[index]+1, 0+global.lowHealthY[index], "LOW HP");
  468.         draw_text(0+global.lowHealthX[index]+1, 0+global.lowHealthY[index]+1, "LOW HP");
  469.         draw_text(0+global.lowHealthX[index], 0+global.lowHealthY[index]+1, "LOW HP");
  470.         draw_set_color(c_red);
  471.         draw_text(0+global.lowHealthX[index], 0+global.lowHealthY[index], "LOW HP");
  472.     }
  473.    
  474.     // show editable fields
  475.     if(button_check(index, "talk"))
  476.     {
  477.         var ex = global.xpBarX[index], ey = global.xpBarY[index];
  478.         draw_set_color(merge_color(c_lime, c_black, 0.5));
  479.         draw_rectangle(0+ex-4, 0+ey-4, 0+ex+4, 0+ey+4, 0);
  480.         draw_set_color(c_lime);
  481.         draw_rectangle(0+ex-4, 0+ey-4, 0+ex+4, 0+ey+4, 1);
  482.        
  483.         var ex = global.hpBarX[index], ey = global.hpBarY[index];
  484.         draw_set_color(merge_color(player_get_color(index), c_black, 0.5));
  485.         draw_rectangle(0+ex-4, 0+ey-4, 0+ex+4, 0+ey+4, 0);
  486.         draw_set_color(player_get_color(index));
  487.         draw_rectangle(0+ex-4, 0+ey-4, 0+ex+4, 0+ey+4, 1);
  488.        
  489.         var ex = global.wepX[index], ey = global.wepY[index];
  490.         draw_set_color(merge_color(c_white, c_black, 0.5));
  491.         draw_rectangle(0+ex-4, 0+ey-4, 0+ex+4, 0+ey+4, 0);
  492.         draw_set_color(c_black);
  493.         draw_rectangle(0+ex-4, 0+ey-4, 0+ex+4, 0+ey+4, 1);
  494.        
  495.         var ex = global.bwepX[index], ey = global.bwepY[index];
  496.         draw_set_color(merge_color(c_white, c_black, 0.5));
  497.         draw_rectangle(0+ex-4, 0+ey-4, 0+ex+4, 0+ey+4, 0);
  498.         draw_set_color(c_black);
  499.         draw_rectangle(0+ex-4, 0+ey-4, 0+ex+4, 0+ey+4, 1);
  500.        
  501.         var ex = global.bulletX[index], ey = global.bulletY[index];
  502.         draw_set_color(merge_color(c_orange, c_black, 0.5));
  503.         draw_rectangle(0+ex-4, 0+ey-4, 0+ex+4, 0+ey+4, 0);
  504.         draw_set_color(c_orange);
  505.         draw_rectangle(0+ex-4, 0+ey-4, 0+ex+4, 0+ey+4, 1);
  506.        
  507.         var ex = global.shellX[index], ey = global.shellY[index];
  508.         draw_set_color(merge_color(c_orange, c_black, 0.5));
  509.         draw_rectangle(0+ex-4, 0+ey-4, 0+ex+4, 0+ey+4, 0);
  510.         draw_set_color(c_orange);
  511.         draw_rectangle(0+ex-4, 0+ey-4, 0+ex+4, 0+ey+4, 1);
  512.        
  513.         var ex = global.boltX[index], ey = global.boltY[index];
  514.         draw_set_color(merge_color(c_orange, c_black, 0.5));
  515.         draw_rectangle(0+ex-4, 0+ey-4, 0+ex+4, 0+ey+4, 0);
  516.         draw_set_color(c_orange);
  517.         draw_rectangle(0+ex-4, 0+ey-4, 0+ex+4, 0+ey+4, 1);
  518.        
  519.         var ex = global.exploX[index], ey = global.exploY[index];
  520.         draw_set_color(merge_color(c_orange, c_black, 0.5));
  521.         draw_rectangle(0+ex-4, 0+ey-4, 0+ex+4, 0+ey+4, 0);
  522.         draw_set_color(c_orange);
  523.         draw_rectangle(0+ex-4, 0+ey-4, 0+ex+4, 0+ey+4, 1);
  524.        
  525.         var ex = global.energyX[index], ey = global.energyY[index];
  526.         draw_set_color(merge_color(c_orange, c_black, 0.5));
  527.         draw_rectangle(0+ex-4, 0+ey-4, 0+ex+4, 0+ey+4, 0);
  528.         draw_set_color(c_orange);
  529.         draw_rectangle(0+ex-4, 0+ey-4, 0+ex+4, 0+ey+4, 1);
  530.        
  531.         var ex = global.energyX[index], ey = global.energyY[index];
  532.         draw_set_color(merge_color(c_orange, c_black, 0.5));
  533.         draw_rectangle(0+ex-4, 0+ey-4, 0+ex+4, 0+ey+4, 0);
  534.         draw_set_color(c_orange);
  535.         draw_rectangle(0+ex-4, 0+ey-4, 0+ex+4, 0+ey+4, 1);
  536.        
  537.         var ex = global.lowAmmoX[index], ey = global.lowAmmoY[index];
  538.         draw_set_halign(fa_left);
  539.         draw_set_color(merge_color(c_red, c_black, 0.5));
  540.         draw_rectangle(0+ex-4, 0+ey-4, 0+ex+4, 0+ey+4, 0);
  541.         draw_set_color(c_red);
  542.         draw_rectangle(0+ex-4, 0+ey-4, 0+ex+4, 0+ey+4, 1);
  543.         draw_text(0+ex, 0+ey, "LOW AMMO");
  544.        
  545.         var ex = global.lowHealthX[index], ey = global.lowHealthY[index];
  546.         draw_set_color(merge_color(c_red, c_black, 0.5));
  547.         draw_rectangle(0+ex-4, 0+ey-4, 0+ex+4, 0+ey+4, 0);
  548.         draw_set_color(c_red);
  549.         draw_rectangle(0+ex-4, 0+ey-4, 0+ex+4, 0+ey+4, 1);
  550.         draw_text(0+ex, 0+ey, "LOW HP");
  551.     }
  552.    
  553.     // reset clientside
  554.     with(Player)
  555.     {
  556.         draw_set_visible(index, 1);
  557.     }
  558. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement