DiogoB

[Pawn] HeadShot

Apr 8th, 2012
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.90 KB | None | 0 0
  1. #include a_samp
  2. #define tempo (150)
  3. forward cHeadShot();
  4.  
  5. public OnGameModeInit()
  6.     return SetTimer("cHeadShot", tempo, true);
  7.  
  8. public OnPlayerDeath(playerid, killerid, reason)
  9. {
  10.     if(GetPVarInt(playerid, "HS") == 1)
  11.     {
  12.         SetPVarInt(playerid, "HS", 0);
  13.         GameTextForPlayer(killerid, "~g~Boa, fez um HeadShot!", 2500, 3);
  14.         GameTextForPlayer(playerid, "~r~Sofreu um HeadShot!", 2500, 3);
  15.     }
  16.     return true;
  17. }
  18.  
  19. public cHeadShot()
  20. {
  21.     static
  22.         x,
  23.         y,
  24.         z;
  25.  
  26.     x = playerid;
  27.     y = GetMaxPlayers();
  28.     z = GetPlayerAnimationIndex(playerid);
  29.  
  30.     for( ; x != y; x++)
  31.     {
  32.         if(IsPlayerConnected(x))
  33.         {
  34.             if(z == 1173 || z == 1175 || z == 1177 || z == 1178)
  35.             {
  36.                 SetPVarInt(playerid, "HS", 1);
  37.                 setPlayerHealth(playerid, 0);
  38.             }
  39.         }
  40.     }
  41.     return true;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment