Loop in dialog :L
#1

Anyone can helpme ?
I am trying to show all the cars with AVenda in a DIALOG_STYLE_LIST


But doesn't work :L
pawn Код:
if(strcmp(cmd, "/felipe", true) == 0)
    {
        if(pLogado[playerid] > 0)
        {
            for(new i = 1; i < sizeof(CarInfo); ++i)
            {
                if(CarInfo[i][cAVenda] == 1) {
                    format(SkillBase, sizeof(SkillBase), "Veнculo a venda: Placa: LS-%i | Qtd de donos antigos: %i | Preзo; %i\n", i, CarInfo[i][cDonos], GetVehiclePrice(i));
                    ShowPlayerDialog(playerid,DIALOG_NADA,DIALOG_STYLE_MSGBOX,"FOREVER ALONE",string,"OK","");
                }
                return 0x1;
            }
        }
        return 0x01;
    }
Thanks a lot .
Reply
#2

bump ;\
Reply
#3

Just a few questions:
1. What is this: return 0x1; haven't seen anything like that in my life.
2. What exactly does not work? Does it shows the dialog? Or it gives you an error?
Reply
#4

return 0x01 = return 1;
This doesn't show in dialog the cars with AVenda.
pawn Код:
if(strcmp(cmd, "/felipe2", true) == 0) {
        if(pLogado[playerid] > 0) {
            for(new i = 1; i < sizeof(CarInfo); ++i) {
                if(CarInfo[i][cAVenda] == 1) {
                    new model[24];
                    GetVehicleName(i,model,sizeof(model));
                    format(basegostosa, sizeof(basegostosa), "LS-%i | Donos antigos: %i | Multa: %i | Preзo: %i | Modelo: %s\n", i, CarInfo[i][cDonos], CarInfo[i][cMulta], GetVehiclePrice(i)-800, model);
                    SCM(playerid, -1, basegostosa);
                    ShowPlayerDialog(playerid,DIALOG_NADA,DIALOG_STYLE_LIST,"FOREVER ALONE",basegostosa,"SAIR","");
                }
            }
        }
        return 0x1;
    }
Reply
#5

I think you should have a big string, then run the loop, if loop finds one, add it to string (strins), then show dialog after loop has finished with the string you created. Its one way to do it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)