Return Array Problem
#1

Код:
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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)