IP comand?
#10

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	new cmd[128],index;
	cmd = strtok(cmdtext, index);
	if(strcmp(cmd, "/getip", true) == 0)
	{
		if(IsPlayerAdmin(playerid))
		{
			new text[128];
			text = strtok(cmdtext, index);
			if(!strlen(text)) return SendClientMessage(playerid, 0xFFFFFFFF,"Usage: /getip [playerid]");
			new player = strval(text);
			if(IsPlayerConnected(player))
			{
				new string[128];
				new name[MAX_PLAYER_NAME];
				new IP[20];
				GetPlayerName(player, name, sizeof(name));
				GetPlayerIp(player, IP, sizeof(IP));
				format(string, sizeof(string), "%s's IP: %s", name, IP);
				SendClientMessage(playerid, 0xFFFFFFFF, string);
			}else SendClientMessage(playerid, 0xFFFFFFFF,"Player is not connected");
		}else SendClientMessage(playerid, 0xFFFFFFFF,"Only for admins !");
		return 1;
	}
	return 0;
}
Reply


Messages In This Thread
IP comand? - by jonybomb - 26.07.2009, 18:08
Re: IP comand? - by refshal - 26.07.2009, 18:39
Re: IP comand? - by James_Alex - 26.07.2009, 18:52
Re: IP comand? - by jonybomb - 26.07.2009, 19:06
Re: IP comand? - by MadeMan - 26.07.2009, 19:15
Re: IP comand? - by jonybomb - 26.07.2009, 19:23
Re: IP comand? - by refshal - 26.07.2009, 19:50
Re: IP comand? - by jonybomb - 26.07.2009, 19:52
Re: IP comand? - by jonybomb - 26.07.2009, 20:17
Re: IP comand? - by Jefff - 26.07.2009, 20:32

Forum Jump:


Users browsing this thread: 4 Guest(s)