SA-MP Forums Archive
vehicle random spawn :D - 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: vehicle random spawn :D (/showthread.php?tid=176480)



vehicle random spawn :D - [Lsrcr]Rafa - 13.09.2010

guys please help me i want to vehicle random spawns
Exsample: if one restart have sultan on one place how to make on other restart on my server to have other vehicle on the same position

Thanks for understanding

or you just can send me link of wiki... to make by my self i think this way is better to make by my self

Thanks !!!!


Re: vehicle random spawn :D - Mauzen - 13.09.2010

Hi

Try checking this https://sampwiki.blast.hk/wiki/Random
and this https://sampwiki.blast.hk/wiki/Vehicles:All

Should help you with your problem


Re: vehicle random spawn :D - Jeffry - 13.09.2010

Where you create the car that changes.
pawn Код:
CreateVehicle(RandomCar(), x,y,z,angle, -1,-1,respawnTime);
Anywhere at bottom of your code.
pawn Код:
stock RandomCar()
{
    switch(random(3))
    {
        case 0: return 400;
        case 1: return 401;
        case 2: return 509;
        //Just change the "return <num>" to any vehicle ID you want.
        //To add more cases, change the "random(3)" to a higher number, and add more "case:".
    }
    return 400;
}
I hope this helps you.
Greetz.