Advertisement
Guest User

Anti Cheat - SAMP 0.3.7

a guest
Feb 8th, 2016
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.61 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. forward DetectCheat(playerid, parte);
  4. public OnFilterScriptInit()
  5. {
  6.     print("AntiCheat 0.3.7");
  7.     return 1;
  8. }
  9.  
  10. public OnFilterScriptExit()
  11. {
  12.     return 1;
  13. }
  14.  
  15. enum pCheat {
  16.     bool:Checado,
  17.     bool:Checando,
  18.     TempoChecagem,
  19.     GolfClubID
  20. };
  21. new PlayerDetectCheat[MAX_PLAYERS][pCheat];
  22. public OnPlayerConnect(playerid)
  23. {
  24.     return 1;
  25. }
  26.  
  27. public OnPlayerDisconnect(playerid, reason)
  28. {
  29.     KillTimer(PlayerDetectCheat[playerid][TempoChecagem]);
  30.     for(new pCheat:p; p < pCheat; p++)
  31.         PlayerDetectCheat[playerid][p] = 0;
  32.     return 1;
  33. }
  34.  
  35. public OnPlayerSpawn(playerid)
  36. {
  37.     if(PlayerDetectCheat[playerid][Checado] == false) {
  38.         new Float:xyz[3];
  39.         GetPlayerPos(playerid,xyz[0],xyz[1],xyz[2]);
  40.         PlayerDetectCheat[playerid][Checando] = true;
  41.         PlayerDetectCheat[playerid][GolfClubID] = CreateVehicle(457, xyz[0],xyz[1],xyz[2], 0.0, 0, 0, 0);
  42.         SetVehicleVirtualWorld(PlayerDetectCheat[playerid][GolfClubID], playerid+1);
  43.         SetPlayerVirtualWorld(playerid, playerid+1);
  44.         PutPlayerInVehicle(playerid,PlayerDetectCheat[playerid][GolfClubID], 0);
  45.         TogglePlayerControllable(playerid, false);
  46.         PlayerDetectCheat[playerid][TempoChecagem]=SetTimerEx("DetectCheat", 300, false, "dd", playerid, 0);
  47.         GameTextForPlayer(playerid, "~w~Nao interrompa a checagem!", 10000, 4);
  48.     }
  49.     return 1;
  50. }
  51. public DetectCheat(playerid, parte) {
  52.     new Armas, Mun;
  53.     switch(parte) {
  54.         case 0: {
  55.             RemovePlayerFromVehicle(playerid);
  56.             DestroyVehicle(PlayerDetectCheat[playerid][GolfClubID]);
  57.             PlayerDetectCheat[playerid][TempoChecagem]=SetTimerEx("DetectCheat", 2000, false, "dd", playerid,1);
  58.         }
  59.         case 1: {
  60.             PlayerDetectCheat[playerid][Checado] = true;
  61.             PlayerDetectCheat[playerid][Checando] = false;
  62.             SetPlayerVirtualWorld(playerid, 0);
  63.             TogglePlayerControllable(playerid, true);
  64.             GetPlayerWeaponData(playerid, 1, Armas, Mun);
  65.             if(Armas == 2) return Kick(playerid);
  66.             GameTextForPlayer(playerid, "~g~Checagem concluida!", 5000, 4);
  67.        }
  68.    }
  69.     return 1;
  70. }
  71.  
  72.  
  73. public OnPlayerText(playerid, text[])
  74. {
  75.     if(PlayerDetectCheat[playerid][Checando] == true) return SendClientMessage(playerid, -1, "{FFFF00}Aguarde a checagem terminar!"), 0;
  76.     return 1;
  77. }
  78.  
  79. public OnPlayerCommandText(playerid, cmdtext[])
  80. {
  81.     if(PlayerDetectCheat[playerid][Checando] == true) return SendClientMessage(playerid, -1, "{FFFF00}Aguarde a checagem terminar!"), 0;
  82.     return 0;
  83. }
  84.  
  85. /*
  86.     by NicK -> Nícolas Corrêa
  87. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement