Random weather and worldtime
#1

hi,
after every round the map changes and so the world time and weather does.
Ive created a random world and weather setter function.
It works but sometimes there seem to be some kind of strange weather/time combinations.(see the attached pics)
You cant see anything then, it does not happen often but its annoying.
Could someone maybe tell me the error in my code causing this bug?

pawn Код:
//random weather ID's
new const RandomWeather[43][1] =  
{
    {1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12},{13},{14},{15},{16},{17},{18},{19},{23},{24},{25},
    {26},{27},{28},{29},{30},{31},{32},{34},{35},{36},{37},{38},{39},{40},{41},{42},{46},{47},{48},{49},{50}
};

//random world time
new const RandomWorldTime[24][1] =
{
    {0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12},{13},{14},{15},{16},{17},{18},{19},{20},{21},{22},{23}

};

//This is the random setter function

//for weather
new rw = random(sizeof RandomWeather);
SetWeather(RandomWeather[rw][0]);

//for world time
new rwt = random(sizeof RandomWorldTime);
SetWorldTime(RandomWorldTime[rwt][0]);
Reply
#2

It's not weather bug or anything else, it's just weather like that.

If you go over ID 50 or ID 100 there will be just weathers from which you won't be able to see anything.

Example:

Reply
#3

Set the world time to 12, and it will be fine.
Reply
#4

sorry but u both misunderstood me!
Pls look at my code ive posted!

It sets a random weather and time every round so its not getting boring with time (only the same weather and time all day long).

And i dont use any weather ID's above 50 as u can see in my code ive posted!!
And why the hell should i set the time to 12?
U can see from my code that i want to set a random weather and time!

I Hope someone can help me.

regards...
Reply
#5

print out the weather id when it changes so you'll know which was is it

also
pawn Код:
new const RandomWeather[43] =  
{
    1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,23,24,25,
    26,27,28,29,30,31,32,34,35,36,37,38,39,40,41,42,46,47,48,49,50
};


new rw = random(sizeof RandomWeather);
SetWeather(RandomWeather[rw]);
Reply
#6

u mean with printf?

like this?
pawn Код:
printf("weahter id is: %d", RandomWeather[rw]);
Reply
#7

mhh it seems that world time 20-24 caused this bug.

thx for the tipp.

regards...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)