Advertisement
Samp-Pawn

Anti GodMode - Samp

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