Don't apply extra ped properties

This commit is contained in:
Vortrex
2021-08-11 09:37:41 -05:00
parent be25aa2054
commit c7fdaa96d9

View File

@@ -184,11 +184,11 @@ function setLocalPlayerFrozenState(state) {
function setLocalPlayerControlState(controlState, cursorState = false) { function setLocalPlayerControlState(controlState, cursorState = false) {
logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting control state to ${controlState} (Cursor: ${cursorState})`); logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting control state to ${controlState} (Cursor: ${cursorState})`);
controlsEnabled = controlState; controlsEnabled = controlState;
localPlayer.invincible = true; //localPlayer.invincible = true;
if(getGame() != GAME_GTA_IV) { //if(getGame() != GAME_GTA_IV) {
localPlayer.collisionsEnabled = controlState; // localPlayer.collisionsEnabled = controlState;
localPlayer.invincible = false; // localPlayer.invincible = false;
} //}
} }
// =========================================================================== // ===========================================================================
@@ -454,8 +454,10 @@ function setLocalPlayerCash(amount) {
// =========================================================================== // ===========================================================================
function removeWorldObject(model, position, range) { function removeWorldObject(model, position, range) {
logToConsole(LOG_DEBUG, `[VRR.Utilities] Removing world object ${model} at X: ${position.x}, Y: ${position.x}, Z: ${position.x} with range of ${range}`); if(isRemovingWorldObjectsSupported()) {
gta.removeWorldObject(model, position, range); logToConsole(LOG_DEBUG, `[VRR.Utilities] Removing world object ${model} at X: ${position.x}, Y: ${position.x}, Z: ${position.x} with range of ${range}`);
gta.removeWorldObject(model, position, range);
}
} }
// =========================================================================== // ===========================================================================
@@ -468,11 +470,13 @@ function excludeModelFromGroundSnow(model) {
// =========================================================================== // ===========================================================================
function destroyAutoCreatedPickups() { function destroyAutoCreatedPickups() {
getElementsByType(ELEMENT_PICKUP).forEach(function(pickup) { if(arePickupsSupported()) {
if(pickup.isOwner) { getElementsByType(ELEMENT_PICKUP).forEach(function(pickup) {
destroyElement(pickup); if(pickup.isOwner) {
} destroyElement(pickup);
}); }
});
}
} }
// =========================================================================== // ===========================================================================
@@ -493,7 +497,7 @@ function processLocalPlayerControlState() {
// =========================================================================== // ===========================================================================
function clearLocalPlayerWantedLevel() { function processWantedLevelReset() {
if(localPlayer == null) { if(localPlayer == null) {
return false; return false;
} }
@@ -638,12 +642,6 @@ function getAllowedSkinIndexBySkinId(skinId) {
// =========================================================================== // ===========================================================================
function processWantedLevelReset() {
localPlayer.wantedLevel = 0;
}
// ===========================================================================
function setMinuteDuration(minuteDuration) { function setMinuteDuration(minuteDuration) {
logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting minute duration to ${minuteDuration}ms`); logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting minute duration to ${minuteDuration}ms`);
gta.time.minuteDuration = minuteDuration; gta.time.minuteDuration = minuteDuration;