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



Arrays - •Ajax• - 28.11.2009

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


Re: Arrays - yezizhu - 28.11.2009

Code:
new
  index = random(sizeof(Weathers[]));
SetWeather(Weathers[index][1+random(1)]);
//send(...,Weathers[index][0]);



Re: Arrays - Dabombber - 28.11.2009

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

http://pastebin.com/f742d17c6


Re: Arrays - yezizhu - 28.11.2009

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.