SA-MP Forums Archive
stock error to save file ! - 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: stock error to save file ! (/showthread.php?tid=509735)



stock error to save file ! - lonalovegood1 - 27.04.2014

this is my code ... using y_ini , but the result errors ...
Код:
stock SetPlayerTitle(playerid,title)
{
	new ttl[128];
	format(ttl,sizeof(ttl),"%s",title);
        pInfo[playerid][Title]=ttl; // line 320
	return 1;
}
and ERRORS
Код:
C:\Users\ICE\filterscripts\cmds.pwn(320) : error 047: array sizes do not match, or destination array is too small



AW: stock error to save file ! - Macronix - 27.04.2014

Try this:
pawn Код:
stock SetPlayerTitle(playerid,title[128])
{
        format(pInfo[playerid][Title], 128, title);
    return 1;
}



Re: stock error to save file ! - lonalovegood1 - 27.04.2014

not working !


Re: stock error to save file ! - BroZeus - 28.04.2014

in enum where Title is written it whould be like this
pawn Код:
enum ENUMNAME
{
//your enums here
Title[128],
//rest of enums
}



Re: stock error to save file ! - Luis- - 28.04.2014

Quote:
Originally Posted by [HLF]Southclaw
Посмотреть сообщение
This method is faster than format:

pawn Код:
pInfo[playerid][Title][0] = EOS; // set the first cell to "end-of-string" so the strcat function adds the string at the start.
strcat(pInfo[playerid][Title], title); // concatenate the input string to the array cell.
It has nothing to do with the post but thanks Southclaw! Needed a faster formatting code!