Check for server elements and use IV stuff when needed
This commit is contained in:
@@ -571,16 +571,24 @@ function repairVehicle(vehicle) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setVehicleLights(vehicle, lights) {
|
function setVehicleLights(vehicleId, lights) {
|
||||||
setEntityData(vehicle, "agrp.lights", lights, true);
|
if (areServerElementsSupported()) {
|
||||||
sendNetworkEventToPlayer("agrp.veh.lights", null, vehicle.id, lights);
|
setEntityData(getElementFromId(vehicleId), "agrp.lights", lights, true);
|
||||||
|
sendNetworkEventToPlayer("agrp.veh.lights", null, vehicleId, lights);
|
||||||
|
} else {
|
||||||
|
sendNetworkEventToPlayer("agrp.veh.lights", null, getVehicleData(vehicleId).ivNetworkId, lights);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setVehicleEngine(vehicle, engine) {
|
function setVehicleEngine(vehicleId, engine) {
|
||||||
vehicle.engine = engine;
|
if (areServerElementsSupported()) {
|
||||||
setEntityData(vehicle, "agrp.engine", engine, true);
|
vehicle.engine = engine;
|
||||||
|
setEntityData(getElementFromId(vehicleId), "agrp.engine", engine, true);
|
||||||
|
} else {
|
||||||
|
sendNetworkEventToPlayer("agrp.veh.engine", null, getVehicleData(vehicleId).ivNetworkId, engine);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user