04.11.2017, 12:48
How to make it when a player writes /adminveh if he has already created a vehicle to clear it?
new LastVehicleID[MAX_PLAYERS];
public OnPlayerConnect(playerid) { LastVehicleID[playerid] = INVALID_VEHICLE_ID; return 1; } public OnPlayerDisconnect(playerid, reason) { if(LastVehicleID[playerid] != INVALID_VEHICLE_ID) DestroyVehicle(LastVehicleID[playerid]); LastVehicleID[playerid] = INVALID_VEHICLE_ID; return 1; }
if(LastVehicleID[playerid] != INVALID_VEHICLE_ID) DestroyVehicle(LastVehicleID[playerid]);
LastVehicleID[playerid] = CreateVehicle(...);