Error 047 - 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: Error 047 (
/showthread.php?tid=238860)
Error 047 -
sekol - 12.03.2011
pawn Код:
stock GetNameEx(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
name = strreplace("_", " ", name); // ERROR LINE!
return name;
}
I get this error.
Код:
error 047: array sizes do not match, or destination array is too small
What i missed?
Re: Error 047 -
iMonk3y - 12.03.2011
pawn Код:
stock GetNameEx(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
strreplace("_", " ", name);
return name;
}
Re: Error 047 -
Kwarde - 12.03.2011
It's maybe something with the strreplace, you might used it wrong.
And try this:
pawn Код:
stock GetNameEx(playerid)
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
for(new i = 0, l = strlen(pName); i < l; i++)
if(pName[i] == '_')
pName[i] = ' ';
return pName;
}
EDIT: Too late...
Re: Error 047 -
sekol - 12.03.2011
Thanks for helping
Re: Error 047 -
HyperZ - 12.03.2011
< Removed >