DETONASAMP

CMD:REVIVE

Apr 5th, 2014
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.16 KB | None | 0 0
  1. // This is a comment
  2. // uncomment the line below if you want to write a filterscript
  3. //#define FILTERSCRIPT
  4.  
  5. #include <a_samp>
  6.  
  7. #if defined FILTERSCRIPT
  8.  
  9. public OnFilterScriptInit()
  10. {
  11.     CMD:revive(playerid, params[])
  12. {
  13.     if(PlayerInfo[playerid][pAdmin] >= 3)
  14.     {
  15.         new string[128], giveplayerid;
  16.         if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /revive [playerid]");
  17.  
  18.         if(IsPlayerConnected(giveplayerid))
  19.         {
  20.             if(GetPVarInt(giveplayerid, "Injured") == 1)
  21.             {
  22.                 format(string, sizeof(string), " You have revived %s.", GetPlayerNameEx(giveplayerid));
  23.                 SendClientMessageEx(playerid, COLOR_WHITE, string);
  24.                 SendClientMessageEx(giveplayerid, COLOR_WHITE, "You have been revived by an Admin.");
  25.  
  26.                 KillEMSQueue(giveplayerid);
  27.                 ClearAnimations(giveplayerid);
  28.                 SetPlayerHealth(giveplayerid, 100);
  29.             }
  30.             else
  31.             {
  32.                 SendClientMessageEx(playerid, COLOR_GRAD2, "That player is not injured!");
  33.             }
  34.         }
  35.     }
  36.     else
  37.     {
  38.         SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
  39.     }
  40.     return 1;
  41.    
  42. public OnFilterScriptExit()
  43. {
  44.         return 1;
  45. }
  46.  
  47. #endif
Add Comment
Please, Sign In to add comment