kaZax

[FS] AntiCarHack by kaZax

Aug 1st, 2013
367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.97 KB | None | 0 0
  1. //fs by kaZax
  2. //SAMP-RU.ORG
  3. #include <a_samp>
  4. new CarHackTimer;
  5. forward AntiCarHack(playerid);
  6. public AntiCarHack(playerid)
  7. {
  8.     SetPVarInt(playerid, "CarHackBykaZax", 0);
  9.     return 1;
  10. }
  11. public OnPlayerConnect(playerid)
  12. {
  13.     CarHackTimer = SetTimerEx("AntiCarHack",1000,true,"i",playerid);
  14.     return 1;
  15. }
  16. public OnPlayerDisconnect(playerid,reason)
  17. {
  18.     KillTimer(CarHackTimer);
  19.     return 1;
  20. }
  21. public OnPlayerStateChange(playerid, newstate, oldstate)
  22. {
  23.     if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_DRIVER)
  24.     {
  25.         if(GetPVarInt(playerid, "CarHackBykaZax") > 2)
  26.         {
  27.             new str[128],name[24];
  28.             GetPlayerName(playerid,name,24);
  29.             format(str,sizeof(str),"[Античит] Игрок %s[id: %d] был кикнут за Car Hack.[FS by kaZax]",name,playerid);
  30.             SendClientMessageToAll(0xFFFF00FF,str);
  31.             print(str);
  32.             Kick(playerid);
  33.         }
  34.         SetPVarInt(playerid, "CarHackBykaZax", GetPVarInt(playerid, "CarHackBykaZax")+1);
  35.     }
  36.     return 1;
  37. }
Add Comment
Please, Sign In to add comment