SA-MP Forums Archive
is the maximum amount of cases in a dialog 20? - 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: is the maximum amount of cases in a dialog 20? (/showthread.php?tid=423054)



is the maximum amount of cases in a dialog 20? - Apenmeeuw - 16.03.2013

hey all,

i been thinking about this for a while.

is the maximum amount of cases/listitems that a dialog can have 20?

because i can never get any cases above it, it never works...

i am using GarHouse now, and i have 39 house interiors, and it should load them all fine when doing /housemenu >>> buy/preview house interiors >>> buy/preview >>> all the 39 interiors.

but instead it shows listitem 0 - 19, item 20 is there but the text is half, its like {FFF, the rest is gone...

anyway is the max amount of cases 20? and if yes, then how to fix the issues above?

greets


Re: is the maximum amount of cases in a dialog 20? - park4bmx - 16.03.2013

Your string is not big enough!
Increas the string size of the items will increas the cases u can have


Re: is the maximum amount of cases in a dialog 20? - Apenmeeuw - 16.03.2013

i already did that, it didnt work...


Re: is the maximum amount of cases in a dialog 20? - Scenario - 16.03.2013

You must be doing something wrong; show your code, please.


Re: is the maximum amount of cases in a dialog 20? - Apenmeeuw - 16.03.2013

alright then.

pawn Код:
if(dialogid == HOUSEMENU+16 && response)
    {
        switch(listitem)
        {
            case 0: SetPVarInt(playerid, "HouseIntUpgradeMod", 1);
            case 1: SetPVarInt(playerid, "HouseIntUpgradeMod", 2);
        }
        CMDSString = "";
        Loop(i, MAX_HOUSE_INTERIORS, 0)
        {
            format(filename, sizeof(filename), HINT_FILEPATH, i);
            if(!fexist(filename)) continue;
            if(i == (MAX_HOUSE_INTERIORS-1))
            {
                switch(strlen(hIntInfo[i][IntName]))
                {
                    case 0..13: format(_tmpstring, sizeof(_tmpstring), "{00BC00}%d.\t{FFFF2A}%s\t\t\t{00BC00}$%d", (i + 1), hIntInfo[i][IntName], hIntInfo[i][IntValue]);
                    default: format(_tmpstring, sizeof(_tmpstring), "{00BC00}%d.\t{FFFF2A}%s\t\t{00BC00}$%d", (i + 1), hIntInfo[i][IntName], hIntInfo[i][IntValue]);
                }
            }
            else
            {
                switch(strlen(hIntInfo[i][IntName]))
                {
                    case 0..13: format(_tmpstring, sizeof(_tmpstring), "{00BC00}%d.\t{FFFF2A}%s\t\t\t{00BC00}$%d\n", (i + 1), hIntInfo[i][IntName], hIntInfo[i][IntValue]);
                    default: format(_tmpstring, sizeof(_tmpstring), "{00BC00}%d.\t{FFFF2A}%s\t\t{00BC00}$%d\n", (i + 1), hIntInfo[i][IntName], hIntInfo[i][IntValue]);
                }
            }
            strcat(CMDSString, _tmpstring);
        }
        ShowPlayerDialog(playerid, HOUSEMENU+15, DIALOG_STYLE_LIST, INFORMATION_HEADER, CMDSString, "Buy", "Cancel");
        return 1;
    }
thats the code...

i already made the _tmpstring to 1500... should be more than enough.


Re: is the maximum amount of cases in a dialog 20? - park4bmx - 16.03.2013

Yes becouse the final string is CMDSString and who knows what the size is


Re: is the maximum amount of cases in a dialog 20? - Apenmeeuw - 16.03.2013

thanks , you were right, the cmdsstring was wrong, never thought about that.