Random Vehicle from the server?
#7

i guess this would do better the job.

pawn Код:
native IsValidVehicle(vehicleid);


CMD:randcar(playerid, params[])
{
   new carid;
   while(!IsValidVehicle((carid = random(MAX_VEHICLES)))){}
   new
        Float:vPos[3];
   GetVehiclePos(carid, vPos[0], vPos[1], vPos[2]);
   SetPlayerCheckpoint(playerid, vPos[0], vPos[1], vPos[2], 5.0);
   return 1;
}
By the way, vehicleid is the ID of the vehicle. you can use the to get the vehicleid that the player is in.

https://sampwiki.blast.hk/wiki/GetPlayerVehicleID
Reply


Messages In This Thread
Random Vehicle from the server? - by [HK]Ryder[AN] - 22.09.2012, 05:31
Re: Random Vehicle from the server? - by ReneG - 22.09.2012, 05:49
Re: Random Vehicle from the server? - by [HK]Ryder[AN] - 22.09.2012, 06:13
Re: Random Vehicle from the server? - by trapstar2020 - 22.09.2012, 06:44
Re: Random Vehicle from the server? - by [HK]Ryder[AN] - 22.09.2012, 07:44
Re: Random Vehicle from the server? - by [HK]Ryder[AN] - 23.09.2012, 03:06
Re: Random Vehicle from the server? - by YourLord - 23.09.2012, 04:11
Re: Random Vehicle from the server? - by JhnzRep - 23.09.2012, 06:11

Forum Jump:


Users browsing this thread: 1 Guest(s)