Re-add clear temp stuff (for ambience)
This commit is contained in:
@@ -1513,4 +1513,34 @@ function getVehicleTrunkPosition(vehicle) {
|
||||
return getPosBehindPos(getVehiclePosition(vehicle), getVehicleHeading(vehicle), getGlobalConfig().vehicleTrunkRearDistance);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
// ===========================================================================
|
||||
|
||||
function clearTemporaryVehicles() {
|
||||
let vehicles = getElementsByType(ELEMENT_VEHICLE);
|
||||
for(let i in vehicles) {
|
||||
if(vehicles[i].owner == -1) {
|
||||
if(!getVehicleData(vehicles[i])) {
|
||||
if(isVehicleUnoccupied(vehicles[i])) {
|
||||
destroyElement(vehicles[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function clearTemporaryPeds() {
|
||||
let peds = getElementsByType(ELEMENT_PED);
|
||||
for(let i in peds) {
|
||||
if(peds[i].owner == -1) {
|
||||
if(!peds[i].isType(ELEMENT_PLAYER)) {
|
||||
if(peds[i].vehicle == null) {
|
||||
if(!getNPCData(peds[i])) {
|
||||
destroyElement(peds[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user