SA-MP Forums Archive
Making Ammu-Nation Guns Command - 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: Making Ammu-Nation Guns Command (/showthread.php?tid=628643)



Making Ammu-Nation Guns Command - MiiSha - 12.02.2017

Edit : FIXED


Re: Making Ammu-Nation Guns Command - GoldenLion - 12.02.2017

Код:
if {dialogid == 81)
There's a curly bracket. Change it to
Код:
if (dialogid == 81)
Also use a switch statement instead of 9 if statements.
Код:
switch (listitem)
{
    case 0:
    {
         //code
    }
    case 1:
    {
         //code
    }
}
and the same thing for dialog ids. Have a look here: https://sampwiki.blast.hk/wiki/Control_Structures#switch


Re: Making Ammu-Nation Guns Command - MiiSha - 12.02.2017

OMG I must be blind !!!
Thanks, and I was using the switch but when I got the problem I used if statements just to make sure where the problem is. I4m gonna reuse the switch
Thanks. Rep+ !