How to make a vehicle remover?
#1

I added a vehicle menu to my server but the problem is that you can spawn 100 vehicles and it won't remove any of them. I want to put something so that if someone spawns a vehicle using the menu and he has a previous one it will be removed and if possible i want also vehicles spawned from the menu to be removed if they're just left unused.
Reply
#2

Give a variable to your CreateVehicle and put a DestroyVehicle before it, this would give

pawn Код:
new Veh[MAX_PLAYERS] = -1; // At the top of your code

// In your menu response
DestroyVehicle(Veh[playerid]); // Will destroy the vehicle, if no vehicle have been created will destroy the vehicle id -1 (Not existing)
Veh[playerid] = CreateVehicle(blah blah);
Reply
#3

pawn Код:
forward VehRes(vehicleid);
public VehRes(vehicleid)
{
    DestroyVehicle(vehicleid);
}
This maybe..?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)