daily pastebin goal
34%
SHARE
TWEET

Untitled

a guest Aug 13th, 2017 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. COMMAND:heal(playerid, params[])
  2. {
  3.     if(gTeam[playerid] == MEDIC || IsPlayerAdmin(playerid))
  4.     {
  5.         if(!params[0])
  6.             return SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /heal [id]");
  7.            
  8.         new helpplayer = strval(params);
  9.         if(!IsPlayerConnected(helpplayer))
  10.             return SendClientMessage(playerid, COLOR_RED, "This player is not online!");
  11.  
  12.         new
  13.             Float: X,
  14.             Float: Y,
  15.             Float: Z;
  16.            
  17.         GetPlayerPos(helpplayer,X,Y,Z);
  18.         if(IsPlayerInRangeOfPoint(playerid, 5.0, X, Y, Z))
  19.         {
  20.             new
  21.                 string[128];
  22.                
  23.             GetPlayerName(playerid, string, MAX_PLAYER_NAME);
  24.             format(string, sizeof string, "[INFO] Medic %s[%d] has healed you!", string, playerid);
  25.             SendClientMessage(helpplayer,COLOR_GREEN,string);
  26.             SetPlayerHealth(helpplayer, 100.0);
  27.             SendClientMessage(playerid, COLOR_YELLOW, "You have succesfuly healed the player !");
  28.             return 1;
  29.         }
  30.         else
  31.             return SendClientMessage(playerid,COLOR_RED,"You're not near the player!");
  32.     }
  33.     else
  34.         return SendClientMessage(playerid,COLOR_RED,"You're not a Medic!");
  35.  
  36.     return 1;
  37. }
RAW Paste Data
Top