Stupid warning occuring! - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Stupid warning occuring! (
/showthread.php?tid=207693)
Stupid warning occuring! -
Spiral - 06.01.2011
Hey folks, a simple and a plain thread for now.
Here's the warning showing up:
Код:
(18143) : warning 202: number of arguments does not match definition
The line 18143 is:
pawn Код:
GetPlayerNameEx(playerid, sendername, sizeof(sendername));
The function GetPlayerNameEx is:
pawn Код:
stock GetPlayerNameEx(playerid)
{
new name[MAX_PLAYER_NAME];
new string[64];
GetPlayerName(playerid,name,sizeof(name));
name[strfind(name,"_")] = ' ';
return name;
}
Main function of the GetPlayerNameEx is to delete the _ character between roleplay names. Every line I use the GetPlayerNameEx function, it keeps occuring, So in total I got 46 warnings. Any help?
Re: Stupid warning occuring! -
Kwarde - 06.01.2011
Two arguments too much. It is just "GetPlayerNameEx(playerid);", not with sendername and the sizeof(sendername);
Re: Stupid warning occuring! -
PowerPC603 - 06.01.2011
Your function gets called with 3 arguments ("playerid", "sendername" and "sizeof(sendername)"):
Код:
GetPlayerNameEx(playerid, sendername, sizeof(sendername));
While your function only accepts one argument ("playerid"):
Код:
stock GetPlayerNameEx(playerid)
Re: Stupid warning occuring! -
Spiral - 06.01.2011
It starts not working when I change GetPlayerNameEx(playerid, sendername, sizeof(sendername)); to GetPlayerNameEx(playerid); It gives me an empty space.
Re: Stupid warning occuring! -
Kwarde - 06.01.2011
We need more information. Give us a bigger cut of the script. Are you using it for a part of an sentance? (Client Message), or for something else?
Re: Stupid warning occuring! -
Spiral - 07.01.2011
its the standard LARP which im just editing for my own fun.. It sends for ex the /ooc command within GetPlayerNameEx. GetPlayerName is replaced with GetPlayerNameEx. As simple as that.