SA-MP Forums Archive
warning 202: number of arguments does not match definition - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: warning 202: number of arguments does not match definition (/showthread.php?tid=497752)



warning 202: number of arguments does not match definition - Praa - 28.02.2014

Help ?

Код:
CMD:stats(playerid, params[])
{
	new
	string[200], Float:Health;
	GetPlayerHealth(playerid, Health);

	format(string, sizeof(string),"_______________________________""[%s]""_______________________________", GetPlayerName(playerid));
	SCM(playerid, COLOR_GREEN, string);

	format(string, sizeof(string),"[GENERAL]: Name: %s | Money: $%d | Level: %d | Kills: %d | Respect: %d | Number: %d", GetName(playerid),GetPlayerCash(playerid), PlayerInfo[playerid][pLevel], PlayerInfo[playerid][pKills],PlayerInfo[playerid][pRespect],PlayerInfo[playerid][pNumber]);
	SCM(playerid, COLOR_WHITE, string);

	format(string, sizeof(string),"[GENERAL]: Admin Level: %d | Cigarettes: %d | Beers: %d | Business Key: %d | House Key: %d", PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pCigarettes], PlayerInfo[playerid][pBeer], PlayerInfo[playerid][BizID], PlayerInfo[playerid][HouseID]);
	SCM(playerid, COLOR_WHITE, string);

	format(string, sizeof(string),"[GENERAL]: Age: %d | Bank: $%d | Experience: %d", PlayerInfo[playerid][pAge], PlayerInfo[playerid][pBankAccount],  PlayerInfo[playerid][pExperience]);
	SCM(playerid, COLOR_WHITE, string);

	format(string, sizeof(string), "[DRUGS]: Marijuana: %d | Cocaine: %d | LSD: %d", PlayerInfo[playerid][dMarijuana], PlayerInfo[playerid][dCocaine], PlayerInfo[playerid][dLSD]);
	SCM(playerid, COLOR_WHITE, string);
	return 1;
}
Код:
D:\Basic RP Script Scratch FIX\gamemodes\U1.pwn(721) : warning 202: number of arguments does not match definition
D:\Basic RP Script Scratch FIX\gamemodes\U1.pwn(721) : warning 202: number of arguments does not match definition
this is line 721:
Код:
format(string, sizeof(string),"_______________________________""[%s]""_______________________________", GetPlayerName(playerid));
	SCM(playerid, COLOR_GREEN, string);



Re: warning 202: number of arguments does not match definition - Konstantinos - 28.02.2014

It stores the name by reference to a variable.

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


Re: warning 202: number of arguments does not match definition - Stephenso - 28.02.2014

It is a very useful website. It is all base on true facts.


Re: warning 202: number of arguments does not match definition - ParadiseRP - 28.02.2014

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
It stores the name by reference to a variable.

https://sampwiki.blast.hk/wiki/GetPlayerName
^ What he said


Re: warning 202: number of arguments does not match definition - Praa - 28.02.2014

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
It stores the name by reference to a variable.

https://sampwiki.blast.hk/wiki/GetPlayerName
Thanks man, you're a gm saver .

+rep


Re: warning 202: number of arguments does not match definition - Stanford - 28.02.2014

pawn Код:
format(string, sizeof(string),"_______________________________[%s]_______________________________", GetPlayerName(playerid));
    SCM(playerid, COLOR_GREEN, string);
You're ready to go


Re: warning 202: number of arguments does not match definition - Praa - 28.02.2014

Now I have another problem, I put this :
Код:
format(string, sizeof(string),"[GENERAL]: Name: %s | Money: $%d | Level: %d | Kills:  | Respect:  | Number: ", GetPlayerName(playerid, name, sizeof(name)), GetPlayerCash(playerid), PlayerInfo[playerid][pLevel]);
for the /stats command .
Everything well but when I hit /stats on "Name:" appear this :


Anyone?


Re: warning 202: number of arguments does not match definition - Konstantinos - 28.02.2014

Read the wiki again. You should use "name" as argument in format and GetPlayerName line before format function.


Re: warning 202: number of arguments does not match definition - Stanford - 28.02.2014

Add this to your gamemode:
pawn Код:
stock GetPlayerNameEx(playerid)
{
     new pName[25];
     GetPlayerName(playerid, pName, sizeof(pName));
     return pName;
}
and replace:

GetPlayerName(playerid, name, sizeof(name)) with GetPlayerNameEx(playerid) and you're good to go!


Re: warning 202: number of arguments does not match definition - Praa - 28.02.2014

Quote:
Originally Posted by Stanford
Посмотреть сообщение
Add this to your gamemode:
pawn Код:
stock GetPlayerNameEx(playerid)
{
     new pName[25];
     GetPlayerName(playerid, pName, sizeof(pName));
     return pName;
}
and replace:

GetPlayerName(playerid, name, sizeof(name)) with GetPlayerNameEx(playerid) and you're good to go!
Thanks man, now work, thank you 2!