SA-MP Forums Archive
Random shiz - 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)
+--- Thread: Random shiz (/showthread.php?tid=412353)



Random shiz - Kevin FOx - 01.02.2013

Hello..

I need a help in automatic random's!...


Such as this..

pawn Код:
forward RandomWeather();
public RandomWeather()
{
    Weather = random(20);//The variable that we created will hold the random weather.
    SetWeather(Weather);//This will set the weather to a random number which is held in the variable "Weather"
}
...


Now i need it to be..

between two things..

DoubleXP = 1;

and

Specialday = 1;


I need every two hours it automatic choose one of them... so any idea how to make them?


Re: Random shiz - mineralo - 01.02.2013

pawn Код:
SetTimer("RandomWeater",100000,1);// put your time
forward RandomWeather();
public RandomWeather()
{
    SetWeather(random(20));//This will set the weather to a random number which is held in the variable "Weather"
    return 1;
}



Re: Random shiz - Kevin FOx - 01.02.2013

i know bro, but i want to make it for this two things doublexp = 1; and spexialday = 1;
I already know about the weather.


Re: Random shiz - Kevin FOx - 02.02.2013

** BUMB **


Re: Random shiz - Sime30 - 02.02.2013

Try this
pawn Код:
SetTimer("RandomBonus",7200000,1);
forward RandomBonus();
public RandomBonus()
{
    new rr = random(2);
    if(rr == 1)
    {
    // put your stuff here                 
    }
    else
    {
                       
    }
    return 1;
}