Advertisement
Guest User

Anti Race Checkpoint Cheater 0.2

a guest
Oct 6th, 2015
348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.05 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. //Variáveis globais
  4. new TimerTeleportCP[MAX_PLAYERS];
  5.  
  6. //Variável da posição do jogador
  7. enum posInfo
  8. {
  9. Float:pX,
  10. Float:pY,
  11. Float:pZ,
  12. Float:pA
  13. };
  14. new pos_info[MAX_PLAYERS][posInfo];
  15.  
  16. public OnFilterScriptInit()
  17. {
  18. print("****************************************************************");
  19. print("* *");
  20. print("* Sistema anti Race Checkpoint cheater carregado! *");
  21. print("* Criado por Rafael Hirsch (Maudruga) *");
  22. print("* *");
  23. print("****************************************************************");
  24. return 1;
  25. }
  26.  
  27. public OnFilterScriptExit()
  28. {
  29. return 1;
  30. }
  31.  
  32. public OnPlayerDisconnect(playerid, reason)
  33. {
  34. //Cancelar o timer ao de desconectar!
  35. KillTimer(TimerTeleportCP[playerid]);
  36. return 1;
  37. }
  38.  
  39. public OnPlayerSpawn(playerid)
  40. {
  41. //Cancelar o timer ao dar spawn!
  42. KillTimer(TimerTeleportCP[playerid]);
  43. return 1;
  44. }
  45.  
  46. public OnPlayerDeath(playerid, killerid, reason)
  47. {
  48. //Cancelar o timer ao morrer!
  49. KillTimer(TimerTeleportCP[playerid]);
  50. return 1;
  51. }
  52.  
  53. public OnPlayerCommandText(playerid, cmdtext[])
  54. {
  55. //Aconselho para que inicentes não sejam punidos, usar essa função --> KillTimer(TimerTeleportCP[playerid]);
  56. //em todos comandos de teleportes disponiveis na corrida, principalmente no de "/sair" da corrida.
  57.  
  58. //EXEMPLO:
  59. if (strcmp("/saircorrida", cmdtext, true, 10) == 0)
  60. {
  61. //Cancelar o timer ao dar o comando "/saircorrida" !
  62. KillTimer(TimerTeleportCP[playerid]);
  63. //Outras funções...
  64. return 1;
  65. }
  66. return 0;
  67. }
  68.  
  69. //Ao entrar em um "Race Checkpoint" ele fará...
  70. public OnPlayerEnterRaceCheckpoint(playerid)
  71. {
  72. //Pega a posição do jogador que entrou no "Race Checkpoint".
  73. GetPlayerPos(playerid, pos_info[playerid][pX], pos_info[playerid][pY], pos_info[playerid][pZ]);
  74. //Inicia a contagem para chamar o função "AntiCP"
  75. TimerTeleportCP[playerid]= SetTimerEx("AntiCP",1000,0, "i", playerid);
  76. return 1;
  77. }
  78.  
  79. //Função que foi chamada pelo settimer depois de 1s
  80. forward AntiCP(playerid);
  81. public AntiCP(playerid)
  82. {
  83. //Se ele estiver em um raio de 70.0 não acontecerá nada!
  84. if(IsPlayerInRangeOfPoint(playerid, 70.0, pos_info[playerid][pX], pos_info[playerid][pY], pos_info[playerid][pZ]))
  85. {
  86. //Aqui é a função que será feita se não for um "cheater", aconselho deixar vazio.
  87. }
  88. //Se ele não tiver no ráio de 70.0 ele será acusado como "cheater"!
  89. else
  90. {
  91. new CheaterStr[128];//Seta quantos caracteres podem estar na string "CheaterStr"
  92. new name[MAX_PLAYER_NAME];//Variável local que pega o nome do cheater.
  93. GetPlayerName(playerid, name, sizeof(name));//Pega o nome do cheater.
  94. format(CheaterStr, sizeof(CheaterStr), "%s está usando \"Cheater\"!", name);//Formata a mensagem para ser mandada.
  95. SendClientMessageToAll(128,CheaterStr);//Manda a mensagem para todos os players.
  96. Kick(playerid); //Kickar jogador.
  97. //BanEx(playerid, CheaterStr); //Banir jogador "Opsional"
  98. }
  99. return 1;
  100. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement