More native utils + move startup stuff into startup.js
This commit is contained in:
@@ -163,13 +163,13 @@ function onLocalPlayerEnteredVehicle(event, vehicle, seat) {
|
||||
|
||||
sendNetworkEventToServer("vrr.onPlayerEnterVehicle", getVehicleForNetworkEvent(vehicle), seat);
|
||||
|
||||
if(inVehicleSeat == 0) {
|
||||
inVehicle.engine = false;
|
||||
if(!inVehicle.engine) {
|
||||
parkedVehiclePosition = inVehicle.position;
|
||||
parkedVehicleHeading = inVehicle.heading;
|
||||
}
|
||||
}
|
||||
//if(inVehicleSeat == 0) {
|
||||
//setVehicleEngine(vehicle, false);
|
||||
//if(!inVehicle.engine) {
|
||||
// parkedVehiclePosition = inVehicle.position;
|
||||
// parkedVehicleHeading = inVehicle.heading;
|
||||
//}
|
||||
//}
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -182,7 +182,7 @@ function onPedInflictDamage(event, damagedEntity, damagerEntity, weaponId, healt
|
||||
if(damagedEntity.isType(ELEMENT_PLAYER)) {
|
||||
if(damagedEntity == localPlayer) {
|
||||
//if(!weaponDamageEnabled[damagerEntity.name]) {
|
||||
event.preventDefault();
|
||||
preventDefaultEventAction(event);
|
||||
sendNetworkEventToServer("vrr.weaponDamage", damagerEntity.name, weaponId, pedPiece, healthLoss);
|
||||
//}
|
||||
}
|
||||
|
||||
@@ -188,4 +188,28 @@ function doesEntityDataExist(entity, dataName) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function preventDefaultEventAction(event) {
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function getPlayerId(client) {
|
||||
return client.index;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function consolePrint(text) {
|
||||
console.log(text);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function getPlayerName(client) {
|
||||
return client.name;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -185,7 +185,7 @@ function setLocalPlayerControlState(controlState, cursorState = false) {
|
||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting control state to ${controlState} (Cursor: ${cursorState})`);
|
||||
controlsEnabled = controlState;
|
||||
if(getGame() == VRR_GAME_GTA_III || getGame() == VRR_GAME_GTA_VC) {
|
||||
game.SET_PLAYER_CONTROL(localClient.index, boolToInt(controlState));
|
||||
game.SET_PLAYER_CONTROL(getPlayerId(localClient), boolToInt(controlState));
|
||||
}
|
||||
|
||||
if(getGame() != VRR_GAME_GTA_IV) {
|
||||
|
||||
Reference in New Issue
Block a user