is the maximum amount of cases in a dialog 20?
#1

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
Reply
#2

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

i already did that, it didnt work...
Reply
#4

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

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.
Reply
#6

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)