SA-MP Forums Archive
Will this work? Really small question - 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: Will this work? Really small question (/showthread.php?tid=581288)



Will this work? Really small question - MafiaOink - 11.07.2015

if(skinVal == 181,1,157,196,264,239,212,100,152,178,237,238,246, 256,257,64,63,87,15,134,213,198,259,241,32,100,142 ,60,239,132)

is my code, I want to check if the value entered is one of this skins, separated by commans e.g.
I want to check
if the skinVal is
181 or 1 or 157 etc
if it is do bla bla

I dont want to use || cause its too big, will pawno read this commas etc and that code successfully?


Re: Will this work? Really small question - Jonny5 - 12.07.2015

no it wont


you could use switch instead


pawn Код:
switch (skinVal )
{
    case 181,1,157,196,264,239,212,100,152,178,237,238,246, 256,257,64,63,87,15,134,213,198,259,241,32,100,142 ,60,239,132:
    {
        //your code
    }
    default:
    {
        //some othercode
    }
}