SA-MP Forums Archive
Header size: 13764 bytes, - 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: Header size: 13764 bytes, (/showthread.php?tid=182210)



Header size: 13764 bytes, - Zh3r0 - 09.10.2010

I know what this is, and i know how to solve it, but i don't want to solve it with pragma dynamic, i want a clean way to finish it.

I think it's because i use these macros:
pawn Code:
#define FormMessage(%0,%1,%2,%3)\
        do\
        {\
            format(str, sizeof (str), (%2), %3);\
            SendClientMessage((%0),(%1), str);\
        }\
        while ( FALSE )
       
#define FormMessageForAll(%0,%1,%2)\
        do\
        {\
            format( str, sizeof ( str ), ( %1 ), %2);\
            SendClientMessageToAll( ( %0 ), str);\
        }\
        while ( FALSE )
       
#define FormMessageForAllEx(%0,%1,%2,%3)\
        do\
        {\
            foreach(Player,i)\
            {\
                if(i != %0)\
                {\
                    if(P_DATA[ i ][ P_Level ] > 1)\
                    {\
                        format( str, sizeof ( str ), ( %2 ), %3);\
                        SendClientMessage(i, ( %1 ), str);\
                    }\
                }\
            }\
        }\
        while ( FALSE )
#define FormMessageForAdmins(%1,%2,%3)\
        do\
        {\
            foreach(Player,i)\
            {\
                if(P_DATA[ i ][ P_Level ] > 1)\
                {\
                    format(str, sizeof (str), (%2), %3);\
                    SendClientMessage(i,(%1), str);\
                }\
            }\
        }\
        while ( FALSE )
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

Header size: 13764 bytes
Code size: 532860 bytes
Data size: 1158676 bytes
Stack/heap size: 16384 bytes; estimated max. usage=4393 cells (17572 bytes)
Total requirements: 1721684 bytes

I guess there are too many cells opened, how do i lower it?. .


Re: Header size: 13764 bytes, - RyDeR` - 09.10.2010

Try to remove then see if it's solved.


Re: Header size: 13764 bytes, - Voldemort - 09.10.2010

You use too much and too big arrays I mean new PlayerItem[MAX_PLAYERS]; or string[256];

try to reduce string and variable sizes, redefine MAX_PLAYERS to your amount and set new string[size]; size to count you need.


Re: Header size: 13764 bytes, - Zh3r0 - 09.10.2010

well i told you alreadsy i got just 1 string already it's made global variable.

new str[130];

Also, i re-defined MAX_PLAYERS to 10, didn't work, same thing ...

EDIT: Seems ZCMD is the problem, i removed like 300 ZCMD commands and it worked, header size decreased by 50%

Header size: 9832 bytes
Code size: 467744 bytes
Data size: 904988 bytes
Stack/heap size: 16384 bytes; estimated max. usage=4393 cells (17572 bytes)
Total requirements: 1398948 bytes


Re: Header size: 13764 bytes, - Zeex - 09.10.2010

It has nothing to do with the header size, it says that there's no enough space on the stack - either find where's the problem and eliminate it, or increase the stack/heap size (#pragma dynamic 4400-4500 should be enough).


Re: Header size: 13764 bytes, - Zh3r0 - 11.10.2010

Pragma solves the thing, but i don't get it, where the problem can be ...