Guest User

Ant-Double Players

a guest
Oct 1st, 2014
479
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.04 KB | None | 0 0
  1. /*
  2.     Ant-Double Players by Mandrack_FreeZe
  3.     ***NÃO RETIRE OS CRÉDITOS***
  4. */
  5. #include <a_samp>
  6.  
  7. #define loop(%0,%1) for(new %0; %0 < %1; ++%0)
  8.  
  9. new pSpawnado[MAX_PLAYERS];
  10. public OnFilterScriptInit()
  11. {
  12.     print("\n--------------------------------------");
  13.     print(" Ant Double Players -- Mandrack_FreeZe");
  14.     print("--------------------------------------\n");
  15.     return 1;
  16. }
  17. public OnPlayerDisconnect(playerid)
  18. {
  19.     pSpawnado[playerid] = 0;
  20.     return 1;
  21. }
  22. public OnPlayerConnect(playerid)
  23. {
  24.     new pIP[16];
  25.     new sIP[16];
  26.     new pName[MAX_PLAYER_NAME];
  27.     GetPlayerName(playerid, pName, sizeof(pName));
  28.     loop(i, GetMaxPlayers()-playerid)
  29.     {
  30.         GetPlayerIp(playerid, pIP,sizeof pIP);
  31.         GetPlayerIp(i, sIP,sizeof sIP);
  32.         if(pSpawnado[i] == 1)
  33.         {
  34.             if(strcmp(pIP, pIP) == strcmp(sIP, sIP))
  35.             {
  36.                 Kick(playerid);
  37.                 printf("O player [%d]%s foi kicado por ter 2 IPs logados.", playerid, pName);
  38.             }
  39.         }
  40.     }
  41.    
  42.     return 1;
  43. }
  44.  
  45. public OnPlayerSpawn(playerid)
  46. {
  47.     pSpawnado[playerid] = 1;
  48.     return 1;
  49. }
Advertisement
Add Comment
Please, Sign In to add comment