01.10.2015, 15:42
Here is a simple cmd to look your ip(with zcmd)
here is a cmd for rcon admins to check others ip(with zcmd and sscanf)
PHP код:
CMD:whatismyip(playerid,params[])
{
new ip[16];
new string[128];
format(string,sizeof(string),"{FF00FF}Your ip is: {00FF00}%s",GetPlayerIp(playerid,ip,sizeof(ip)));
SendClientMessage(playerid,-1,string);
return 1;
}
PHP код:
CMD:getip(playerid,params[])
{
new playerip[16],msg[128],targetid;
if(!IsPlayerAdmin(playerid)) return 0; //remove this and every one can use the command and see others ips'
if(sscanf(params,"u", targetid)) return SendClientMessage(playerid,0xFFFFFFF,"[SYNTAX ERROR]: Usage /getip [id]"); //Check for invaild params
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, 0xFFFFFFF,"That player is not connected to the server!"); //check if the target id is connected
format(msg,sizeof(msg),"{FF00FF}ID:%i's ip is:{00FF00} %s",targetid,GetPlayerIp(targetid,playerip,sizeof(playerip)));
SendClientMessage(playerid,-1,msg);
return 1;
}