Tag Mistmatch
#1

Hello, I have a little problem with my command, I want a command that when player types /getip id he hets a players ip. Here is my command:
CMD:getip(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] >= 3)
{
new plrIP[16];
new pName[24];
new str[128];
GetPlayerIp(playerid, plrIP, sizeof(plrIP));
GetPlayerName(playerid, pName, 24);
format(str, 128, "%s IP yra %s.", pName, plrIP);
SendClientMessage(-1, str);
if(!strcmp(plrIP, "127.0.0.1"))
return 1;
}
return 1;
}

And here is one error:
D:\Documents and Settings\Administrator\Desktop\Sa-Mp Server\Drift Serveris\pawno\Login.pwn(570) : error 035: argument type mismatch (argument 2)

What is the problem?
Reply
#2

Код:
CMD:getip(playerid, params[])
{
	if (PlayerInfo[playerid][pAdmin] >= 3)
	{
		new target;
		if(sscanf(params, "u", target)) return SendClientMessage(playerid, -1, "USAGE: /getip [playerid]");
		if(! IsPlayerConnected(target)) return SendClientMessage(playerid, -1, "The player is not conected.");
		new string[144];
		format(string, sizeof(string), "%s(%i)'s IP is %s", pName(target), target, GetPlayerIP(target));
		SendClientMessage(playerid, -1, string);
	}
	return 1;
}
Код:
GetPlayerIP(playerid)
{
	new player_ip[18];
	GetPlayerIp(playerid, player_ip, sizeof(player_ip));
	return player_ip;
}
Код:
pName(playerid)
{
	new playername[MAX_PLAYER_NAME];
	GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
	return playername;
}
Reply
#3

Thank you
Reply
#4

pawn Код:
if(!strcmp(plrIP, "127.0.0.1")) SendClientMessage(playerid,-1,"Your Message");//something must add like SendClientMessage
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)