When the vehicles are removed, do they get deleted from the server completely, or are they returned to the spot where they were created?
If they are simply being respawned and returned to the position that they were created, you may need to increase your CreateVehicle respawn_delay parameter, this parameter defines in seconds the time after which the vehicle has been un-occupied to be respawned. You can also set this parameter to -1 to disable respawn. |
Can you please post here the code that creates the vehicles. Does this happen to every vehicle and only after a player enters the vehicle? If so perhaps you should have a look at the following public:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) See if there is any code here that would destroy the vehicle. |
Have you searched your gamemode (using ctrl+F) for terms such as "DestroyVehicle"?
Is there any code under OnPlayerEnterVehicle? It is difficult to point you in the right direction without seeing any of your code. |
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_CARRY) { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); SetPlayerPos(playerid, x, y, z + 0.5); ClearAnimations(playerid); } if((!ispassenger) && (PlayerInfo[playerid][pCuffed] || PlayerInfo[playerid][pInjured])) { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); SetPlayerPos(playerid, x, y, z + 0.5); ClearAnimations(playerid); } if(!ispassenger) { if((pizzaVehicles[0] <= vehicleid <= pizzaVehicles[5]) && !PlayerHasJob(playerid, JOB_PIZZAMAN)) { SendClientMessage(playerid, COLOR_GREY, "You cannot operate this vehicle as you are not a Pizzaman."); ClearAnimations(playerid); } if((courierVehicles[0] <= vehicleid <= courierVehicles[6]) && !PlayerHasJob(playerid, JOB_COURIER)) { SendClientMessage(playerid, COLOR_GREY, "You cannot operate this vehicle as you are not a Courier."); ClearAnimations(playerid); } if((sweeperVehicles[0] <= vehicleid <= sweeperVehicles[3]) && !PlayerHasJob(playerid, JOB_SWEEPER)) { SendClientMessage(playerid, COLOR_GREY, "You cannot operate this vehicle as you are not a Street Sweeper."); ClearAnimations(playerid); } if((taxiVehicles[0] <= vehicleid <= taxiVehicles[3]) && !PlayerHasJob(playerid, JOB_TAXIDRIVER)) { SendClientMessage(playerid, COLOR_GREY, "You cannot operate this vehicle as you are not a Taxi Driver."); ClearAnimations(playerid); } if((testVehicles[0] <= vehicleid <= testVehicles[2]) && !PlayerInfo[playerid][pDrivingTest]) { SendClientMessage(playerid, COLOR_GREY, "You cannot operate this vehicle as you are not taking your drivers test."); ClearAnimations(playerid); } if(VehicleInfo[vehicleid][vFactionType] != FACTION_NONE && GetFactionType(playerid) != VehicleInfo[vehicleid][vFactionType]) { SendClientMessage(playerid, COLOR_GREY, "You cannot operate this vehicle as it doesn't belong to your faction."); ClearAnimations(playerid); } if(VehicleInfo[vehicleid][vGang] >= 0 && PlayerInfo[playerid][pGang] != VehicleInfo[vehicleid][vGang]) { SendClientMessage(playerid, COLOR_GREY, "You cannot operate this vehicle as it doesn't belong to your gang."); ClearAnimations(playerid); } if(VehicleInfo[vehicleid][vJob] >= 0 && PlayerInfo[playerid][pJob] != VehicleInfo[vehicleid][vJob]) { SendClientMessageEx(playerid, COLOR_GREY, "You cannot operate this vehicle as you are not a %s.", GetJobName(VehicleInfo[vehicleid][vJob])); ClearAnimations(playerid); } } return 1; }