warning 202: number of arguments does not match definition
#1

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);
Reply
#2

It stores the name by reference to a variable.

https://sampwiki.blast.hk/wiki/GetPlayerName
Reply
#3

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

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

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

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
Reply
#6

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

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?
Reply
#8

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

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!
Reply
#10

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!
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)