Guest User

Goggles Desyncer by GhOsT[X]

a guest
Apr 2nd, 2010
427
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.99 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define COLOR_RED 0xAA3333AA
  4.  
  5. #define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1  //CREDIT: DracoBlue
  6.  
  7. new Float:x[MAX_PLAYERS];
  8. new Float:y[MAX_PLAYERS];
  9. new Float:z[MAX_PLAYERS];
  10.  
  11.  
  12. public OnFilterScriptInit()
  13. {
  14.         print("Anti-Esc by GhOsT[X] carregado");
  15.         return 1;
  16. }
  17.  
  18. public OnFilterScriptExit()
  19. {
  20.         print("Anti-Esc by GhOsT[X] descarregado");
  21.         return 1;
  22. }
  23.  
  24.  
  25. public OnPlayerCommandText(playerid, cmdtext[])
  26. {
  27.         dcmd(esc,3,cmdtext);
  28.         return 1;
  29. }
  30.  
  31. dcmd_esc(playerid,params[])
  32. {
  33.    new tmp[256], idx;
  34.    tmp = strtok(params,idx);
  35.    if(!strlen(tmp))
  36.    {
  37.       SendClientMessage(playerid,COLOR_RED,"Use: /esc (playerid");
  38.       return true;
  39.    }
  40.    new pid = strval(tmp);
  41.    if(!IsPlayerConnected(pid) || GetPlayerInterior(pid) != 0 || GetPlayerInterior(playerid) != 0)
  42.    {
  43.       SendClientMessage(playerid,COLOR_RED,"ID Invalido ou Voce/Jogador esta em um interior.");
  44.       return true;
  45.    }
  46.    new pname[MAX_PLAYER_NAME], pname2[MAX_PLAYER_NAME], string2[256], string[256];
  47.    GetPlayerName(playerid, pname2, sizeof(pname2));
  48.    GetPlayerName(pid, pname, sizeof(pname));
  49.    format(string2, sizeof(string2), "Voce usou /esc no jogador: %s.", pname);
  50.    SendClientMessage(playerid,COLOR_RED, string2);
  51.    format(string, sizeof(string), "Jogador: %s usou /esc em voce.", pname2);
  52.    SendClientMessage(pid,COLOR_RED, string);
  53.    GetPlayerPos(pid,Float:x[pid],Float:y[pid],Float:z[pid]);
  54.    SetTimerEx("CheckEsc", 10000, 0, "dd", playerid, pid);
  55.    return 1;
  56. }
  57.  
  58. forward CheckEsc(pid,playerid);
  59. public CheckEsc(pid,playerid)
  60. {
  61. new pname3[MAX_PLAYER_NAME];
  62. new pname4[MAX_PLAYER_NAME];
  63. GetPlayerName(pid, pname3, sizeof(pname3));
  64. GetPlayerName(playerid, pname4, sizeof(pname4));
  65. new Float:fX,Float:fY,Float:fZ;
  66. GetPlayerPos(pid,fX,fY,fZ);
  67. if(x[pid] == fX)
  68. {
  69. new string4[256];
  70. format(string4, sizeof(string4), "Jogador: %s foi kickado por esc por %s.", pname3,pname4);
  71. SendClientMessageToAll(COLOR_RED, string4);
  72. SendClientMessage(pid,COLOR_RED, "Voce foi kickado por esc");
  73. Kick(pid);
  74. }else{
  75. new string3[256];
  76. format(string3, sizeof(string3), "Jogador: %s não esta de esc.", pname3);
  77. SendClientMessage(playerid,COLOR_RED, string3);
  78. }
  79. }
  80.  
  81.  
  82. strtok(const string[], &index)
  83. {
  84.         new length = strlen(string);
  85.         while ((index < length) && (string[index] <= ' '))
  86.  
  87.         {
  88.                 index++;
  89.  
  90.         }
  91.  
  92.         new offset = index;
  93.         new result[20];
  94.         while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  95.  
  96.         {
  97.                 result[index - offset] = string[index];
  98.                 index++;
  99.  
  100.         }
  101.         result[index - offset] = EOS;
  102.         return result;
  103. }
Advertisement
Add Comment
Please, Sign In to add comment