SA-MP Forums Archive
enum size +rep - 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: enum size +rep (/showthread.php?tid=571735)



enum size +rep - iBots - 21.04.2015

well i have made a system and this system enum has more than 10 things,each one thing is like this:
pawn Код:
enum something
{
    something1[1000],
    something2[1000],
    something3[1000],
    something4[1000],
    something5[1000],
    something6[1000],
    something7[1000],
    something8[1000],
    something9[1000],
    something10[1000],
};
new info[max_somethings][something]; //max_something is 250
when i compile i get alot of size,how is it possible to optimize this enum and make it better?


Respuesta: enum size +rep - JuanStone - 21.04.2015

It is very large the size of the amx because you lot of memory in your variables, to optimize that you need to search the parts of code that used these variables, count the maximum number of characters(+1charcater null) and put it in place of " 1000 ".


Re: enum size +rep - iBots - 21.04.2015

i said i am using these 1000 things,max is 1000 and you can get any thing from 0 to 1000


Respuesta: enum size +rep - JuanStone - 21.04.2015

I doubt that you save 10 thousand characters in each player, so that is the only solution friend, you must make good use of the variable strings, there is no other way to optimize, optimize in string variables is to declare the maximum number of characters to optimize and avoid wasting memory, if you occupy all of that memory there is no waste and don't need optimize anything .

10,000 x 250 x 4 = 10000000


Re: enum size +rep - iBots - 22.04.2015

anyone?


Re: enum size +rep - MP2 - 22.04.2015

What are you using these variables for?


Re: enum size +rep - Azula - 22.04.2015

i dont know if this work
PHP код:
#define ze 0
something[ze char]
function(){ 
#if defined ze
#undef ze
#define ze 1000
#endif




Respuesta: enum size +rep - admantis - 22.04.2015

Packed strings


Re: enum size +rep - iBots - 22.04.2015

i am using them for creating cars and objects and,...


Re: enum size +rep - Pottus - 22.04.2015

Seems to me you have excessive sized arrays re-evaluate what you actually need.