GetPlayerIp

From SA-MP Wiki

Jump to: navigation, search

GetPlayerIp


Get the specified player's IP and store it in a string.


Parameters:
(playerid, name[], len)
playeridThe ID of the player to get the IP of
name[]The string to store the player's IP in, passed by reference
lenThe maximum size of the IP. (Recommended 16)


Returns1 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.

Personal tools
In other languages