SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 28/11/2009, 01:10 AM   #1
•Ajax•
Little Clucker
 
Join Date: Jun 2009
Posts: 12
Reputation: 0
Default Arrays

Here's the deal.
I'm making an array, like. new Weathers[][] = { {"Sunny", 0, 23} };
"Sunny", obviously the weather type. 0, the weather ID. 23 the Degrees.

Every 10 minutes (Timer) change the weather to something random. But the problem is, the weather could be "Foggy", but the weatherid could be like hot. I need it to be a random line, not completely different thing.
http://pastebin.com/d5756d326]
http://pastebin.com/d5756d326
•Ajax• is offline  
Old 28/11/2009, 01:30 AM   #2
yezizhu
Gangsta
 
yezizhu's Avatar
 
Join Date: Nov 2007
Location: Shenzhen,China
Posts: 640
Reputation: 2
Default Re: Arrays

Code:
new
  index = random(sizeof(Weathers[]));
SetWeather(Weathers[index][1+random(1)]);
//send(...,Weathers[index][0]);
yezizhu is offline  
Old 28/11/2009, 06:03 AM   #3
Dabombber
Big Clucker
 
Join Date: May 2006
Posts: 79
Reputation: 1
Default Re: Arrays

I don't think you understand what the two numbers are...

http://pastebin.com/f742d17c6
Dabombber is offline  
Old 28/11/2009, 06:40 AM   #4
yezizhu
Gangsta
 
yezizhu's Avatar
 
Join Date: Nov 2007
Location: Shenzhen,China
Posts: 640
Reputation: 2
Default Re: Arrays

Quote:
Originally Posted by Dabombber
I don't think you understand what the two numbers are...

http://pastebin.com/f742d17c6
My failed, remove random(1) will be right in my edtion.
yezizhu 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
Help With Arrays StrickenKid Help Archive 1 01/10/2009 09:01 PM
Using two or more arrays. luxeon Help Archive 13 22/04/2009 04:04 PM


All times are GMT. The time now is 12:40 AM.


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