SA-MP Forums Archive
Random Vehicles - 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 Vehicles (/showthread.php?tid=174976)



Random Vehicles - Melvin - 07.09.2010

Hello,

I want to know how I could make Random vehicles (Vehicles who are different when they respawn).
Please could someone make a tutorail for me, thanks.

Greetz,,


Re: Random Vehicles - Vince - 07.09.2010

pawn Код:
public OnVehicleSpawn(vehicleid)
{
    new
        rand = 400+random(212),
        Float:vx,
        Float:vy,
        Float:vz,
        Float:va;

    GetVehiclePos(vehicleid, vx, vy, vz);
    GetVehicleZAngle(vehicleid, va);
    DestroyVehicle(vehicleid);
    CreateVehicle(rand, vx, vy, vz, va, -1, -1, 180);
    return 1;
}
Not tested, but should work.