Limit spawned cars
#2

use DestroyVehicle before CreateVehicle

My method is making a var for the playervehicle

pawn Код:
//global
new pVeh[MAX_PLAYERS] = -1;
The reason why I'm giving the var the '-1' value, is that 0 would make a vehicle ID, so it can't be used.

Then do:
pawn Код:
if(pVeh[playerid] != -1) //You might wanna throw in a check if player is inside the vehicle too, but it's not that important
    DestroyVehicle(pVeh[playerid]);
//rest of command here
Good luck!
Reply


Messages In This Thread
Limit spawned cars - by RedFusion - 18.11.2009, 20:40
Re: Limit spawned cars - by LarzI - 18.11.2009, 20:43
Re: Limit spawned cars - by RedFusion - 18.11.2009, 21:05
Re: Limit spawned cars - by LarzI - 18.11.2009, 21:13
Re: Limit spawned cars - by RedFusion - 19.11.2009, 09:11

Forum Jump:


Users browsing this thread: 1 Guest(s)