Destroy cars once they have exploded?
#1

HI there. I am using a filterscript for a car spawn menu but once they have exploded or drowned they go back to the place the car menu spawned them from. How do I make it that cars ONLY spawned from this filterscript car menu not respawn?

Thanks
Reply
#2

To state it obviously, use DestroyVehicle under OnVehicleDeath...
Reply
#3

I'm sorry for being noobish but could you help me one last time with adding that to this command as I am sure just adding that statement of DestroyVehicle would not work:
pawn Код:
public OnVehicleDeath(vehicleid, killerid)
{
     for(new i = 0; i < MAX_PLAYERS; i++)
     {
          if(GetPlayerVehicleID(i) == vehicleid) RemovePlayerFromVehicle(i);
     }
     return 1;
}
Reply
#4

If you only want the cars that the FS spawns to be destroyed when they touch water, then it is a bit more complicated. You would have to keep track of which vehicle IDs are spawned by that FS, and then in OnVehicleDeath, check if the vehicle "dying" is one of those, and if so, DestroyVehicle.
Reply
#5

Nevermind. GOT IT ALL WORKING. YOU CAN DELETE THIS THREAD!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)