24.04.2010, 14:23
Use CreateVehicle instead of AddStaticVehicle, because you can destroy them with DestroyVehicle afterwards.
You wanna do it like this?
You can delete it over OnVehicleSpawn (i guess... maybe over OnVehicleDeath, too?! Never tried.)
Don't forget to put the respawndelay in your sscanf code and putting into pInfo. Enjoy.
You wanna do it like this?
pawn Код:
//OnPlayerConnect
if(pInfo[playerid][pCarid]!=-1)DestroyVehicle(pInfo[playerid][pCarid]);
pInfo[playerid][Carid]=-1;
//In the command:
if(pInfo[playerid][pCarid]!=-1)DestroyVehicle(pInfo[playerid][pCarid]);
CreateVehicle(vehicleid, PosX+1, PosY+1, PosZ, Angle, color[0], color[1], respawndelay);
Don't forget to put the respawndelay in your sscanf code and putting into pInfo. Enjoy.