Advertisement
Guest User

Untitled

a guest
Nov 9th, 2012
881
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. // Anti fake kill for samp 0.3e by Neonman.
  2.  
  3. #include <a_samp>
  4. #include <foreach>
  5.  
  6. 7885
  7. new LastDeath[MAX_PLAYERS],
  8. DeathSpam[MAX_PLAYERS],
  9. bool:Spawned[MAX_PLAYERS];
  10.  
  11. public OnPlayerConnect(playerid)
  12. {
  13. LastDeath[playerid] = 0,
  14. DeathSpam[playerid] = 0,
  15. Spawned[playerid] = false;
  16. return 1;
  17. }
  18.  
  19. public OnPlayerSpawn(playerid)
  20. {
  21. Spawned[playerid] = true;
  22. return 1;
  23. }
  24.  
  25. public OnPlayerDeath(playerid, killerid, reason)
  26. {
  27. new time = gettime();
  28. switch(time - LastDeath[playerid])
  29. {
  30. case 0..3:
  31. {
  32. DeathSpam[playerid]++;
  33. if(DeathSpam[playerid] == 3) // The maximum spam of deaths after the cheater will get banned.
  34. {
  35. SendClientMessage(playerid, 0xCC0000AA, "You have been banned from the server for fake kill. If you want to get unbanned, visit our website. ");
  36. Ban(playerid);
  37. }
  38. return 1;
  39. }
  40. default: DeathSpam[playerid] = 0;
  41. }
  42. LastDeath[playerid] = time;
  43. Spawned[playerid] = false;
  44. return 1;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement