02.11.2009, 18:55
Hey, here's mine first zcmd + sscanf command (/getip).
It is really easy to use sscanf (+zcmd).
Without looking at wiki or forum 
It is really easy to use sscanf (+zcmd).
pawn Код:
COMMAND:getip(playerid,params[])
{
new ip[32],
string[128],
pName[MAX_PLAYER_NAME],
player;
if(sscanf(params,"u",player)) return SendClientMessage(playerid,0xFFFFFFAA,"USAGE: /getip [playerid/name]");
else if(player == INVALID_PLAYER_ID) return SendClientMessage(playerid,0xFFFFFFAA,"Invalid player ID!");
else
{
GetPlayerIp(playerid,ip,sizeof(ip));
GetPlayerName(player,pName,sizeof(pName));
if(player == playerid) format(string,sizeof(string),"Your IP is %s.",ip);
else format(string,sizeof(string),"%s's IP is %s",pName,ip);
SendClientMessage(playerid,0xFFFFFFAA,string);
}
return 1;
}


