SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 01/10/2009, 01:57 AM   #1
StrickenKid
Gangsta
 
Join Date: Feb 2009
Posts: 762
Reputation: 44
Default Help With Arrays

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
__________________
StrickenKid is offline  
Old 01/10/2009, 09:01 PM   #2
StrickenKid
Gangsta
 
Join Date: Feb 2009
Posts: 762
Reputation: 44
Default Re: Help With Arrays

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.
__________________
StrickenKid is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with arrays Gozerr Help Archive 3 28/02/2010 01:07 PM
Arrays •Ajax• Help Archive 3 28/11/2009 06:40 AM
Using two or more arrays. luxeon Help Archive 13 22/04/2009 04:04 PM


All times are GMT. The time now is 01:03 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.