The compiler shows me strange results....
#1

after I modified this string:
Код:
new string1[1600];
COMPILE RESULT:

Код:
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase

Header size:          12264 bytes
Code size:          1536852 bytes
Data size:          7594916 bytes
Stack/heap size:      16384 bytes; estimated max. usage=4941 cells (19764 bytes)
Total requirements: 9160416 bytes
What does this mean? Thanks
Reply
#2

Means nothing, it compiles fine.
It gives details on how much array sizes youґre using, as unnecessarily high sizes screw everything up.
So unless that 1600 is necessary, remove it.
Reply
#3

Quote:
Originally Posted by judothijs
Посмотреть сообщение
Means nothing, it compiles fine.
It gives details on how much array sizes youґre using, as unnecessarily high sizes screw everything up.
So unless that 1600 is necessary, remove it.
Yes is necessary, could overload the server? Thanks!
Reply
#4

You should be aware that this message can result in a stack heap collision resulting in a lose of memory

Also this array is not the only one!, you use 4941 cells in that one function
Also I dont belive that you need over 4000 cells within one function...
Reply
#5

The problem is this, if I do not put "1600" in "new string1 [1600];"
In the dialog commands admin, showing me only the first 3 lines ... so I thought
I had to increase the array!

Код:
		if (PlayerInfo[playerid][pAdmin] >= 10)
		{
		new string1[596];
		strcat(string1, "\n {FFEF0E}[LIVELLO 1:]{FFFFFF} /trova - /goto - /gethere - /spec - /specoff - /muta - /smuta - /blocca - /sblocca - /warn - /ajail - /kick - /ban - /fakeban");
		strcat(string1,         "\n              /autokill - /slap - /gotobiz - /gotocasa - /gotozonagang - /gotobuilding - /bloccorapinab - /bloccorapinac - /autoclan - /fixveh - /fly");
        strcat(string1,         "\n              /settaskin - /settamondovirtuale  - /settainterior - /ao - /cc - /maschere - /vehlist(2-3) - /ricaricarapine - /auto - /baseadmin - /cnnn");
        strcat(string1, "\n {FFEF0E}[LIVELLO 2:]{FFFFFF} /gotaauto - /gotoauto - /ascoltachat - /settalicenza - /trovaarmi - /rimuoviarmi - /prison - /unprison - /count");
        strcat(string1, "\n {FFEF0E}[LIVELLO 3:]{FFFFFF} /listafazioni - /respawn - /sbannaip");
        strcat(string1, "\n {FFEF0E}[LIVELLO 4:]{FFFFFF} /setta(ora, vita, armatura, prodotti, materiali, droga) - /esplodi");
        strcat(string1, "\n {FFEF0E}[LIVELLO 5:]{FFFFFF} /entraauto - /settamoneta - /settasoldi - /settaarma - /riempiautobenzina - /kickff - /kickaclan - /resettacell");
        strcat(string1, "\n {FFEF0E}[LIVELLO 6:]{FFFFFF} ");
        strcat(string1, "\n {FFEF0E}[LIVELLO 7:]{FFFFFF} /sbanna - /donatore - /settameteo - /apritutteauto - /costohq - /vendihq - /comandibizadmin - /comandicasaadmin");
        strcat(string1, "\n {FFEF0E}[LIVELLO 8:]{FFFFFF} ");
        strcat(string1, "\n {FFEF0E}[LIVELLO 9:]{FFFFFF} ");
        strcat(string1, "\n {FFEF0E}[LIVELLO 10:]{FFFFFF} /payday - /resetlotto - /evento - /regalasoldi - /kicktutti - /settameteo - /settacapofazione - /settahelper - /settaadmin");
        strcat(string1,         "\n               /settastats - /gotofazione - /cambianome - /cambianumero - /accendiveicolo - /creahq - /gotohq - /creazonagang - /vendizonagang");
        strcat(string1,         "\n               /comandibuildingadmin - /comandilavoriadmin - /comandifazioneadmin - /comandibizadmin - /comandiautoadmin - /comandicasaadmin");
        strcat(string1,         "\n               /concessionario - /postoconcessionario - /postobanca");
		ShowPlayerDialog(playerid, DIALOG_ADMIN_10, DIALOG_STYLE_MSGBOX, "COMANDI ADMIN", string1, "Chiudi", "");
		}
Reply
#6

Their are other ways to write something like that, try that
pawn Код:
if(PlayerInfo[playerid][pAdmin] >= 10) {
    static
        init = false,
        str1[] = " {FFEF0E}[LIVELLO 1:]{FFFFFF} /trova - /goto - /gethere - /spec - /specoff - /muta - /smuta - /blocca - /sblocca - /warn - /ajail - /kick - /ban - /fakeban",
        str2[] = "              /autokill - /slap - /gotobiz - /gotocasa - /gotozonagang - /gotobuilding - /bloccorapinab - /bloccorapinac - /autoclan - /fixveh - /fly",
        str3[] = "              /settaskin - /settamondovirtuale  - /settainterior - /ao - /cc - /maschere - /vehlist(2-3) - /ricaricarapine - /auto - /baseadmin - /cnnn",
        str4[] = " {FFEF0E}[LIVELLO 2:]{FFFFFF} /gotaauto - /gotoauto - /ascoltachat - /settalicenza - /trovaarmi - /rimuoviarmi - /prison - /unprison - /count",
        str5[] = " {FFEF0E}[LIVELLO 3:]{FFFFFF} /listafazioni - /respawn - /sbannaip",
        str6[] = " {FFEF0E}[LIVELLO 4:]{FFFFFF} /setta(ora, vita, armatura, prodotti, materiali, droga) - /esplodi",
        str7[] = " {FFEF0E}[LIVELLO 5:]{FFFFFF} /entraauto - /settamoneta - /settasoldi - /settaarma - /riempiautobenzina - /kickff - /kickaclan - /resettacell",
        str8[] = " {FFEF0E}[LIVELLO 6:]{FFFFFF} ",
        str9[] = " {FFEF0E}[LIVELLO 7:]{FFFFFF} /sbanna - /donatore - /settameteo - /apritutteauto - /costohq - /vendihq - /comandibizadmin - /comandicasaadmin",
        str10[] = " {FFEF0E}[LIVELLO 8:]{FFFFFF} ",
        str11[] = " {FFEF0E}[LIVELLO 9:]{FFFFFF} ",
        str12[] = " {FFEF0E}[LIVELLO 10:]{FFFFFF} /payday - /resetlotto - /evento - /regalasoldi - /kicktutti - /settameteo - /settacapofazione - /settahelper - /settaadmin",
        str13[] = "               /settastats - /gotofazione - /cambianome - /cambianumero - /accendiveicolo - /creahq - /gotohq - /creazonagang - /vendizonagang",
        str14[] = "               /comandibuildingadmin - /comandilavoriadmin - /comandifazioneadmin - /comandibizadmin - /comandiautoadmin - /comandicasaadmin",
        str15[] = "               /concessionario - /postoconcessionario - /postobanca"
    ;
    if(!init) { // gets only called once!
        init = true;

        str1[sizeof str1 - 1] = '\n';
        str2[sizeof str2 - 1] = '\n';
        str3[sizeof str3 - 1] = '\n';
        str4[sizeof str4 - 1] = '\n';
        str5[sizeof str5 - 1] = '\n';
        str6[sizeof str6 - 1] = '\n';
        str7[sizeof str7 - 1] = '\n';
        str8[sizeof str8 - 1] = '\n';
        str9[sizeof str9 - 1] = '\n';
        str10[sizeof str10 - 1] = '\n';
        str11[sizeof str11 - 1] = '\n';
        str12[sizeof str12 - 1] = '\n';
        str13[sizeof str13 - 1] = '\n';
        str14[sizeof str14 - 1] = '\n';
        str15[sizeof str15 - 1] = EOS; // last str gets an EOS
    }
    ShowPlayerDialog(playerid, DIALOG_ADMIN_10, DIALOG_STYLE_MSGBOX, "COMANDI ADMIN", str1, "Chiudi", "");
}
Also this is way faster than using 10x strcat
Reply
#7

It works ... thank you very much!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)