Return Array Problem - 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: Return Array Problem (
/showthread.php?tid=212709)
Return Array Problem -
Darkyen - 17.01.2011
Код:
LoadName(playerid,slot){
new playerfile[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(playerfile, sizeof(playerfile), "Cars/%s%i.ini",pname,slot);
if(dini_Exists(playerfile))return dini_Get(playerfile, "Name");
new text[15];
format(text, sizeof(text), "%i: Empty Slot",slot);
return text;//Error is here
}
This method keeps giving me this error :
Код:
C:\Documents and Settings\Owner\Desktop\SAMP Server Drift\filterscripts\Premium.pwn(441) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
I cant find any similar problem on web so Im posting that here.
Please help !
Btw. I have tried to change capacity of text but it doesnt work. I have tried something like this :
Код:
new text[15] = "Empty Slot";
return text;
But same results. And return "Empty Slot"; (yes I was so desperate

) crashes compiler.

I would really appreciate some help.