SA-MP Forums Archive
List item 1 doesn't works - 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: List item 1 doesn't works (/showthread.php?tid=413878)



List item 1 doesn't works - Louris - 07.02.2013

Код:
if(dialogid == 321)
{
if(response)
{
if(listitem == 0)
{
SendClientMessage(playerid, 0xAA3333AA, "Uћdraudėte teleportuotis į /tpsumo");
for(new i; i < MAX_PLAYERS; i++)
{
Sumoprasidejes[i] = true;
}

if(listitem == 1)
{
SendClientMessage(playerid, 0xAA3333AA, "Leidћiate teleportuotis į /tpsumo");
for(new i; i < MAX_PLAYERS; i++)
{
Sumoprasidejes[i] = false;
}
}
}
}
}
listitem == 1 doesn't works, why ?


Re: List item 1 doesn't works - jessejanssen - 07.02.2013

You should seriously indent your code, that's the one and only reason you couldn't figure this out yourself. This will work:

pawn Код:
if(dialogid == 321)
{
    if(response)
        {
        if(listitem == 0)
            {
            SendClientMessage(playerid, 0xAA3333AA, "Uћdraudete teleportuotis i /tpsumo");
            for(new i = 0; i < MAX_PLAYERS; i++)
                {
                Sumoprasidejes[i] = true;
                }
            }
        if(listitem == 1)
            {
            SendClientMessage(playerid, 0xAA3333AA, "Leidћiate teleportuotis i /tpsumo");
            for(new i = 0; i < MAX_PLAYERS; i++)
                {
                Sumoprasidejes[i] = false;
                }
            }
        }
}
Best regards,
Jesse

EDIT:
The reason for "listitem == 1" not working is because you placed that within the curly brackets of "listitem == 0".