DiogoB

[Pawn] GetPlayerIP(ip[]) (IP POR ID)

Mar 16th, 2012
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.37 KB | None | 0 0
  1. GetPlayerIP(ip[])
  2. {
  3.     static
  4.         pIp[16],
  5.         x,
  6.         y;
  7.  
  8.     x = 0;
  9.     y = GetMaxPlayers();
  10.  
  11.     for( ; x != y; x++)
  12.     {
  13.         if(IsPlayerConnected(x) && !IsPlayerNPC(x))
  14.         {
  15.             GetPlayerIP(x, pIp, sizeof(pIP));
  16.             if(!strcmp(ip, pIp, true))
  17.                 return x;
  18.         }
  19.     }
  20.     return INVALID_PLAYER_ID;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment