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



random selection - farris - 26.11.2010

can someone tell me the basics of how to on a script when a person does a command once the next time it does another action thats different.


Re: random selection - Mauzen - 26.11.2010

you can use random(max) for this:

pawn Код:
switch(random(number_of_different_actions)
{
    case 0:
    {
        //Action 1
    }
    case 1:
    {
        //Action 2
    }
    //...
}