This commit is contained in:
Vortrex
2021-06-05 17:31:17 -05:00
parent 75c264eace
commit 7b44801a20
61 changed files with 1075 additions and 1078 deletions

View File

@@ -8,8 +8,8 @@
// ===========================================================================
function initAFKScript() {
logToConsole(LOG_DEBUG, "[Asshat.AFK]: Initializing AFK script ...");
logToConsole(LOG_DEBUG, "[Asshat.AFK]: AFK script initialized!");
logToConsole(LOG_DEBUG, "[VRR.AFK]: Initializing AFK script ...");
logToConsole(LOG_DEBUG, "[VRR.AFK]: AFK script initialized!");
}
// ===========================================================================

View File

@@ -19,9 +19,9 @@ let maxChatBoxLines = 6;
// ===========================================================================
function initChatBoxScript() {
logToConsole(LOG_DEBUG, "[Asshat.ChatBox]: Initializing chatbox script ...");
logToConsole(LOG_DEBUG, "[VRR.ChatBox]: Initializing chatbox script ...");
bindChatBoxKeys();
logToConsole(LOG_DEBUG, "[Asshat.ChatBox]: Chatbox script initialized!");
logToConsole(LOG_DEBUG, "[VRR.ChatBox]: Chatbox script initialized!");
}
// ===========================================================================

View File

@@ -8,10 +8,10 @@
// ===========================================================================
function initEventScript() {
logToConsole(LOG_DEBUG, "[Asshat.Event]: Initializing event script ...");
logToConsole(LOG_DEBUG, "[VRR.Event]: Initializing event script ...");
addCustomEvents();
addAllEventHandlers();
logToConsole(LOG_DEBUG, "[Asshat.Event]: Event script initialized!");
logToConsole(LOG_DEBUG, "[VRR.Event]: Event script initialized!");
}
// ===========================================================================
@@ -135,7 +135,7 @@ function onDrawnHUD(event) {
// ===========================================================================
function onPedWasted(event, wastedPed, killerPed, weapon, pedPiece) {
logToConsole(LOG_DEBUG, `[Asshat.Event] Ped ${wastedPed.name} died`);
logToConsole(LOG_DEBUG, `[VRR.Event] Ped ${wastedPed.name} died`);
wastedPed.clearWeapons();
}
@@ -148,7 +148,7 @@ function onElementStreamIn(event, element) {
// ===========================================================================
function onLocalPlayerExitedVehicle(event, vehicle, seat) {
logToConsole(LOG_DEBUG, `[Asshat.Event] Local player exited vehicle`);
logToConsole(LOG_DEBUG, `[VRR.Event] Local player exited vehicle`);
triggerNetworkEvent("ag.onPlayerExitVehicle", getVehicleForNetworkEvent(vehicle), seat);
if(inVehicleSeat) {
parkedVehiclePosition = false;
@@ -159,7 +159,7 @@ function onLocalPlayerExitedVehicle(event, vehicle, seat) {
// ===========================================================================
function onLocalPlayerEnteredVehicle(event, vehicle, seat) {
logToConsole(LOG_DEBUG, `[Asshat.Event] Local player entered vehicle`);
logToConsole(LOG_DEBUG, `[VRR.Event] Local player entered vehicle`);
triggerNetworkEvent("ag.onPlayerEnterVehicle", getVehicleForNetworkEvent(vehicle), seat);
if(inVehicleSeat == 0) {
@@ -179,7 +179,7 @@ function onPedInflictDamage(event, damagedEntity, damagerEntity, weaponId, healt
let damagerEntityString = (!isNull(damagedEntity)) ? `${damagerEntity.name} (${damagerEntity.name}, ${damagerEntity.type} - ${typeof damagerEntity})` : `Unknown ped`;
let damagedEntityString = (!isNull(damagedEntity)) ? `${damagedEntity.name} (${damagedEntity.name}, ${damagedEntity.type} - ${typeof damagedEntity})` : `Unknown ped`;
logToConsole(LOG_DEBUG, `[Asshat.Event] ${damagerEntityString} damaged ${damagedEntityString}'s '${pedPiece} with weapon ${weaponId}`);
logToConsole(LOG_DEBUG, `[VRR.Event] ${damagerEntityString} damaged ${damagedEntityString}'s '${pedPiece} with weapon ${weaponId}`);
if(!isNull(damagedEntity) && !isNull(damagerEntity)) {
if(damagedEntity.isType(ELEMENT_PLAYER)) {
if(damagedEntity == localPlayer) {
@@ -195,7 +195,7 @@ function onPedInflictDamage(event, damagedEntity, damagerEntity, weaponId, healt
// ===========================================================================
function onLocalPlayerEnterSphere(event, sphere) {
logToConsole(LOG_DEBUG, `[Asshat.Event] Local player entered sphere`);
logToConsole(LOG_DEBUG, `[VRR.Event] Local player entered sphere`);
if(sphere == jobRouteStopSphere) {
enteredJobRouteSphere();
}
@@ -204,7 +204,7 @@ function onLocalPlayerEnterSphere(event, sphere) {
// ===========================================================================
function onLocalPlayerExitSphere(event, sphere) {
logToConsole(LOG_DEBUG, `[Asshat.Event] Local player exited sphere`);
logToConsole(LOG_DEBUG, `[VRR.Event] Local player exited sphere`);
}
// ===========================================================================

View File

@@ -144,16 +144,16 @@ let creatingCharacter = false;
// ===========================================================================
function initGUIScript() {
logToConsole(LOG_DEBUG, "[Asshat.GUI]: Initializing GUI script ...");
logToConsole(LOG_DEBUG, "[Asshat.GUI]: GUI script initialized!");
logToConsole(LOG_DEBUG, "[VRR.GUI]: Initializing GUI script ...");
logToConsole(LOG_DEBUG, "[VRR.GUI]: GUI script initialized!");
}
// ===========================================================================
function initGUI() {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Initializing GUI ...`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Initializing GUI ...`);
logToConsole(LOG_DEBUG, `[Asshat.GUI] Creating login GUI ...`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating login GUI ...`);
login.window = mexui.window(game.width/2-150, game.height/2-129, 300, 258, 'LOGIN', {
main: {
backgroundColour: toColour(0, 0, 0, windowAlpha),
@@ -228,11 +228,11 @@ function initGUI() {
},
}, checkLogin);
logToConsole(LOG_DEBUG, `[Asshat.GUI] Created login GUI`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Created login GUI`);
// ===========================================================================
logToConsole(LOG_DEBUG, `[Asshat.GUI] Creating two factor auth GUI ...`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating two factor auth GUI ...`);
twoFactorAuth.window = mexui.window(game.width/2-150, game.height/2-129, 300, 258, 'LOGIN', {
main: {
backgroundColour: toColour(0, 0, 0, windowAlpha),
@@ -306,11 +306,11 @@ function initGUI() {
},
}, checkTwoFactorAuth);
logToConsole(LOG_DEBUG, `[Asshat.GUI] Created two factor auth GUI`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Created two factor auth GUI`);
// ===========================================================================
logToConsole(LOG_DEBUG, `[Asshat.GUI] Creating new character GUI ...`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating new character GUI ...`);
newCharacter.window = mexui.window(game.width/2-130, game.height/2-100, 300, 200, 'Character Name', {
main: {
backgroundColour: toColour(0, 0, 0, windowAlpha),
@@ -398,11 +398,11 @@ function initGUI() {
borderColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha),
},
}, checkNewCharacter);
logToConsole(LOG_DEBUG, `[Asshat.GUI] Created new character GUI`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Created new character GUI`);
// ===========================================================================
logToConsole(LOG_DEBUG, `[Asshat.GUI] Creating register GUI ...`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating register GUI ...`);
register.window = mexui.window(game.width/2-130, game.height/2-125, 300, 250, 'Register', {
main: {
backgroundColour: toColour(0, 0, 0, windowAlpha),
@@ -511,11 +511,11 @@ function initGUI() {
borderColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha),
},
}, checkRegistration);
logToConsole(LOG_DEBUG, `[Asshat.GUI] Created register GUI`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Created register GUI`);
// ===========================================================================
logToConsole(LOG_DEBUG, `[Asshat.GUI] Creating error GUI ...`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating error GUI ...`);
errorDialog.window = mexui.window(game.width/2-200, game.height/2-70, 500, 140, 'ERROR', {
main: {
backgroundColour: toColour(0, 0, 0, windowAlpha),
@@ -557,11 +557,11 @@ function initGUI() {
borderColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], 255),
},
}, closeErrorDialog);
logToConsole(LOG_DEBUG, `[Asshat.GUI] Created error GUI ...`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Created error GUI ...`);
// ===========================================================================
logToConsole(LOG_DEBUG, `[Asshat.GUI] Created prompt GUI ...`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Created prompt GUI ...`);
yesNoDialog.window = mexui.window(game.width/2-200, game.height/2-70, 400, 140, 'Question', {
main: {
backgroundColour: toColour(0, 0, 0, windowAlpha),
@@ -616,11 +616,11 @@ function initGUI() {
borderColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], 255),
},
}, yesNoDialogAnswerNo);
logToConsole(LOG_DEBUG, `[Asshat.GUI] Created prompt GUI`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Created prompt GUI`);
// ===========================================================================
logToConsole(LOG_DEBUG, `[Asshat.GUI] Creating info dialog GUI ...`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating info dialog GUI ...`);
infoDialog.window = mexui.window(game.width/2-200, game.height/2-70, 400, 140, 'Information', {
main: {
backgroundColour: toColour(0, 0, 0, windowAlpha),
@@ -661,11 +661,11 @@ function initGUI() {
borderColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], 255),
},
}, closeInfoDialog);
logToConsole(LOG_DEBUG, `[Asshat.GUI] Created info dialog GUI`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Created info dialog GUI`);
// ===========================================================================
logToConsole(LOG_DEBUG, `[Asshat.GUI] Creating list dialog GUI ...`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating list dialog GUI ...`);
listDialog.window = mexui.window(game.width/2-200, game.height/2-70, 400, 500, 'List', {
main: {
backgroundColour: toColour(0, 0, 0, windowAlpha),
@@ -719,11 +719,11 @@ function initGUI() {
}
}
});
logToConsole(LOG_DEBUG, `[Asshat.GUI] Created list dialog GUI`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Created list dialog GUI`);
// ===========================================================================
logToConsole(LOG_DEBUG, `[Asshat.GUI] Creating character select GUI ...`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating character select GUI ...`);
characterSelect.window = mexui.window(game.width/2-215, game.height/2-83, 430, 190, 'Select Character', {
main: {
backgroundColour: toColour(0, 0, 0, windowAlpha),
@@ -845,25 +845,25 @@ function initGUI() {
borderColour: toColour(0, 0, 0, 0),
}
});
logToConsole(LOG_DEBUG, `[Asshat.GUI] Created character select GUI`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Created character select GUI`);
// ===========================================================================
logToConsole(LOG_DEBUG, `[Asshat.GUI] All GUI created successfully!`);
logToConsole(LOG_DEBUG, `[VRR.GUI] All GUI created successfully!`);
closeAllWindows();
};
// ===========================================================================
let checkLogin = function() {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Checking login with server ...`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Checking login with server ...`);
triggerNetworkEvent("ag.checkLogin", login.passwordInput.lines[0]);
}
// ===========================================================================
let loginFailed = function(errorMessage) {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Server reports login failed`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Server reports login failed`);
login.messageLabel.text = errorMessage;
login.messageLabel.styles.main.textColour = toColour(180, 32, 32, 255);
login.passwordInput.text = "";
@@ -872,21 +872,21 @@ let loginFailed = function(errorMessage) {
// ===========================================================================
let loginSuccess = function() {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Server reports login was successful`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Server reports login was successful`);
closeAllWindows();
}
// ===========================================================================
let checkRegistration = function() {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Checking registration with server ...`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Checking registration with server ...`);
triggerNetworkEvent("ag.checkRegistration", register.passwordInput.lines[0], register.confirmPasswordInput.lines[0], register.emailInput.lines[0]);
}
// ===========================================================================
let checkNewCharacter = function() {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Checking new character with server ...`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Checking new character with server ...`);
let skinId = false;
if(newCharacter.firstNameInput.lines[0].length < 2) {
@@ -906,7 +906,7 @@ let checkNewCharacter = function() {
// ===========================================================================
let registrationFailed = function(errorMessage) {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Server reports registration failed. Reason: ${errorMessage}`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Server reports registration failed. Reason: ${errorMessage}`);
register.messageLabel.text = errorMessage;
register.messageLabel.styles.main.textColour = toColour(180, 32, 32, 255);
register.passwordInput.text = "";
@@ -917,7 +917,7 @@ let registrationFailed = function(errorMessage) {
// ===========================================================================
let newCharacterFailed = function(errorMessage) {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Server reports new character creation failed. Reason: ${errorMessage}`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Server reports new character creation failed. Reason: ${errorMessage}`);
newCharacter.messageLabel.text = errorMessage;
newCharacter.messageLabel.styles.main.textColour = toColour(180, 32, 32, 255);
newCharacter.firstNameInput.text = "";
@@ -927,14 +927,14 @@ let newCharacterFailed = function(errorMessage) {
// ===========================================================================
let registrationSuccess = function() {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Server reports registration was successful`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Server reports registration was successful`);
closeAllWindows();
}
// ===========================================================================
let twoFactorAuthFailed = function(errorMessage) {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Server reports two-factor authentication failed. Reason: ${errorMessage}`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Server reports two-factor authentication failed. Reason: ${errorMessage}`);
login.messageLabel.text = errorMessage;
login.messageLabel.styles.main.textColour = toColour(180, 32, 32, 255);
login.passwordInput.text = "";
@@ -943,28 +943,28 @@ let twoFactorAuthFailed = function(errorMessage) {
// ===========================================================================
let twoFactorAuthSuccess = function() {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Server reports two-factor authentication was successful`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Server reports two-factor authentication was successful`);
closeAllWindows();
}
// ===========================================================================
let checkTwoFactorAuth = function() {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Checking two-factor authentication with server ...`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Checking two-factor authentication with server ...`);
triggerNetworkEvent("ag.checkTwoFactorAuth", twoFactorAuth.codeInput.lines[0]);
}
// ===========================================================================
let characterSelectSuccess = function() {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Server reports character selection was successful`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Server reports character selection was successful`);
closeAllWindows();
}
// ===========================================================================
let closeErrorDialog = function() {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Closing error dialog`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Closing error dialog`);
errorDialog.window.shown = false;
mexui.setInput(false);
}
@@ -972,7 +972,7 @@ let closeErrorDialog = function() {
// ===========================================================================
let closeInfoDialog = function() {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Closing info dialog`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Closing info dialog`);
infoDialog.window.shown = false;
mexui.setInput(false);
}
@@ -980,7 +980,7 @@ let closeInfoDialog = function() {
// ===========================================================================
let closeAllWindows = function() {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Closing all GUI windows`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Closing all GUI windows`);
infoDialog.window.shown = false;
yesNoDialog.window.shown = false;
errorDialog.window.shown = false;
@@ -996,7 +996,7 @@ let closeAllWindows = function() {
// ===========================================================================
let yesNoDialogAnswerNo = function() {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Responding with answer NO to server prompt`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Responding with answer NO to server prompt`);
triggerNetworkEvent("ag.promptAnswerNo");
closeAllWindows();
}
@@ -1004,7 +1004,7 @@ let yesNoDialogAnswerNo = function() {
// ===========================================================================
let yesNoDialogAnswerYes = function() {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Responding with answer YES to server prompt`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Responding with answer YES to server prompt`);
triggerNetworkEvent("ag.promptAnswerYes");
closeAllWindows();
}
@@ -1012,7 +1012,7 @@ let yesNoDialogAnswerYes = function() {
// ===========================================================================
let showRegistration = function() {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Showing registration window`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Showing registration window`);
closeAllWindows();
setChatWindowEnabled(false);
mexui.setInput(true);
@@ -1023,7 +1023,7 @@ let showRegistration = function() {
let showLogin = function() {
closeAllWindows();
logToConsole(LOG_DEBUG, `[Asshat.GUI] Showing login window`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Showing login window`);
setChatWindowEnabled(false);
mexui.setInput(true);
login.window.shown = true;
@@ -1033,7 +1033,7 @@ let showLogin = function() {
let showTwoFactorAuth = function() {
closeAllWindows();
logToConsole(LOG_DEBUG, `[Asshat.GUI] Showing two-factor authentication window`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Showing two-factor authentication window`);
setChatWindowEnabled(false);
mexui.setInput(true);
twoFactorAuth.window.shown = true;
@@ -1043,7 +1043,7 @@ let showTwoFactorAuth = function() {
let showCharacterSelect = function(firstName, lastName, cash, clan, lastPlayed, skinId) {
closeAllWindows();
logToConsole(LOG_DEBUG, `[Asshat.GUI] Showing character selection window`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Showing character selection window`);
setChatWindowEnabled(false);
mexui.setInput(true);
characterSelect.nameText.text = `${firstName} ${lastName}`;
@@ -1058,7 +1058,7 @@ let showCharacterSelect = function(firstName, lastName, cash, clan, lastPlayed,
let showError = function(errorMessage, errorTitle) {
closeAllWindows();
logToConsole(LOG_DEBUG, `[Asshat.GUI] Showing error window. Error: ${errorTitle} - ${errorMessage}`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Showing error window. Error: ${errorTitle} - ${errorMessage}`);
setChatWindowEnabled(false);
mexui.setInput(true);
errorDialog.messageLabel.text = errorMessage;
@@ -1069,7 +1069,7 @@ let showError = function(errorMessage, errorTitle) {
let showYesNo = function(promptMessage, promptTitle) {
closeAllWindows();
logToConsole(LOG_DEBUG, `[Asshat.GUI] Showing prompt window. Prompt: ${promptTitle} - ${promptMessage}`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Showing prompt window. Prompt: ${promptTitle} - ${promptMessage}`);
mexui.setInput(true);
yesNoDialog.messageLabel.text = promptMessage;
yesNoDialog.window.shown = true;
@@ -1079,7 +1079,7 @@ let showYesNo = function(promptMessage, promptTitle) {
let showInfo = function(infoMessage, infoTitle) {
closeAllWindows();
logToConsole(LOG_DEBUG, `[Asshat.GUI] Showing info dialog window. Info: ${infoTitle} - ${infoMessage}`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Showing info dialog window. Info: ${infoTitle} - ${infoMessage}`);
mexui.setInput(true);
infoDialog.messageLabel.text = infoMessage;
infoDialog.window.shown = true;
@@ -1089,7 +1089,7 @@ let showInfo = function(infoMessage, infoTitle) {
let showNewCharacter = function() {
closeAllWindows();
logToConsole(LOG_DEBUG, `[Asshat.GUI] Showing new character dialog window`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Showing new character dialog window`);
setChatWindowEnabled(false);
mexui.setInput(true);
setHUDEnabled(false);
@@ -1104,28 +1104,28 @@ let showNewCharacter = function() {
// ===========================================================================
let selectNextCharacter = function() {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Requesting next character info from server for character select window`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Requesting next character info from server for character select window`);
triggerNetworkEvent("ag.nextCharacter");
}
// ===========================================================================
let selectPreviousCharacter = function() {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Requesting previous character info from server for character select window`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Requesting previous character info from server for character select window`);
triggerNetworkEvent("ag.previousCharacter");
}
// ===========================================================================
let selectThisCharacter = function() {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Tell server the current shown character was selected in character select window`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Tell server the current shown character was selected in character select window`);
triggerNetworkEvent("ag.selectCharacter");
}
// ===========================================================================
let switchCharacterSelect = function(firstName, lastName, cash, clan, lastPlayed, skinId) {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Updating character info with data from server`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Updating character info with data from server`);
setChatWindowEnabled(false);
characterSelect.window.shown = false;
characterSelect.nameText.text = `${firstName} ${lastName}`;
@@ -1139,70 +1139,70 @@ let switchCharacterSelect = function(firstName, lastName, cash, clan, lastPlayed
// ===========================================================================
addNetworkHandler("ag.showLogin", function() {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Received request from server to show login window`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Received request from server to show login window`);
showLogin();
});
// ===========================================================================
addNetworkHandler("ag.showRegistration", function() {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Received request from server to show registration window`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Received request from server to show registration window`);
showRegistration();
});
// ===========================================================================
addNetworkHandler("ag.showNewCharacter", function() {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Received request from server to show new character window`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Received request from server to show new character window`);
showNewCharacter();
});
// ===========================================================================
addNetworkHandler("ag.showCharacterSelect", function(firstName, lastName, cash, clan, lastPlayed, skinId) {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Received request from server to show character selection window`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Received request from server to show character selection window`);
showCharacterSelect(firstName, lastName, cash, clan, lastPlayed, skinId);
});
// ===========================================================================
addNetworkHandler("ag.switchCharacterSelect", function(firstName, lastName, cash, clan, lastPlayed, skinId) {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Received request from server to update character selection window with new info`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Received request from server to update character selection window with new info`);
switchCharacterSelect(firstName, lastName, cash, clan, lastPlayed, skinId);
});
// ===========================================================================
addNetworkHandler("ag.showError", function(errorMessage, errorTitle) {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Received request from server to show error window`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Received request from server to show error window`);
showError(errorMessage, errorTitle);
});
// ===========================================================================
addNetworkHandler("ag.showPrompt", function(promptMessage, promptTitle) {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Received request from server to show prompt window`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Received request from server to show prompt window`);
showYesNo(promptMessage, promptTitle);
});
// ===========================================================================
addNetworkHandler("ag.showInfo", function(infoMessage) {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Received request from server to show info dialog`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Received request from server to show info dialog`);
showInfo(infoMessage);
});
// ===========================================================================
addNetworkHandler("ag.loginSuccess", function() {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Received signal of successful login from server`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Received signal of successful login from server`);
loginSuccess();
});
// ===========================================================================
addNetworkHandler("ag.characterSelectSuccess", function() {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Received signal of successful character selection from server`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Received signal of successful character selection from server`);
characterSelectSuccess();
setChatWindowEnabled(true);
});
@@ -1210,35 +1210,35 @@ addNetworkHandler("ag.characterSelectSuccess", function() {
// ===========================================================================
addNetworkHandler("ag.loginFailed", function(remainingAttempts) {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Received signal of failed login from server`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Received signal of failed login from server`);
loginFailed(remainingAttempts);
});
// ===========================================================================
addNetworkHandler("ag.registrationSuccess", function() {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Received signal of successful registration from server`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Received signal of successful registration from server`);
registrationSuccess();
});
// ===========================================================================
addNetworkHandler("ag.registrationFailed", function(errorMessage) {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Received signal of failed registration from server`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Received signal of failed registration from server`);
registrationFailed(errorMessage);
});
// ===========================================================================
addNetworkHandler("ag.newCharacterFailed", function(errorMessage) {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Received signal of failed registration from server`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Received signal of failed registration from server`);
newCharacterFailed(errorMessage);
});
// ===========================================================================
addNetworkHandler("ag.guiColour", function(red, green, blue) {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Received new GUI colours from server`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Received new GUI colours from server`);
primaryColour = [red, green, blue];
focusedColour = [red+focusedColourOffset, green+focusedColourOffset, blue+focusedColourOffset];
});
@@ -1246,7 +1246,7 @@ addNetworkHandler("ag.guiColour", function(red, green, blue) {
// ===========================================================================
addNetworkHandler("ag.guiInit", function() {
logToConsole(LOG_DEBUG, `[Asshat.GUI] Initializing MexUI app`);
logToConsole(LOG_DEBUG, `[VRR.GUI] Initializing MexUI app`);
initGUI();
triggerNetworkEvent("ag.guiReady", true);
});

View File

@@ -16,8 +16,8 @@ let itemActionDelaySize = toVector2(200, 5);
// ===========================================================================
function initItemScript() {
logToConsole(LOG_DEBUG, "[Asshat.Item]: Initializing item script ...");
logToConsole(LOG_DEBUG, "[Asshat.Item]: Item script initialized!");
logToConsole(LOG_DEBUG, "[VRR.Item]: Initializing item script ...");
logToConsole(LOG_DEBUG, "[VRR.Item]: Item script initialized!");
}
// ===========================================================================
@@ -47,7 +47,7 @@ function processItemActionRendering() {
// ===========================================================================
function updatePlayerHotBar(activeSlot, itemsArray) {
logToConsole(LOG_DEBUG, `[Asshat.Main] Updating hotbar`);
logToConsole(LOG_DEBUG, `[VRR.Main] Updating hotbar`);
}
// ===========================================================================

View File

@@ -15,28 +15,28 @@ let jobRouteStopSphere = null;
// ===========================================================================
function initJobScript() {
logToConsole(LOG_DEBUG, "[Asshat.Job]: Initializing job script ...");
logToConsole(LOG_DEBUG, "[Asshat.Job]: Job script initialized!");
logToConsole(LOG_DEBUG, "[VRR.Job]: Initializing job script ...");
logToConsole(LOG_DEBUG, "[VRR.Job]: Job script initialized!");
}
// ===========================================================================
function setLocalPlayerJobType(tempJobType) {
logToConsole(LOG_DEBUG, `[Asshat.Main] Set local player job type to ${tempJobType}`);
logToConsole(LOG_DEBUG, `[VRR.Main] Set local player job type to ${tempJobType}`);
localPlayerJobType = tempJobType;
}
// ===========================================================================
function setLocalPlayerWorkingState(tempWorking) {
logToConsole(LOG_DEBUG, `[Asshat.Main] Setting working state to ${tempWorking}`);
logToConsole(LOG_DEBUG, `[VRR.Main] Setting working state to ${tempWorking}`);
localPlayerWorking = tempWorking;
}
// ===========================================================================
function showJobRouteStop() {
logToConsole(LOG_DEBUG, `[Asshat.Job] Showing route stop`);
logToConsole(LOG_DEBUG, `[VRR.Job] Showing route stop`);
if(gta.game == GAME_GTA_SA) {
jobRouteStopSphere = gta.createPickup(1318, position, 1);
} else {
@@ -50,7 +50,7 @@ function showJobRouteStop() {
// ===========================================================================
function showJobRouteStop(position, colour) {
logToConsole(LOG_DEBUG, `[Asshat.Job] Showing route stop`);
logToConsole(LOG_DEBUG, `[VRR.Job] Showing route stop`);
if(gta.game == GAME_GTA_SA) {
jobRouteStopSphere = gta.createPickup(1318, position, 1);
} else {
@@ -64,7 +64,7 @@ function showJobRouteStop(position, colour) {
// ===========================================================================
function enteredJobRouteSphere() {
logToConsole(LOG_DEBUG, `[Asshat.Job] Entered job route sphere`);
logToConsole(LOG_DEBUG, `[VRR.Job] Entered job route sphere`);
tellServerPlayerArrivedAtJobRouteStop();
destroyElement(jobRouteStopSphere);
destroyElement(jobRouteStopBlip);

View File

@@ -15,25 +15,25 @@ let keyBindLongHoldDuration = 1500;
// ===========================================================================
function initKeyBindScript() {
logToConsole(LOG_DEBUG, "[Asshat.KeyBind]: Initializing key bind script ...");
logToConsole(LOG_DEBUG, "[Asshat.KeyBind]: Key bind script initialized!");
logToConsole(LOG_DEBUG, "[VRR.KeyBind]: Initializing key bind script ...");
logToConsole(LOG_DEBUG, "[VRR.KeyBind]: Key bind script initialized!");
}
// ===========================================================================
function bindAccountKey(key, keyState) {
logToConsole(LOG_DEBUG, `[Asshat.KeyBind]: Binded key ${sdl.getKeyName(key)} (${key})`);
logToConsole(LOG_DEBUG, `[VRR.KeyBind]: Binded key ${sdl.getKeyName(key)} (${key})`);
bindKey(toInteger(key), keyState, function(event) {
if(hasKeyBindDelayElapsed()) {
if(canLocalPlayerUseKeyBinds()) {
logToConsole(LOG_DEBUG, `[Asshat.KeyBind]: Using keybind for key ${sdl.getKeyName(key)} (${key})`);
logToConsole(LOG_DEBUG, `[VRR.KeyBind]: Using keybind for key ${sdl.getKeyName(key)} (${key})`);
lastKeyBindUse = sdl.ticks;
tellServerPlayerUsedKeyBind(key);
} else {
logToConsole(LOG_ERROR, `[Asshat.KeyBind]: Failed to use keybind for key ${sdl.getKeyName(key)} (${key}) - Not allowed to use keybinds!`);
logToConsole(LOG_ERROR, `[VRR.KeyBind]: Failed to use keybind for key ${sdl.getKeyName(key)} (${key}) - Not allowed to use keybinds!`);
}
} else {
logToConsole(LOG_ERROR, `[Asshat.KeyBind]: Failed to use keybind for key ${sdl.getKeyName(key)} (${key}) - Not enough time has passed since last keybind use!`);
logToConsole(LOG_ERROR, `[VRR.KeyBind]: Failed to use keybind for key ${sdl.getKeyName(key)} (${key}) - Not enough time has passed since last keybind use!`);
}
});
}
@@ -41,7 +41,7 @@ function bindAccountKey(key, keyState) {
// ===========================================================================
function unBindAccountKey(key) {
logToConsole(LOG_DEBUG, `[Asshat.KeyBind]: Unbinded key ${sdl.getKeyName(key)} (${key})`);
logToConsole(LOG_DEBUG, `[VRR.KeyBind]: Unbinded key ${sdl.getKeyName(key)} (${key})`);
unbindKey(key);
return true;
}

View File

@@ -32,12 +32,12 @@ let propertyLabelNameOffset = 18;
// ===========================================================================
function initLabelScript() {
logToConsole(LOG_DEBUG, "[Asshat.Label]: Initializing label script ...");
logToConsole(LOG_DEBUG, "[VRR.Label]: Initializing label script ...");
propertyLabelNameFont = initLabelPropertyNameFont();
propertyLabelLockedFont = initLabelPropertyLockedFont();
jobNameLabelFont = initLabelJobNameFont();
jobHelpLabelFont = initLabelJobHelpFont();
logToConsole(LOG_DEBUG, "[Asshat.Label]: Label script initialized!");
logToConsole(LOG_DEBUG, "[VRR.Label]: Label script initialized!");
}
// ===========================================================================
@@ -99,10 +99,10 @@ function renderPropertyEntranceLabel(name, position, locked, isBusiness, price,
text = (locked) ? "LOCKED" : "UNLOCKED";
if(isBusiness) {
text = (locked) ? "CLOSED" : "OPEN";
if(!locked && bizLabelInfoType != AG_BIZLABEL_INFO_NONE) {
if(!locked && bizLabelInfoType != VRR_BIZLABEL_INFO_NONE) {
let bizInfoText = "";
switch(bizLabelInfoType) {
case AG_BIZLABEL_INFO_ENTER:
case VRR_BIZLABEL_INFO_ENTER:
if(enterPropertyKey != null) {
bizInfoText = `Press ${sdl.getKeyName(enterPropertyKey)} to enter`;
} else {
@@ -110,15 +110,15 @@ function renderPropertyEntranceLabel(name, position, locked, isBusiness, price,
}
break;
case AG_BIZLABEL_INFO_BUY:
case VRR_BIZLABEL_INFO_BUY:
bizInfoText = `Use /buy to purchase items`;
break;
case AG_BIZLABEL_INFO_ENTERVEH:
case VRR_BIZLABEL_INFO_ENTERVEH:
bizInfoText = "Enter a vehicle to purchase it";
break;
case AG_BIZLABEL_INFO_NONE:
case VRR_BIZLABEL_INFO_NONE:
default:
bizInfoText = "";
break;
@@ -227,7 +227,7 @@ function processLabelRendering() {
if(pickups[i].getData("ag.label.type") != null) {
if(getDistance(localPlayer.position, pickups[i].position) <= renderLabelDistance) {
let price = 0;
let bizLabelInfoType = AG_BIZLABEL_INFO_NONE;
let bizLabelInfoType = VRR_BIZLABEL_INFO_NONE;
if(pickups[i].getData("ag.label.price") != null) {
price = makeLargeNumberReadable(pickups[i].getData("ag.label.price"));
}
@@ -237,19 +237,19 @@ function processLabelRendering() {
}
switch(pickups[i].getData("ag.label.type")) {
case AG_LABEL_BUSINESS:
case VRR_LABEL_BUSINESS:
renderPropertyEntranceLabel(pickups[i].getData("ag.label.name"), pickups[i].position, pickups[i].getData("ag.label.locked"), true, price, bizLabelInfoType);
break;
case AG_LABEL_HOUSE:
case VRR_LABEL_HOUSE:
renderPropertyEntranceLabel(pickups[i].getData("ag.label.name"), pickups[i].position, pickups[i].getData("ag.label.locked"), false, price, bizLabelInfoType);
break;
case AG_LABEL_JOB:
case VRR_LABEL_JOB:
renderJobLabel(pickups[i].getData("ag.label.name"), pickups[i].position, pickups[i].getData("ag.label.jobType"));
break;
case AG_LABEL_EXIT:
case VRR_LABEL_EXIT:
renderPropertyExitLabel(pickups[i].position);
break;
}

View File

@@ -14,9 +14,9 @@ let logoSize = toVector2(128, 128);
// ===========================================================================
function initLogoScript() {
logToConsole(LOG_DEBUG, "[Asshat.Logo]: Initializing logo script ...");
logToConsole(LOG_DEBUG, "[VRR.Logo]: Initializing logo script ...");
logoImage = loadLogoImage();
logToConsole(LOG_DEBUG, "[Asshat.Logo]: Logo script initialized!");
logToConsole(LOG_DEBUG, "[VRR.Logo]: Logo script initialized!");
}
// ===========================================================================
@@ -45,7 +45,7 @@ function processLogoRendering() {
// ===========================================================================
function setServerLogoRenderState(state) {
logToConsole(LOG_DEBUG, `[Asshat.Main] Server logo ${(state) ? "enabled" : "disabled"}`);
logToConsole(LOG_DEBUG, `[VRR.Main] Server logo ${(state) ? "enabled" : "disabled"}`);
renderLogo = state;
}

View File

@@ -15,9 +15,9 @@ let smallGameMessageTimer = null;
// ===========================================================================
function initMessagingScript() {
logToConsole(LOG_DEBUG, "[Asshat.Messaging]: Initializing messaging script ...");
logToConsole(LOG_DEBUG, "[VRR.Messaging]: Initializing messaging script ...");
smallGameMessageFont = loadSmallGameMessageFont();
logToConsole(LOG_DEBUG, "[Asshat.Messaging]: Messaging script initialized!");
logToConsole(LOG_DEBUG, "[VRR.Messaging]: Messaging script initialized!");
}
// ===========================================================================
@@ -61,7 +61,7 @@ function processSmallGameMessageRendering() {
// ===========================================================================
function showSmallGameMessage(text, colour, duration) {
logToConsole(LOG_DEBUG, `[Asshat.Messaging] Showing small game message '${text}' for ${duration}ms`);
logToConsole(LOG_DEBUG, `[VRR.Messaging] Showing small game message '${text}' for ${duration}ms`);
if(smallGameMessageText != "") {
clearTimeout(smallGameMessageTimer);
}

View File

@@ -22,10 +22,10 @@ let playerPing = {};
// ===========================================================================
function initNameTagScript() {
logToConsole(LOG_DEBUG, "[Asshat.NameTag]: Initializing nametag script ...");
logToConsole(LOG_DEBUG, "[VRR.NameTag]: Initializing nametag script ...");
nametagFont = loadNameTagFont();
afkStatusFont = loadPausedStatusFont();
logToConsole(LOG_DEBUG, "[Asshat.NameTag]: Nametag script initialized!");
logToConsole(LOG_DEBUG, "[VRR.NameTag]: Nametag script initialized!");
}
// ===========================================================================

View File

@@ -17,10 +17,10 @@ let scoreboardKey = SDLK_TAB;
// ===========================================================================
function initScoreBoardScript() {
logToConsole(LOG_DEBUG, "[Asshat.ScoreBoard]: Initializing scoreboard script ...");
logToConsole(LOG_DEBUG, "[VRR.ScoreBoard]: Initializing scoreboard script ...");
scoreBoardTitleFont = initScoreBoardTitleFont();
scoreBoardListFont = initScoreBoardListFont();
logToConsole(LOG_DEBUG, "[Asshat.ScoreBoard]: Scoreboard script initialized!");
logToConsole(LOG_DEBUG, "[VRR.ScoreBoard]: Scoreboard script initialized!");
}
// ===========================================================================

View File

@@ -8,15 +8,15 @@
// ===========================================================================
function initServerScript() {
logToConsole(LOG_DEBUG, "[Asshat.Server]: Initializing server script ...");
logToConsole(LOG_DEBUG, "[VRR.Server]: Initializing server script ...");
addAllNetworkHandlers();
logToConsole(LOG_DEBUG, "[Asshat.Server]: Server script initialized!");
logToConsole(LOG_DEBUG, "[VRR.Server]: Server script initialized!");
}
// ===========================================================================
function addAllNetworkHandlers() {
logToConsole(LOG_DEBUG, "[Asshat.Server]: Adding network handlers ...");
logToConsole(LOG_DEBUG, "[VRR.Server]: Adding network handlers ...");
addNetworkHandler("ag.smallGameMessage", showSmallGameMessage);
addNetworkHandler("ag.working", setLocalPlayerWorkingState);
@@ -104,7 +104,7 @@ function sendResourceStoppedSignalToServer() {
// ===========================================================================
function setPlayer2DRendering(hudState, labelState, smallGameMessageState, scoreboardState, hotBarState, itemActionDelayState) {
logToConsole(LOG_DEBUG, `[Asshat.Main] Updating render states (HUD: ${hudState}, Labels: ${labelState}, Bottom Text: ${smallGameMessageState}, Scoreboard: ${scoreboardState}, HotBar: ${hotBarState}, Item Action Delay: ${itemActionDelayState})`);
logToConsole(LOG_DEBUG, `[VRR.Main] Updating render states (HUD: ${hudState}, Labels: ${labelState}, Bottom Text: ${smallGameMessageState}, Scoreboard: ${scoreboardState}, HotBar: ${hotBarState}, Item Action Delay: ${itemActionDelayState})`);
renderHUD = hudState;
setHUDEnabled(hudState);
@@ -118,7 +118,7 @@ function setPlayer2DRendering(hudState, labelState, smallGameMessageState, score
// ===========================================================================
function onServerSpawnedPlayer(state) {
logToConsole(LOG_DEBUG, `[Asshat.Main] Setting spawned state to ${state}`);
logToConsole(LOG_DEBUG, `[VRR.Main] Setting spawned state to ${state}`);
isSpawned = state;
if(state) {
if(gta.game == GAME_GTA_III) {

View File

@@ -40,10 +40,10 @@ let newCharacterSkinSelectPedHeading = [
// ===========================================================================
function initSkinSelectScript() {
logToConsole(LOG_DEBUG, "[Asshat.SkinSelect]: Initializing skin selector script ...");
logToConsole(LOG_DEBUG, "[VRR.SkinSelect]: Initializing skin selector script ...");
skinSelectMessageFontTop = loadSkinSelectMessageFontTop();
skinSelectMessageFontBottom = loadSkinSelectMessageFontBottom();
logToConsole(LOG_DEBUG, "[Asshat.SkinSelect]: Skin selector script initialized!");
logToConsole(LOG_DEBUG, "[VRR.SkinSelect]: Skin selector script initialized!");
}
// ===========================================================================

View File

@@ -175,14 +175,14 @@ function closeAllGarages() {
// ===========================================================================
function setLocalPlayerFrozenState(state) {
logToConsole(LOG_DEBUG, `[Asshat.Utilities] Setting frozen state to ${state}`);
logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting frozen state to ${state}`);
gui.showCursor(state, !state);
}
// ===========================================================================
function setLocalPlayerControlState(controlState, cursorState = false) {
logToConsole(LOG_DEBUG, `[Asshat.Utilities] Setting control state to ${controlState} (Cursor: ${cursorState})`);
logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting control state to ${controlState} (Cursor: ${cursorState})`);
controlsEnabled = controlState;
localPlayer.invincible = true;
localPlayer.collisionsEnabled = controlState;
@@ -192,7 +192,7 @@ function setLocalPlayerControlState(controlState, cursorState = false) {
// ===========================================================================
function fadeLocalCamera(state, time) {
logToConsole(LOG_DEBUG, `[Asshat.Utilities] Fading camera ${(state)?"in":"out"} for ${time} seconds`);
logToConsole(LOG_DEBUG, `[VRR.Utilities] Fading camera ${(state)?"in":"out"} for ${time} seconds`);
gta.fadeCamera(state, time);
}
@@ -205,29 +205,29 @@ function removeLocalPlayerFromVehicle() {
// ===========================================================================
function restoreLocalCamera() {
logToConsole(LOG_DEBUG, `[Asshat.Utilities] Camera restored`);
logToConsole(LOG_DEBUG, `[VRR.Utilities] Camera restored`);
gta.restoreCamera(true);
};
// ===========================================================================
function clearLocalPlayerOwnedPeds() {
logToConsole(LOG_DEBUG, `[Asshat.Utilities] Clearing all self-owned peds ...`);
logToConsole(LOG_DEBUG, `[VRR.Utilities] Clearing all self-owned peds ...`);
clearSelfOwnedPeds();
logToConsole(LOG_DEBUG, `[Asshat.Utilities] All self-owned peds cleared`);
logToConsole(LOG_DEBUG, `[VRR.Utilities] All self-owned peds cleared`);
};
// ===========================================================================
function setLocalCameraLookAt(cameraPosition, cameraLookAt) {
logToConsole(LOG_DEBUG, `[Asshat.Utilities] Set camera to look at [${cameraLookAt.x}, ${cameraLookAt.y}, ${cameraLookAt.z}] from [${cameraPosition.x}, ${cameraPosition.y}, ${cameraPosition.z}]`);
logToConsole(LOG_DEBUG, `[VRR.Utilities] Set camera to look at [${cameraLookAt.x}, ${cameraLookAt.y}, ${cameraLookAt.z}] from [${cameraPosition.x}, ${cameraPosition.y}, ${cameraPosition.z}]`);
gta.setCameraLookAt(cameraPosition, cameraLookAt, true);
}
// ===========================================================================
function setCityAmbienceState(state) {
logToConsole(LOG_DEBUG, `[Asshat.Utilities] Ambient civilians and traffic ${(state) ? "enabled" : "disabled"}`);
logToConsole(LOG_DEBUG, `[VRR.Utilities] Ambient civilians and traffic ${(state) ? "enabled" : "disabled"}`);
gta.setTrafficEnabled(state);
gta.setGenerateCarsAroundCamera(state);
if(gta.game != GAME_GTA_SA) {
@@ -263,7 +263,7 @@ function enterVehicleAsPassenger() {
// ===========================================================================
function giveLocalPlayerWeapon(weaponId, ammo, active) {
logToConsole(LOG_DEBUG, `[Asshat.Utilities] Giving weapon ${weaponId} with ${ammo} ammo`);
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));
@@ -273,7 +273,7 @@ function giveLocalPlayerWeapon(weaponId, ammo, active) {
// ===========================================================================
function giveLocalPlayerWeapon(weaponId, ammo, active) {
logToConsole(LOG_DEBUG, `[Asshat.Utilities] Giving weapon ${weaponId} with ${ammo} ammo`);
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));
@@ -283,7 +283,7 @@ function giveLocalPlayerWeapon(weaponId, ammo, active) {
// ===========================================================================
function clearLocalPlayerWeapons() {
logToConsole(LOG_DEBUG, `[Asshat.Utilities] Clearing weapons`);
logToConsole(LOG_DEBUG, `[VRR.Utilities] Clearing weapons`);
localPlayer.clearWeapons();
forceWeapon = 0;
forceWeaponAmmo = 0;
@@ -299,7 +299,7 @@ function getClosestVehicle(pos) {
// ===========================================================================
function setLocalPlayerPosition(position) {
logToConsole(LOG_DEBUG, `[Asshat.Utilities] Setting position to ${position.x}, ${position.y}, ${position.z}`);
logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting position to ${position.x}, ${position.y}, ${position.z}`);
localPlayer.velocity = toVector3(0.0, 0.0, 0.0);
localPlayer.position = position;
}
@@ -307,14 +307,14 @@ function setLocalPlayerPosition(position) {
// ===========================================================================
function setLocalPlayerHeading(heading) {
logToConsole(LOG_DEBUG, `[Asshat.Utilities] Setting heading to ${heading}`);
logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting heading to ${heading}`);
localPlayer.heading = heading;
}
// ===========================================================================
function setLocalPlayerInterior(interior) {
logToConsole(LOG_DEBUG, `[Asshat.Utilities] Setting interior to ${interior}`);
logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting interior to ${interior}`);
localPlayer.interior = interior;
gta.cameraInterior = interior;
}
@@ -322,7 +322,7 @@ function setLocalPlayerInterior(interior) {
// ===========================================================================
function setSnowState(fallingSnow, groundSnow) {
logToConsole(LOG_DEBUG, `[Asshat.Utilities] Setting falling snow to ${fallingSnow} and ground snow to ${groundSnow}`);
logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting falling snow to ${fallingSnow} and ground snow to ${groundSnow}`);
if(!isNull(snowing)) {
snowing = fallingSnow;
forceSnowing(groundSnow);
@@ -344,14 +344,14 @@ function isSnowEnabled() {
// ===========================================================================
function playPedSpeech(pedName, speechId) {
logToConsole(LOG_DEBUG, `[Asshat.Utilities] Making ${pedName}'s ped talk (${speechId})`);
logToConsole(LOG_DEBUG, `[VRR.Utilities] Making ${pedName}'s ped talk (${speechId})`);
gta.SET_CHAR_SAY(int, int);
}
// ===========================================================================
function clearLocalPedState() {
logToConsole(LOG_DEBUG, `[Asshat.Utilities] Clearing local ped state`);
logToConsole(LOG_DEBUG, `[VRR.Utilities] Clearing local ped state`);
localPlayer.clearObjective();
}
@@ -364,7 +364,7 @@ function getWeaponSlot(weaponId) {
// ===========================================================================
function setLocalPlayerDrunkEffect(amount, duration) {
logToConsole(LOG_DEBUG, `[Asshat.Utilities] Drunk effect set to ${amount} for ${duration}ms`);
logToConsole(LOG_DEBUG, `[VRR.Utilities] Drunk effect set to ${amount} for ${duration}ms`);
drunkEffectAmount = 0;
drunkEffectDurationTimer = setInterval(function() {
drunkEffectAmount = drunkEffectAmount;
@@ -401,7 +401,7 @@ function clearSelfOwnedPeds() {
// ===========================================================================
function setMouseCameraState(state) {
logToConsole(LOG_DEBUG, `[Asshat.Utilities] ${(state)?"Enabled":"Disabled"} mouse camera`);
logToConsole(LOG_DEBUG, `[VRR.Utilities] ${(state)?"Enabled":"Disabled"} mouse camera`);
mouseCameraEnabled = !mouseCameraEnabled;
SetStandardControlsEnabled(!mouseCameraEnabled);
}
@@ -409,42 +409,42 @@ function setMouseCameraState(state) {
// ===========================================================================
function setMouseCursorState(state) {
logToConsole(LOG_DEBUG, `[Asshat.Utilities] ${(state)?"Enabled":"Disabled"} mouse cursor`);
logToConsole(LOG_DEBUG, `[VRR.Utilities] ${(state)?"Enabled":"Disabled"} mouse cursor`);
gui.showCursor(state, !state);
}
// ===========================================================================
function setPlayerWeaponDamageEvent(clientName, eventType) {
logToConsole(LOG_DEBUG, `[Asshat.Utilities] Set ${clientName} damage event type to ${eventType}`);
logToConsole(LOG_DEBUG, `[VRR.Utilities] Set ${clientName} damage event type to ${eventType}`);
weaponDamageEvent[clientName] = eventType;
}
// ===========================================================================
function setPlayerWeaponDamageEnabled(clientName, state) {
logToConsole(LOG_DEBUG, `[Asshat.Utilities] ${(state)?"Enabled":"Disabled"} damage from ${clientName}`);
logToConsole(LOG_DEBUG, `[VRR.Utilities] ${(state)?"Enabled":"Disabled"} damage from ${clientName}`);
weaponDamageEnabled[clientName] = state;
}
// ===========================================================================
function setLocalPlayerCash(amount) {
logToConsole(LOG_DEBUG, `[Asshat.Utilities] Setting local player money`);
logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting local player money`);
localPlayer.money = amount;
}
// ===========================================================================
function removeWorldObject(model, position, range) {
logToConsole(LOG_DEBUG, `[Asshat.Utilities] Removing world object ${model} at X: ${position.x}, Y: ${position.x}, Z: ${position.x} with range of ${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);
}
// ===========================================================================
function excludeModelFromGroundSnow(model) {
logToConsole(LOG_DEBUG, `[Asshat.Utilities] Disabling ground snow for object model ${model}`);
logToConsole(LOG_DEBUG, `[VRR.Utilities] Disabling ground snow for object model ${model}`);
groundSnow.excludeModel(model);
}