SA-MP Forums Archive
Loop in dialog :L - 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: Loop in dialog :L (/showthread.php?tid=259527)



Loop in dialog :L - Ricop522 - 05.06.2011

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 .


Re: Loop in dialog :L - Ricop522 - 05.06.2011

bump ;\


Re: Loop in dialog :L - *IsBack - 05.06.2011

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?


Re: Loop in dialog :L - Ricop522 - 05.06.2011

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;
    }



Re: Loop in dialog :L - Johnson_boy - 05.06.2011

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.