Merge branch 'nightly'
This commit is contained in:
@@ -188,8 +188,10 @@ function setLocalPlayerControlState(controlState, cursorState = false) {
|
||||
game.SET_PLAYER_CONTROL(localClient.index, boolToInt(controlState));
|
||||
}
|
||||
|
||||
localPlayer.collisionsEnabled = controlState;
|
||||
localPlayer.invincible = true;
|
||||
if(getGame() != VRR_GAME_GTA_IV) {
|
||||
localPlayer.collisionsEnabled = controlState;
|
||||
localPlayer.invincible = true;
|
||||
}
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -283,26 +285,21 @@ function enterVehicleAsPassenger() {
|
||||
|
||||
function giveLocalPlayerWeapon(weaponId, ammo, active) {
|
||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] Giving weapon ${weaponId} with ${ammo} ammo`);
|
||||
localPlayer.giveWeapon(weaponId, ammo, active);
|
||||
forceWeaponAmmo = localPlayer.getWeaponAmmunition(getWeaponSlot(weaponId));
|
||||
forceWeaponClipAmmo = localPlayer.getWeaponClipAmmunition(getWeaponSlot(weaponId));
|
||||
forceWeapon = weaponId;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function giveLocalPlayerWeapon(weaponId, ammo, active) {
|
||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] Giving weapon ${weaponId} with ${ammo} ammo`);
|
||||
if(getGame() == VRR_GAME_MAFIA_ONE) {
|
||||
localPlayer.giveWeapon(weaponId, 0, ammo);
|
||||
forceWeaponAmmo = 0;
|
||||
forceWeaponClipAmmo = ammo;
|
||||
} else {
|
||||
localPlayer.giveWeapon(weaponId, ammo, active);
|
||||
forceWeaponAmmo = localPlayer.getWeaponAmmunition(getWeaponSlot(weaponId));
|
||||
forceWeaponClipAmmo = localPlayer.getWeaponClipAmmunition(getWeaponSlot(weaponId));
|
||||
if(getGame() < VRR_GAME_GTA_IV) {
|
||||
forceWeaponAmmo = localPlayer.getWeaponAmmunition(getWeaponSlot(weaponId));
|
||||
forceWeaponClipAmmo = localPlayer.getWeaponClipAmmunition(getWeaponSlot(weaponId));
|
||||
} else {
|
||||
forceWeaponAmmo = ammo;
|
||||
forceWeaponClipAmmo = ammo;
|
||||
}
|
||||
}
|
||||
forceWeapon = weaponId;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -351,6 +348,9 @@ function setLocalPlayerInterior(interior) {
|
||||
if(!isGTAIV()) {
|
||||
localPlayer.interior = interior;
|
||||
game.cameraInterior = interior;
|
||||
} else {
|
||||
let interiorId = natives.getInteriorAtCoords(localPlayer.position);
|
||||
natives.activateInterior(interiorId, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -618,11 +618,15 @@ function forceLocalPlayerEquippedWeaponItem() {
|
||||
if(forceWeapon != 0) {
|
||||
if(localPlayer.weapon != forceWeapon) {
|
||||
localPlayer.weapon = forceWeapon;
|
||||
localPlayer.setWeaponClipAmmunition(getWeaponSlot(forceWeapon), forceWeaponClipAmmo);
|
||||
localPlayer.setWeaponAmmunition(getWeaponSlot(forceWeapon), forceWeaponAmmo);
|
||||
if(getGame() <= VRR_GAME_GTA_IV) {
|
||||
localPlayer.setWeaponClipAmmunition(getWeaponSlot(forceWeapon), forceWeaponClipAmmo);
|
||||
localPlayer.setWeaponAmmunition(getWeaponSlot(forceWeapon), forceWeaponAmmo);
|
||||
}
|
||||
} else {
|
||||
forceWeaponClipAmmo = localPlayer.getWeaponClipAmmunition(getWeaponSlot(forceWeapon));
|
||||
forceWeaponAmmo = localPlayer.getWeaponAmmunition(getWeaponSlot(forceWeapon));
|
||||
if(getGame() <= VRR_GAME_GTA_IV) {
|
||||
forceWeaponClipAmmo = localPlayer.getWeaponClipAmmunition(getWeaponSlot(forceWeapon));
|
||||
forceWeaponAmmo = localPlayer.getWeaponAmmunition(getWeaponSlot(forceWeapon));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(localPlayer.weapon > 0) {
|
||||
@@ -835,13 +839,13 @@ function setUpInitialGame() {
|
||||
natives.setPlayersDropMoneyInNetworkGame(false);
|
||||
natives.setSyncWeatherAndGameTime(false);
|
||||
natives.usePlayerColourInsteadOfTeamColour(true);
|
||||
natives.setDisplayPlayerNameAndIcon(false);
|
||||
natives.setDisplayPlayerNameAndIcon(natives.getPlayerId(), false);
|
||||
natives.removeTemporaryRadarBlipsForPickups();
|
||||
natives.setPickupsFixCars(false);
|
||||
natives.displayCash(true);
|
||||
natives.displayAmmo(true);
|
||||
natives.displayHud(true);
|
||||
natives.displayAreaName(true);
|
||||
natives.displayCash(false);
|
||||
natives.displayAmmo(false);
|
||||
natives.displayHud(false);
|
||||
natives.displayAreaName(false);
|
||||
natives.setPoliceRadarBlips(false);
|
||||
|
||||
natives.requestAnims("DANCING");
|
||||
|
||||
Reference in New Issue
Block a user