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



Variable - Hayden_Almeida - 13.01.2017

Hello guys, i was wandering if this is possible:

Код:
new Player1, Player2, Player3;
new var = 3;

new result = Player(var);

So will result: Player3;
Its that possible? How to do this?


Re: Variable - Vince - 13.01.2017

Use an array.

Also, human readable variable names are discarded when the script is compiled because computers don't need them.


Re: Variable - Hayden_Almeida - 13.01.2017

not clear...
Someone else?


Re: Variable - saffierr - 13.01.2017

Use an array, "[]" is that clear?


Re: Variable - SickAttack - 13.01.2017

pawn Код:
new array[] = {3, 6, 8};
// array[0] is Player1 = value 3
// array[1] is Player2 = value 6
// array[2] is Player3 = value 8