GetPlayerIp
From SA-MP Wiki
GetPlayerIp
Get the specified player's IP and store it in a string.
(playerid, name[], len)
| playerid | The ID of the player to get the IP of |
| name[] | The string to store the player's IP in, passed by reference |
| len | The maximum size of the IP. (Recommended 16) |
| Returns | 1 on success and 0 on failure. |
public OnPlayerConnect(playerid) { new plrIP[16]; GetPlayerIp(playerid, plrIP, sizeof(plrIP)); if(!strcmp(plrIP, "127.0.0.1")) SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to your server, master :)"); return 1; }
Related Functions
The following functions might be useful as well, as they're related to this function in one way or another.
- GetPlayerName: Get a player's name.
- GetPlayerPing: Get the ping of a player.
