SA-MP Forums Archive
202 warning - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: 202 warning (/showthread.php?tid=282471)



202 warning - Trill - 11.09.2011

cant figure out why im copping a 202 warning
"number of arguments does not match definition"
this is the line thats getting it:
Код:
format(string, sizeof(string), "* %s has started the warmup.", GetPlayerName(playerid));
heres the whole command
Код:
CMD:warmup(playerid, params[])
{
	new string[128];
	format(string, sizeof(string), "* %s has started the warmup.", GetPlayerName(playerid));
        SendFCMessage(playerid, COLOR_FCALERT, string);
	return 1;
}



Re: 202 warning - [HiC]TheKiller - 11.09.2011

https://sampwiki.blast.hk/wiki/GetPlayerName

You could do this

pawn Код:
stock PlayerName(playerid)
{
    new Pname[24];
    GetPlayerName(playerid, Pname, 24);
    return Pname;
}
Then get the player name like you were.

pawn Код:
format(string, sizeof(string), "* %s has started the warmup.", PlayerName(playerid));



Re: 202 warning - eDz0r - 11.09.2011

pawn Код:
CMD:warmup(playerid, params[])
{
new string[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName);

format(string, sizeof(string), "* %s has started the warmup.", pName);
SendFCMessage(playerid, COLOR_FCALERT, string);
eturn 1;
}