SA-MP Forums Archive
Variable operator - 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: Variable operator (/showthread.php?tid=305115)



Variable operator - SMCentral - 21.12.2011

I was wondering if there is a way to create a linkage.

while( i = x)
if(pVar[i][Var. 'x' . ]) return code.

Basically we have an array of

pVar[value][Var1] all the way to pVar[value][Var100]

and I want to input x into the final 'pVar[value][Varx]'.

So if x = 3, then we would do the if statement with 'pVar[value][Var3]'.

I hope I made sense, is there any way we can achieve this with pawno?


Re: Variable operator - Ash. - 21.12.2011

As far as I know, this isn't possible.


Re: Variable operator - SMCentral - 21.12.2011

Until someone can confirm a method, I've decided to use cases.

switch(x)
case 1: if(var1 = y) return code
case 2: if(var2 = y) return code