Shadoww5

ANTI-ESC

May 7th, 2011
448
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.66 KB | None | 0 0
  1. /*                  NÃO RETIRE OS CREDITOS !!
  2.                 NÃO RETIRE OS CREDITOS !!
  3.  
  4.                        SISTEMA ANTI-ESC
  5.  
  6.  .d8888b.  888                    888                                      888888888  
  7. d88P  Y88b 888                    888                                      888        
  8. Y88b.      888                    888                                      888        
  9.  "Y888b.   88888b.   8888b.   .d88888  .d88b.  888  888  888 888  888  888 8888888b.  
  10.    "Y88b. 888 "88b     "88b d88" 888 d88""88b 888  888  888 888  888  888      "Y88b
  11.       "888 888  888 .d888888 888  888 888  888 888  888  888 888  888  888        888
  12. Y88b  d88P 888  888 888  888 Y88b 888 Y88..88P Y88b 888 d88P Y88b 888 d88P Y88b  d88P
  13. "Y8888P"  888  888 "Y888888  "Y88888  "Y88P"   "Y8888888P"   "Y8888888P"   "Y8888P"
  14.  
  15.                     http://forum.sa-mp.com/member.php?u=123990                        */
  16.  
  17. #include <a_samp>
  18.  
  19. forward AntiEsc(pID, Float:X, Float:Y, Float:Z);
  20.  
  21. public OnFilterScriptInit()
  22. {
  23.     print("--------------------------------------");
  24.     print("     ANTI-ESC CARREGADO COM SUCESSO");
  25.     print("           Criado por Shadoww5");
  26.     print("--------------------------------------\n");
  27.     return 1;
  28. }
  29.  
  30. public OnFilterScriptExit()
  31. {
  32.     print("--------------------------------------");
  33.     print("         ANTI-ESC DESCARREGADO");
  34.     print("          Criado por Shadoww5");
  35.     print("--------------------------------------\n");
  36.     return 1;
  37. }
  38. public OnPlayerConnect(playerid) return SendClientMessage(playerid,0xFFFF00FF," Este servidor usa o Sistema ANTI-ESC - Desenvolvido por Shadoww5");
  39.  
  40. public OnPlayerCommandText(playerid, cmdtext[])
  41. {
  42.     new cmd[256], idx;
  43.     cmd = strtok(cmdtext, idx);
  44.     if(strcmp(cmd, "/esc", true) == 0)
  45.     {
  46.         new id[256], acusado, Float:Pos[3];
  47.         if(GetTickCount() - GetPVarInt(playerid, "Tick") < 120000) return SendClientMessage(playerid, 0xFFFFFFAA, " Aguarde 2 minutos para acusar outra pessoa novamente !");
  48.         id = strtok(cmdtext,idx);
  49.         if(!strlen(id)) return SendClientMessage(playerid, 0xFFFFFFFF, "USO: /esc [playerid/Parte-do-Nick]");
  50.         acusado = strval(id);
  51.         if(!IsPlayerConnected(acusado)) return SendClientMessage(playerid, 0xFFFFFFAA, " O jogador está OFFLINE.");
  52.         GetPlayerPos(acusado, Pos[0], Pos[1], Pos[2]);
  53.         if(!IsPlayerInRangeOfPoint(playerid, 5.0, Pos[0], Pos[1], Pos[2])) return SendClientMessage(playerid, 0xFFFFFFAA, " Você está longe do acusado !");
  54.         SendClientMessage(playerid, 0xAFAFAFAA, " Você acusou alguem de estar de ESC");
  55.         SendClientMessage(acusado, 0xFFFF00FF, " Você foi acusado de estar de ESC. Mova-se ou será kickado !");
  56.         SetPVarInt(playerid, "Tick", GetTickCount());
  57.         SetTimerEx("AntiEsc", 5000, false, "dfff", acusado, Pos[0], Pos[1], Pos[2]);
  58.         return 1;
  59.     }
  60.     return 0;
  61. }
  62. public AntiEsc(pID, Float:X, Float:Y, Float:Z)
  63. {
  64.     new Float:Pos[3], nome[MAX_PLAYER_NAME];
  65.     GetPlayerPos(pID, Pos[0], Pos[1], Pos[2]);
  66.     GetPlayerName(pID,nome,sizeof(nome));
  67.     if(Pos[0] == X && Pos[1] == Y && Pos[2] == Z)
  68.     {
  69.         new string[75];
  70.         SendClientMessage(pID,0xFF0000FF, " Você foi kickado por estar de ESC !");
  71.         Kick(pID);
  72.         format(string,sizeof(string)," %s foi kickado por ESC/RT !", nome);
  73.         SendClientMessageToAll(0x04D62EFF, string);
  74.     }
  75.     else { SendClientMessage(pID,0xFFFF00FF, " Você se moveu e por isso não será kickado."); }
  76.     return 1;
  77. }
  78. strtok(const string[], &index)
  79. {
  80.     new length = strlen(string);
  81.     while ((index < length) && (string[index] <= ' '))
  82.     {
  83.         index++;
  84.     }
  85.  
  86.     new offset = index;
  87.     new result[20];
  88.     while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  89.     {
  90.         result[index - offset] = string[index];
  91.         index++;
  92.     }
  93.     result[index - offset] = EOS;
  94.     return result;
  95. }
Advertisement
Add Comment
Please, Sign In to add comment