30.03.2013, 01:11
pawn Code:
CMD:ip(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 3)
{
new target;
if(sscanf(params, "u", target)) return SendClientMessage(playerid, COLOR_ORANGE, "[*] Usage: /ip [playerid/name]");
else if(target == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_ORANGE, "[*] Enter a valid player ID/name!");
new ip[16], name[MAX_PLAYER_NAME], string[100];
GetPlayerName(target, name, MAX_PLAYER_NAME);
GetPlayerIP(target, ip, sizeof(ip));
format(string, 100, "|- %s[%d]'s IP: %s -|", name, target, ip);
SendClientMessage(playerid, 0x33AA33AA, string);
}
else return SendClientMessage(playerid, 0xFF0000AA, "You cannot use this command!");
return 1;
}