Advertisement
Guest User

Untitled

a guest
Jan 27th, 2011
3,804
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.67 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define COLOR_RED               0xE10000AA
  4.  
  5. public OnPlayerConnect(playerid)
  6. {
  7.     SetPVarInt(playerid, "LastHP", 0);
  8.     SetPVarInt(playerid, "LastHP1", 0);
  9.     SetPVarInt(playerid, "last_anim", 0);
  10.     return true;
  11. }
  12.  
  13. public OnPlayerDisconnect(playerid)
  14. {
  15.     DeletePVar(playerid, "LastHP");
  16.     DeletePVar(playerid, "LastHP1");
  17.     DeletePVar(playerid, "last_anim");
  18.     return true;
  19. }
  20.  
  21. public OnPlayerUpdate(playerid)
  22. {
  23.     new Float: health, Float: armour;
  24.     GetPlayerHealth(playerid, health);
  25.     GetPlayerArmour(playerid, armour);
  26.     new HP = floatround(health +armour, floatround_floor);
  27.     if (GetPlayerTeam(playerid) == 255)
  28.     {
  29.         new anim_id = GetPlayerAnimationIndex(playerid);
  30.         if (anim_id != GetPVarInt(playerid, "last_anim"))
  31.         {
  32.             if (1071 <= anim_id <= 1086 || 1170 <= anim_id <= 1179 || 1240 <= anim_id <= 1243)
  33.             {
  34.                 if (HP == GetPVarInt(playerid, "LastHP1") && HP == GetPVarInt(playerid, "LastHP"))
  35.                 {
  36.                     new animlib[32], animname[32];
  37.                     GetAnimationName(anim_id, animlib, sizeof(animlib), animname, sizeof(animname));
  38.                     new name[MAX_PLAYER_NAME];
  39.                     GetPlayerName(playerid, name, sizeof(name));
  40.                     new string[128];
  41.                     format(string, sizeof(string), "%s(%d) was shoted, but he didn't lose any health!", name, playerid);
  42.                     SendClientMessageToAll(COLOR_RED, string);
  43.                     // Kick(playerid); / Ban(playerid); / send message to admins etc...
  44.                 }else{
  45.                     SetPVarInt(playerid, "LastHP1", HP);
  46.                 }
  47.             }
  48.             SetPVarInt(playerid, "last_anim", anim_id);
  49.         }
  50.     }
  51.     if (HP != GetPVarInt(playerid, "LastHP"))
  52.     {
  53.         SetPVarInt(playerid, "LastHP", HP);
  54.     }
  55.     return true;
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement