06.11.2014, 21:16
Create a variable for each player
Set it everytime they spawn a car as the car they create!
for example
that will set the id of vehicle to the varible.
then create an if statement above that saying if they already have a vehicle destroy it..
Код:
new LastCreatedVeh[MAX_PLAYERS];
for example
Код:
LastCreatedVeh[playerid] = CreateVehicle(...)
then create an if statement above that saying if they already have a vehicle destroy it..
Код:
if(LastCreatedVeh[playerid] != 0) { DestroyVehicle(LastCreatedVeh[playerid]); LastCreatedVeh[playerid]=0; } if(LastCreatedVeh[playerid] == 0) { LastCreatedVeh[playerid] = CreateVehicle(...) } }