Help With Arrays - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help With Arrays (
/showthread.php?tid=99864)
Help With Arrays -
StrickenKid - 01.10.2009
I'm trying set the vars of an array with a function but its not working, i just get errors, anyone know you this is done?
Ex:
pawn Code:
new myArray[] = { 200, 300, 400 };
myFunction(p)
{
myArray[] = { p*100, p*200, p*300 };
return 1;
}
//so if i do:
myFunction(10)
myArray would equal {1000, 2000, 3000}
Thanks for any help
Re: Help With Arrays -
StrickenKid - 01.10.2009
Yes, i figured that out like 10 minutes after i posted this, but thanks for replying. I just ran a loop for the size of the array on the index of each variable inside the array.