SA-MP Forums Archive
Error: array sizes - 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: Error: array sizes (/showthread.php?tid=593388)



Error: array sizes - xClown - 04.11.2015

PHP код:
error 047: array sizes do not match, or destination array is too small 
Line:
PHP код:
ResetArray(PT_Text[text]); 
Define:
PHP код:
#define ResetArray(%0); new ArrayReset[MAX_TEXT_DRAWS]; %0 = ArrayReset; 



Re: Error: array sizes - Crayder - 04.11.2015

PT_Text's size is not MAX_TEXT_DRAWS

Also, that's a horrible macro.


Re: Error: array sizes - xClown - 04.11.2015

Quote:
Originally Posted by Crayder
Посмотреть сообщение
PT_Text's size is not MAX_TEXT_DRAWS

Also, that's a horrible macro.
PHP код:
new PT_Text[Text:MAX_TEXT_DRAWS][800 char]; 
I know that's horrible. Can you show me better macro?


Re: Error: array sizes - Crayder - 04.11.2015

Код:
new PT_Text[Text:MAX_TEXT_DRAWS][800 char];
new PT_DefaultText[Text:MAX_TEXT_DRAWS][800 char];

//And to clear it:
#define ResetTextDrawText(%0) %0 = PT_DefaultText
Even with that though, it is only proper to use PT_Text in there. It's still not a good macro. It's just an example of how to correctly do it your way.


Re: Error: array sizes - xClown - 04.11.2015

Yeah, it's only for PT_Text.

This "system" is for moving TextDraw from current position to another position. Specifically, changing TextDrawTextSize because I don't see another way.
Thanks Crayder.