SA-MP Forums Archive
Two warnings: nr of arguments does not match definition - 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: Two warnings: nr of arguments does not match definition (/showthread.php?tid=371660)



Two warnings: nr of arguments does not match definition - davelord - 24.08.2012

error:
Код:
C:\Users\Mijn pc\Desktop\A\gamemodes\new.pwn(8620) : warning 202: number of arguments does not match definition
C:\Users\Mijn pc\Desktop\A\gamemodes\new.pwn(8620) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
line:
Код:
format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has just respawned all unused cars.", GetPlayerName(playerid));
How can I solve this?


Re: Two warnings: nr of arguments does not match definition - ZBits - 24.08.2012

show the above code as well


Re: Two warnings: nr of arguments does not match definition - [KHK]Khalid - 24.08.2012

GetPlayerName takes 3 parameters not only 1, so this part is wrong:
pawn Код:
GetPlayerName(playerid)
Here's your code fixed (Explained in comments):
pawn Код:
new name[MAX_PLAYER_NAME]; // declaring a new string to store the player's name in
GetPlayerName(playerid, name, sizeof(name)); // gets the player name then stores it into the string we declared
format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has just respawned all unused cars.", name); // here you can use "name"



Re: Two warnings: nr of arguments does not match definition - davelord - 24.08.2012

Thanks both of you, solved. - repped you HellSphinX