18.09.2011, 13:15
If you want to get his id just use tab, if you want his ip here's a command using sscanf
pawn Код:
CMD:getip(playerid, params[])
{
if(Level[playerid] < 1) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: you are not level 1!"); //adminvaiable here
new str[256], id, PlayerName[MAX_PLAYER_NAME];
if(sscanf(params, "u", id))
{
SendClientMessage(playerid, 0xFF0000FF, "Usage: /getip [id]");
return 1;
}
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Player not connected");
if(IsPlayerConnected(id))
{
GetPlayerName(id, PlayerName, sizeof(PlayerName));
new ip[100];
GetPlayerIp(id, ip, sizeof(ip));
format(str, sizeof(str), "%s(%d) ip is: [%s]", PlayerName, playerid, ip);
SendClientMessage(playerid, orange, str);
}
return 1;
}