Merge branch 'nightly' into ragemp
This commit is contained in:
@@ -193,9 +193,9 @@ function getVehicleHeading(vehicle) {
|
||||
// ===========================================================================
|
||||
|
||||
function setVehicleHeading(vehicle, heading) {
|
||||
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||
return sendNetworkEventToPlayer("agrp.vehPosition", null, getVehicleForNetworkEvent(vehicle), heading);
|
||||
}
|
||||
//if (getGame() == AGRP_GAME_GTA_IV) {
|
||||
// return sendNetworkEventToPlayer("agrp.vehPosition", null, getVehicleForNetworkEvent(vehicle), heading);
|
||||
//}
|
||||
return vehicle.heading = heading;
|
||||
}
|
||||
|
||||
@@ -227,12 +227,12 @@ function getVehicleSyncer(vehicle) {
|
||||
// ===========================================================================
|
||||
|
||||
function getVehicleForNetworkEvent(vehicle) {
|
||||
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||
if (getVehicleData(vehicle).ivNetworkId != -1) {
|
||||
return getVehicleData(vehicle).ivNetworkId;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
//if (getGame() == AGRP_GAME_GTA_IV) {
|
||||
// if (getVehicleData(vehicle).ivNetworkId != -1) {
|
||||
// return getVehicleData(vehicle).ivNetworkId;
|
||||
// }
|
||||
// return -1;
|
||||
//}
|
||||
return vehicle.id;
|
||||
}
|
||||
|
||||
@@ -588,14 +588,17 @@ function setVehicleLights(vehicle, lights) {
|
||||
// ===========================================================================
|
||||
|
||||
function setVehicleEngine(vehicle, engine) {
|
||||
vehicle.engine = engine;
|
||||
//vehicle.engine = engine;
|
||||
setEntityData(vehicle, "agrp.engine", engine, true);
|
||||
sendNetworkEventToPlayer("agrp.veh.engine", null, vehicle.id, engine);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function setVehicleLocked(vehicle, locked) {
|
||||
vehicle.locked = locked;
|
||||
setEntityData(vehicle, "agrp.locked", locked, true);
|
||||
sendNetworkEventToPlayer("agrp.veh.locked", null, vehicle.id, locked);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -1112,9 +1115,9 @@ function getClosestCivilian(position) {
|
||||
// ===========================================================================
|
||||
|
||||
function getVehiclesInRange(position, range) {
|
||||
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||
return getServerData().vehicles.reduce((i, j) => (getDistance(position, i.syncPosition) <= getDistance(position, j.syncPosition)) ? i : j);
|
||||
}
|
||||
//if (getGame() == AGRP_GAME_GTA_IV) {
|
||||
// return getServerData().vehicles.reduce((i, j) => (getDistance(position, i.syncPosition) <= getDistance(position, j.syncPosition)) ? i : j);
|
||||
//}
|
||||
return getElementsByTypeInRange(ELEMENT_VEHICLE, position, range);
|
||||
}
|
||||
|
||||
@@ -1241,11 +1244,11 @@ function getPlayerPed(client) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||
return getPlayerData(client).ped;
|
||||
} else {
|
||||
return client.player;
|
||||
}
|
||||
//if (getGame() == AGRP_GAME_GTA_IV) {
|
||||
// return getPlayerData(client).ped;
|
||||
//} else {
|
||||
return client.player;
|
||||
//}
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
Reference in New Issue
Block a user