Prefix
This commit is contained in:
@@ -284,31 +284,31 @@ function toggleAccountGUICommand(command, params, client) {
|
||||
if (doesPlayerHaveGUIEnabled(client)) {
|
||||
getPlayerData(client).accountData.settings = addBitFlag(getPlayerData(client).accountData.settings, flagValue);
|
||||
messagePlayerNormal(client, getLocaleString(client, "GUIAccountSettingToggle", `{softRed}${toUpperCase(getLocaleString(client, "Off"))}{MAINCOLOUR}`));
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} has toggled GUI for their account OFF.`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} has toggled GUI for their account OFF.`);
|
||||
} else {
|
||||
getPlayerData(client).accountData.settings = removeBitFlag(getPlayerData(client).accountData.settings, flagValue);
|
||||
messagePlayerNormal(client, getLocaleString(client, "GUIAccountSettingToggle", `{softGreen}${toUpperCase(getLocaleString(client, "On"))}{MAINCOLOUR}`));
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} has toggled GUI for their account ON.`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} has toggled GUI for their account ON.`);
|
||||
}
|
||||
|
||||
if (!isPlayerLoggedIn(client)) {
|
||||
if (getPlayerData().accountData.databaseId != 0) {
|
||||
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||
showPlayerLoginGUI(client);
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login GUI`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login GUI`);
|
||||
} else {
|
||||
hideAllPlayerGUI(client);
|
||||
messagePlayerNormal(client, getLocaleString(client, "WelcomeBack", getServerName(), getPlayerName(client), "{ALTCOLOUR}/login{MAINCOLOUR}"));
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login message (GUI disabled)`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login message (GUI disabled)`);
|
||||
}
|
||||
} else {
|
||||
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||
showPlayerRegistrationGUI(client);
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the register GUI`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the register GUI`);
|
||||
} else {
|
||||
hideAllPlayerGUI(client);
|
||||
messagePlayerNormal(client, getLocaleString(client, "WelcomeNewPlayer", getServerName(), getPlayerName(client), "{ALTCOLOUR}/register{MAINCOLOUR}"));
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the register message (GUI disabled)`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the register message (GUI disabled)`);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -323,11 +323,11 @@ function toggleAccountLoginAttemptNotificationsCommand(command, params, client)
|
||||
if (doesPlayerHaveLoginAlertsEnabled(client)) {
|
||||
getPlayerData(client).accountData.settings = removeBitFlag(getPlayerData(client).accountData.settings, flagValue);
|
||||
messagePlayerNormal(client, `⚙️ You turned ${getBoolRedGreenInlineColour(false)}OFF{MAINCOLOUR} notification by email when somebody tries to login to your account`);
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} has toggled the login attempt email notifications OFF for their account`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} has toggled the login attempt email notifications OFF for their account`);
|
||||
} else {
|
||||
getPlayerData(client).accountData.settings = addBitFlag(getPlayerData(client).accountData.settings, flagValue);
|
||||
messagePlayerNormal(client, `⚙️ You turned ${getBoolRedGreenInlineColour(true)}ON{MAINCOLOUR} notification by email when somebody tries to login to your account`);
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} has toggled the login attempt email notifications OFF for their account`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} has toggled the login attempt email notifications OFF for their account`);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -341,14 +341,14 @@ function toggleAccountServerLogoCommand(command, params, client) {
|
||||
if (!doesPlayerHaveLogoEnabled(client)) {
|
||||
getPlayerData(client).accountData.settings = removeBitFlag(getPlayerData(client).accountData.settings, flagValue);
|
||||
messagePlayerSuccess(client, getLocaleString(client, "AccountServerLogoSet", `${getBoolRedGreenInlineColour(true)}${getLocaleString(client, "On")}{MAINCOLOUR}`));
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} has toggled the server logo ON for their account`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} has toggled the server logo ON for their account`);
|
||||
if (getServerConfig().showLogo) {
|
||||
updatePlayerShowLogoState(client, true);
|
||||
}
|
||||
} else {
|
||||
getPlayerData(client).accountData.settings = addBitFlag(getPlayerData(client).accountData.settings, flagValue);
|
||||
messagePlayerSuccess(client, getLocaleString(client, "AccountServerLogoSet", `${getBoolRedGreenInlineColour(false)}${getLocaleString(client, "Off")}{MAINCOLOUR}`));
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} has toggled the server logo OFF for their account`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} has toggled the server logo OFF for their account`);
|
||||
updatePlayerShowLogoState(client, false);
|
||||
}
|
||||
|
||||
@@ -377,11 +377,11 @@ function toggleAccountTwoFactorAuthCommand(command, params, client) {
|
||||
if (!doesPlayerHaveTwoFactorAuthEnabled(client)) {
|
||||
getPlayerData(client).accountData.settings = addBitFlag(getPlayerData(client).accountData.settings, flagValue);
|
||||
messagePlayerSuccess(client, getLocaleString(client, "TwoFactorAuthSet", `${getBoolRedGreenInlineColour(true)}${getLocaleString(client, "On")}{MAINCOLOUR}`));
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} has toggled two-factor authentication ON for their account`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} has toggled two-factor authentication ON for their account`);
|
||||
} else {
|
||||
getPlayerData(client).accountData.settings = removeBitFlag(getPlayerData(client).accountData.settings, flagValue);
|
||||
messagePlayerSuccess(client, getLocaleString(client, "TwoFactorAuthSet", `${getBoolRedGreenInlineColour(false)}${toUpperCase(getLocaleString(client, "Off"))}{MAINCOLOUR}`));
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} has toggled two-factor authentication OFF for their account`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} has toggled two-factor authentication OFF for their account`);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -828,7 +828,7 @@ function saltAccountInfo(name, password) {
|
||||
// ===========================================================================
|
||||
|
||||
function loginSuccess(client) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} successfully logged in.`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} successfully logged in.`);
|
||||
getPlayerData(client).loggedIn = true;
|
||||
|
||||
if (getPlayerData(client).loginTimeout != null) {
|
||||
@@ -839,7 +839,7 @@ function loginSuccess(client) {
|
||||
updateConnectionLogOnAuth(client, getPlayerData(client).accountData.databaseId);
|
||||
|
||||
if (doesPlayerHaveStaffPermission(client, "Developer") || doesPlayerHaveStaffPermission(client, "ManageServer")) {
|
||||
logToConsole(LOG_WARN, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} has needed permissions and is being given administrator access`);
|
||||
logToConsole(LOG_WARN, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} has needed permissions and is being given administrator access`);
|
||||
setPlayerNativeAdminState(client, true);
|
||||
}
|
||||
|
||||
@@ -851,11 +851,11 @@ function loginSuccess(client) {
|
||||
}, 3500);
|
||||
|
||||
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the error GUI (not a tester).`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the error GUI (not a tester).`);
|
||||
showPlayerErrorGUI(client, getLocaleString(client, "NotATester"), getLocaleString(client, "AccessDenied"));
|
||||
return false;
|
||||
} else {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the "not a tester" error message (GUI disabled).`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the "not a tester" error message (GUI disabled).`);
|
||||
messagePlayerError(client, getLocaleString(client, "NotATester"));
|
||||
return false;
|
||||
}
|
||||
@@ -866,10 +866,10 @@ function loginSuccess(client) {
|
||||
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||
showPlayerPrompt(client, getLocaleString(client, "NoCharactersGUIMessage"), getLocaleString(client, "NoCharactersGUIWindowTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
|
||||
getPlayerData(client).promptType = V_PROMPT_CREATEFIRSTCHAR;
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the no characters prompt GUI`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the no characters prompt GUI`);
|
||||
} else {
|
||||
messagePlayerAlert(client, getLocaleString(client, "NoCharactersChatMessage", `{ALTCOLOUR}/newchar{MAINCOLOUR}`));
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the no characters message (GUI disabled)`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the no characters message (GUI disabled)`);
|
||||
}
|
||||
} else {
|
||||
showCharacterSelectToClient(client);
|
||||
@@ -1068,7 +1068,7 @@ function checkLogin(client, password) {
|
||||
}
|
||||
|
||||
if (isPlayerLoggedIn(client)) {
|
||||
logToConsole(LOG_WARN, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} attempted to login but is already logged in`);
|
||||
logToConsole(LOG_WARN, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} attempted to login but is already logged in`);
|
||||
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||
showPlayerLoginSuccessGUI(client);
|
||||
} else {
|
||||
@@ -1079,25 +1079,25 @@ function checkLogin(client, password) {
|
||||
}
|
||||
|
||||
if (!isPlayerRegistered(client)) {
|
||||
logToConsole(LOG_WARN, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} attempted to login but is not registered`);
|
||||
logToConsole(LOG_WARN, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} attempted to login but is not registered`);
|
||||
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||
showPlayerRegistrationGUI(client);
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the register GUI`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the register GUI`);
|
||||
} else {
|
||||
messagePlayerError(client, "Your name is not registered! Use /register to make an account.");
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the register message (GUI disabled)`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the register message (GUI disabled)`);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if (areParamsEmpty(password)) {
|
||||
logToConsole(LOG_WARN, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} attempted to login but failed (empty password). ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining`);
|
||||
logToConsole(LOG_WARN, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} attempted to login but failed (empty password). ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining`);
|
||||
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||
showPlayerLoginFailedGUI(client, getLocaleString(client, "LoginFailedInvalidPassword", getPlayerData(client).loginAttemptsRemaining));
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login GUI with ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining alert.`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login GUI with ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining alert.`);
|
||||
} else {
|
||||
messagePlayerError(client, getLocaleString(client, "LoginFailedNoPassword", getPlayerData(client).loginAttemptsRemaining));
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login message (GUI disabled) with ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining alert.`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login message (GUI disabled) with ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining alert.`);
|
||||
}
|
||||
|
||||
// Disabling email login alerts for now. It hangs the server for a couple seconds. Need a way to thread it.
|
||||
@@ -1108,13 +1108,13 @@ function checkLogin(client, password) {
|
||||
}
|
||||
|
||||
if (!isAccountPasswordCorrect(getPlayerData(client).accountData, hashAccountPassword(getPlayerName(client), password))) {
|
||||
logToConsole(LOG_WARN, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} attempted to login but failed (wrong password). ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining`);
|
||||
logToConsole(LOG_WARN, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} attempted to login but failed (wrong password). ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining`);
|
||||
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||
showPlayerLoginFailedGUI(client, getLocaleString(client, "LoginFailedInvalidPassword", getPlayerData(client).loginAttemptsRemaining));
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login GUI with ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining alert.`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login GUI with ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining alert.`);
|
||||
} else {
|
||||
messagePlayerError(client, getLocaleString(client, "LoginFailedInvalidPassword", getPlayerData(client).loginAttemptsRemaining));
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login message (GUI disabled) with ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining alert.`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login message (GUI disabled) with ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining alert.`);
|
||||
}
|
||||
|
||||
// Disabling email login alerts for now. It hangs the server for a couple seconds. Need a way to thread it.
|
||||
@@ -1147,7 +1147,7 @@ function checkLogin(client, password) {
|
||||
// ===========================================================================
|
||||
|
||||
function checkRegistration(client, password, confirmPassword = "", emailAddress = "") {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account]: Checking registration for ${getPlayerName(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account]: Checking registration for ${getPlayerName(client)}`);
|
||||
|
||||
if (isPlayerRegistered(client)) {
|
||||
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||
@@ -1268,11 +1268,11 @@ function checkRegistration(client, password, confirmPassword = "", emailAddress
|
||||
}, 5000);
|
||||
|
||||
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the error GUI (not a tester).`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the error GUI (not a tester).`);
|
||||
showPlayerErrorGUI(client, getLocaleString(client, "NotATester"), getLocaleString(client, "AccessDenied"));
|
||||
return false;
|
||||
} else {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the "not a tester" error message (GUI disabled).`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the "not a tester" error message (GUI disabled).`);
|
||||
messagePlayerError(client, getLocaleString(client, "NotATester"));
|
||||
return false;
|
||||
}
|
||||
@@ -1421,7 +1421,7 @@ function savePlayerToDatabase(client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account]: Saving client ${getPlayerName(client)} to database ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account]: Saving client ${getPlayerName(client)} to database ...`);
|
||||
saveAccountToDatabase(getPlayerData(client).accountData);
|
||||
|
||||
if (getPlayerData(client).currentSubAccount != -1) {
|
||||
@@ -1443,7 +1443,7 @@ function savePlayerToDatabase(client) {
|
||||
|
||||
saveSubAccountToDatabase(getPlayerCurrentSubAccount(client));
|
||||
}
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account]: Saved client ${getPlayerDisplayForConsole(client)} to database successfully!`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account]: Saved client ${getPlayerDisplayForConsole(client)} to database successfully!`);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1477,7 +1477,7 @@ function createDefaultAccountServerData(accountDatabaseId) {
|
||||
// ===========================================================================
|
||||
|
||||
function loadAccountKeybindsFromDatabase(accountDatabaseID) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account]: Loading account keybinds for account ${accountDatabaseID} from database ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account]: Loading account keybinds for account ${accountDatabaseID} from database ...`);
|
||||
|
||||
let tempAccountKeybinds = [];
|
||||
let dbConnection = connectToDatabase();
|
||||
@@ -1500,21 +1500,21 @@ function loadAccountKeybindsFromDatabase(accountDatabaseID) {
|
||||
for (let i in dbAssoc) {
|
||||
let tempAccountKeyBindData = new KeyBindData(dbAssoc[i]);
|
||||
tempAccountKeybinds.push(tempAccountKeyBindData);
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account]: Account keybind '${tempAccountKeyBindData.databaseId}' (Key ${tempAccountKeyBindData.key} '${toUpperCase(getKeyNameFromId(tempAccountKeyBindData.key))}') loaded from database successfully!`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account]: Account keybind '${tempAccountKeyBindData.databaseId}' (Key ${tempAccountKeyBindData.key} '${toUpperCase(getKeyNameFromId(tempAccountKeyBindData.key))}') loaded from database successfully!`);
|
||||
}
|
||||
}
|
||||
disconnectFromDatabase(dbConnection);
|
||||
}
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account]: ${tempAccountKeybinds.length} account keybinds for account ${accountDatabaseID} loaded from database successfully!`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account]: ${tempAccountKeybinds.length} account keybinds for account ${accountDatabaseID} loaded from database successfully!`);
|
||||
return tempAccountKeybinds;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function loadAccountStaffNotesFromDatabase(accountDatabaseID) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account]: Loading account staff notes for account ${accountDatabaseID} from database ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account]: Loading account staff notes for account ${accountDatabaseID} from database ...`);
|
||||
|
||||
let tempAccountStaffNotes = [];
|
||||
let dbConnection = connectToDatabase();
|
||||
@@ -1527,20 +1527,20 @@ function loadAccountStaffNotesFromDatabase(accountDatabaseID) {
|
||||
for (let i in dbAssoc) {
|
||||
let tempAccountStaffNoteData = new AccountStaffNoteData(dbAssoc[i]);
|
||||
tempAccountStaffNotes.push(tempAccountStaffNoteData);
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account]: Account staff note '${tempAccountStaffNoteData.databaseId}' loaded from database successfully!`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account]: Account staff note '${tempAccountStaffNoteData.databaseId}' loaded from database successfully!`);
|
||||
}
|
||||
}
|
||||
disconnectFromDatabase(dbConnection);
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account]: ${tempAccountStaffNotes.length} account staff notes for account ${accountDatabaseID} loaded from database successfully!`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account]: ${tempAccountStaffNotes.length} account staff notes for account ${accountDatabaseID} loaded from database successfully!`);
|
||||
return tempAccountStaffNotes;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function loadAccountContactsFromDatabase(accountDatabaseID) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account]: Loading account contacts for account ${accountDatabaseID} from database ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account]: Loading account contacts for account ${accountDatabaseID} from database ...`);
|
||||
|
||||
let tempAccountContacts = [];
|
||||
let dbConnection = connectToDatabase();
|
||||
@@ -1553,20 +1553,20 @@ function loadAccountContactsFromDatabase(accountDatabaseID) {
|
||||
for (let i in dbAssoc) {
|
||||
let tempAccountContactData = new AccountContactData(dbAssoc[i]);
|
||||
tempAccountContacts.push(tempAccountContactData);
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account]: Account contact '${tempAccountContactData.databaseId}' loaded from database successfully!`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account]: Account contact '${tempAccountContactData.databaseId}' loaded from database successfully!`);
|
||||
}
|
||||
}
|
||||
disconnectFromDatabase(dbConnection);
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account]: ${tempAccountContacts.length} account contacts for account ${accountDatabaseID} loaded from database successfully!`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account]: ${tempAccountContacts.length} account contacts for account ${accountDatabaseID} loaded from database successfully!`);
|
||||
return tempAccountContacts;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function loadAccountMessagesFromDatabase(accountDatabaseID) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account]: Loading account messages for account ${accountDatabaseID} from database ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account]: Loading account messages for account ${accountDatabaseID} from database ...`);
|
||||
|
||||
let tempAccountMessages = [];
|
||||
let dbConnection = connectToDatabase();
|
||||
@@ -1579,13 +1579,13 @@ function loadAccountMessagesFromDatabase(accountDatabaseID) {
|
||||
for (let i in dbAssoc) {
|
||||
let tempAccountMessageData = new AccountContactData(dbAssoc[i]);
|
||||
tempAccountMessages.push(tempAccountMessageData);
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account]: Account contact '${tempAccountMessageData.databaseId}' loaded from database successfully!`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account]: Account contact '${tempAccountMessageData.databaseId}' loaded from database successfully!`);
|
||||
}
|
||||
}
|
||||
disconnectFromDatabase(dbConnection);
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account]: ${tempAccountMessages.length} account messages for account ${accountDatabaseID} loaded from database successfully!`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account]: ${tempAccountMessages.length} account messages for account ${accountDatabaseID} loaded from database successfully!`);
|
||||
return tempAccountMessages;
|
||||
}
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ function accountBanCommand(command, params, client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_WARN, `[AGRP.Ban]: ${getPlayerDisplayForConsole(targetClient)} (${getPlayerData(targetClient).accountData.name}) account was banned by ${getPlayerDisplayForConsole(client)}. Reason: ${reason}`);
|
||||
logToConsole(LOG_WARN, `[V.RP.Ban]: ${getPlayerDisplayForConsole(targetClient)} (${getPlayerData(targetClient).accountData.name}) account was banned by ${getPlayerDisplayForConsole(client)}. Reason: ${reason}`);
|
||||
|
||||
announceAdminAction(`PlayerAccountBanned`, `{ALTCOLOUR}${getPlayerName(targetClient)}{MAINCOLOUR}`);
|
||||
banAccount(getPlayerData(targetClient).accountData.databaseId, getPlayerData(client).accountData.databaseId, reason);
|
||||
@@ -97,7 +97,7 @@ function subAccountBanCommand(command, params, client, fromDiscord) {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_WARN, `[AGRP.Ban]: ${getPlayerDisplayForConsole(targetClient)} (${getPlayerData(targetClient).accountData.name})'s subaccount was banned by ${getPlayerDisplayForConsole(client)}. Reason: ${reason}`);
|
||||
logToConsole(LOG_WARN, `[V.RP.Ban]: ${getPlayerDisplayForConsole(targetClient)} (${getPlayerData(targetClient).accountData.name})'s subaccount was banned by ${getPlayerDisplayForConsole(client)}. Reason: ${reason}`);
|
||||
|
||||
announceAdminAction(`PlayerCharacterBanned`, `{ALTCOLOUR}${getPlayerName(targetClient)}{MAINCOLOUR}`);
|
||||
banSubAccount(getPlayerData(targetClient).currentSubAccountData.databaseId, getPlayerData(client).accountData.databaseId, reason);
|
||||
|
||||
@@ -227,21 +227,21 @@ function loadBusinessesFromDatabase() {
|
||||
tempBusinessData.locations = loadBusinessLocationsFromDatabase(tempBusinessData.databaseId);
|
||||
//tempBusinessData.gameScripts = loadBusinessGameScriptsFromDatabase(tempBusinessData.databaseId);
|
||||
tempBusinesses.push(tempBusinessData);
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Business]: Business '${tempBusinessData.name}' (ID ${tempBusinessData.databaseId}) loaded from database successfully!`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Business]: Business '${tempBusinessData.name}' (ID ${tempBusinessData.databaseId}) loaded from database successfully!`);
|
||||
}
|
||||
}
|
||||
|
||||
disconnectFromDatabase(dbConnection);
|
||||
}
|
||||
|
||||
logToConsole(LOG_INFO, `[AGRP.Business]: ${tempBusinesses.length} businesses loaded from database successfully!`);
|
||||
logToConsole(LOG_INFO, `[V.RP.Business]: ${tempBusinesses.length} businesses loaded from database successfully!`);
|
||||
return tempBusinesses;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function loadBusinessLocationsFromDatabase(businessId) {
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Business]: Loading business locations for business ${businessId} from database ...`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Business]: Loading business locations for business ${businessId} from database ...`);
|
||||
|
||||
let tempBusinessLocations = [];
|
||||
let dbConnection = connectToDatabase();
|
||||
@@ -255,13 +255,13 @@ function loadBusinessLocationsFromDatabase(businessId) {
|
||||
for (let i in dbAssoc) {
|
||||
let tempBusinessLocationData = new BusinessLocationData(dbAssoc[i]);
|
||||
tempBusinessLocations.push(tempBusinessLocationData);
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Business]: Location '${tempBusinessLocationData.name}' loaded from database successfully!`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Business]: Location '${tempBusinessLocationData.name}' loaded from database successfully!`);
|
||||
}
|
||||
}
|
||||
disconnectFromDatabase(dbConnection);
|
||||
}
|
||||
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Business]: ${tempBusinessLocations.length} location for business ${businessId} loaded from database successfully!`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Business]: ${tempBusinessLocations.length} location for business ${businessId} loaded from database successfully!`);
|
||||
return tempBusinessLocations;
|
||||
}
|
||||
|
||||
@@ -269,7 +269,7 @@ function loadBusinessLocationsFromDatabase(businessId) {
|
||||
|
||||
/*
|
||||
function loadBusinessGameScriptsFromDatabase(businessId) {
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Business]: Loading business game scripts for business ${businessId} from database ...`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Business]: Loading business game scripts for business ${businessId} from database ...`);
|
||||
|
||||
let tempBusinessGameScripts = [];
|
||||
let dbConnection = connectToDatabase();
|
||||
@@ -284,13 +284,13 @@ function loadBusinessGameScriptsFromDatabase(businessId) {
|
||||
for (let i in dbAssoc) {
|
||||
let tempBusinessGameScriptData = new BusinessGameScriptData(dbAssoc[i]);
|
||||
tempBusinessGameScripts.push(tempBusinessGameScriptData);
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Business]: Game script '${tempBusinessGameScriptData.name}' loaded from database successfully!`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Business]: Game script '${tempBusinessGameScriptData.name}' loaded from database successfully!`);
|
||||
}
|
||||
}
|
||||
disconnectFromDatabase(dbConnection);
|
||||
}
|
||||
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Business]: ${tempBusinessGameScripts.length} game scripts for business ${businessId} loaded from database successfully!`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Business]: ${tempBusinessGameScripts.length} game scripts for business ${businessId} loaded from database successfully!`);
|
||||
return tempBusinessGameScripts;
|
||||
}
|
||||
*/
|
||||
@@ -1554,7 +1554,7 @@ function orderItemForBusinessCommand(command, params, client) {
|
||||
let value = getItemTypeData(itemType).orderValue;
|
||||
let businessId = getPlayerBusiness(client);
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Business] ${getPlayerDisplayForConsole(client)} is ordering ${amount} ${splitParams.slice(0, -2).join(" ")}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Business] ${getPlayerDisplayForConsole(client)} is ordering ${amount} ${splitParams.slice(0, -2).join(" ")}`);
|
||||
|
||||
if (!getBusinessData(businessId)) {
|
||||
messagePlayerError(client, getLocaleString(client, "InvalidBusiness"));
|
||||
@@ -1893,7 +1893,7 @@ function saveBusinessToDatabase(businessId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Business]: Saving business '${tempBusinessData.name}' to database ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Business]: Saving business '${tempBusinessData.name}' to database ...`);
|
||||
let dbConnection = connectToDatabase();
|
||||
if (dbConnection) {
|
||||
let safeBusinessName = escapeDatabaseString(dbConnection, tempBusinessData.name);
|
||||
@@ -1949,7 +1949,7 @@ function saveBusinessToDatabase(businessId) {
|
||||
disconnectFromDatabase(dbConnection);
|
||||
return true;
|
||||
}
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Business]: Saved business '${tempBusinessData.name}' to database!`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Business]: Saved business '${tempBusinessData.name}' to database!`);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -2019,7 +2019,7 @@ function createBusinessEntrancePickup(businessId) {
|
||||
// return false;
|
||||
//}
|
||||
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Creating entrance pickup for business ${businessData.name}`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Job]: Creating entrance pickup for business ${businessData.name}`);
|
||||
|
||||
if (areServerElementsSupported() && getGame() != V_GAME_MAFIA_ONE && getGame() != V_GAME_GTA_IV) {
|
||||
let entrancePickup = null;
|
||||
@@ -2096,7 +2096,7 @@ function createBusinessEntranceBlip(businessId) {
|
||||
blipModelId = businessData.entranceBlipModel;
|
||||
}
|
||||
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Creating entrance blip for business ${businessData.name} (model ${blipModelId})`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Job]: Creating entrance blip for business ${businessData.name} (model ${blipModelId})`);
|
||||
|
||||
if (areServerElementsSupported() && getGame() != V_GAME_MAFIA_ONE && getGame() != V_GAME_GTA_IV) {
|
||||
let entranceBlip = createGameBlip(businessData.entrancePosition, blipModelId, 1, getColourByType("businessBlue"));
|
||||
@@ -2148,7 +2148,7 @@ function createBusinessExitPickup(businessId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Creating exit pickup for business ${businessData.name}`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Job]: Creating exit pickup for business ${businessData.name}`);
|
||||
|
||||
let exitPickup = null;
|
||||
if (isGameFeatureSupported("pickup")) {
|
||||
@@ -2220,7 +2220,7 @@ function createBusinessExitBlip(businessId) {
|
||||
blipModelId = businessData.exitBlipModel;
|
||||
}
|
||||
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Creating exit blip for business ${businessData.name} (model ${blipModelId})`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Job]: Creating exit blip for business ${businessData.name} (model ${blipModelId})`);
|
||||
|
||||
let exitBlip = createGameBlip(businessData.exitPosition, blipModelId, 1, getColourByName("businessBlue"));
|
||||
if (exitBlip != null) {
|
||||
@@ -2842,11 +2842,11 @@ function cacheBusinessItems(businessId) {
|
||||
clearArray(getBusinessData(businessId).storageItemCache);
|
||||
|
||||
//let businessData = getBusinessData(businessId);
|
||||
//logToConsole(LOG_VERBOSE, `[AGRP.Business] Caching business items for business ${businessId} (${businessData.name}) ...`);
|
||||
//logToConsole(LOG_VERBOSE, `[V.RP.Business] Caching business items for business ${businessId} (${businessData.name}) ...`);
|
||||
//getBusinessData(businessId).floorItemCache = getServerData().items.filter(item => item.ownerType == V_ITEM_OWNER_BIZFLOOR && item.ownerId == businessData.databaseId).map(i => i.index);
|
||||
//getBusinessData(businessId).storageItemCache = getServerData().items.filter(item => item.ownerType == V_ITEM_OWNER_BIZSTORAGE && item.ownerId == businessData.databaseId);
|
||||
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Business] Caching business items for business ${businessId} (${getBusinessData(businessId).name}) ...`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Business] Caching business items for business ${businessId} (${getBusinessData(businessId).name}) ...`);
|
||||
for (let i in getServerData().items) {
|
||||
if (getItemData(i).ownerType == V_ITEM_OWNER_BIZFLOOR && getItemData(i).ownerId == getBusinessData(businessId).databaseId) {
|
||||
getBusinessData(businessId).floorItemCache.push(i);
|
||||
@@ -2855,7 +2855,7 @@ function cacheBusinessItems(businessId) {
|
||||
}
|
||||
}
|
||||
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Business] Successfully cached ${getBusinessData(businessId).floorItemCache.length} floor items and ${getBusinessData(businessId).storageItemCache} storage items for business ${businessId} (${getBusinessData(businessId).name})!`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Business] Successfully cached ${getBusinessData(businessId).floorItemCache.length} floor items and ${getBusinessData(businessId).storageItemCache} storage items for business ${businessId} (${getBusinessData(businessId).name})!`);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
@@ -132,13 +132,13 @@ function loadClansFromDatabase() {
|
||||
//tempClanData.members = loadClanMembersFromDatabase(tempClanData.databaseId);
|
||||
tempClanData.ranks = loadClanRanksFromDatabase(tempClanData.databaseId);
|
||||
tempClans.push(tempClanData);
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Clan]: Clan '${tempClanData.name}' loaded from database successfully!`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Clan]: Clan '${tempClanData.name}' loaded from database successfully!`);
|
||||
}
|
||||
}
|
||||
disconnectFromDatabase(dbConnection);
|
||||
}
|
||||
|
||||
logToConsole(LOG_INFO, `[AGRP.Clan]: ${tempClans.length} clans loaded from database successfully!`);
|
||||
logToConsole(LOG_INFO, `[V.RP.Clan]: ${tempClans.length} clans loaded from database successfully!`);
|
||||
return tempClans;
|
||||
}
|
||||
|
||||
@@ -158,20 +158,20 @@ function loadClanMembersFromDatabase() {
|
||||
for (let i in dbAssoc) {
|
||||
let tempClanData = new ClanData(dbAssoc[i]);
|
||||
tempClans.push(tempClanData);
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Clan]: Clan '${tempClanData.name}' loaded from database successfully!`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Clan]: Clan '${tempClanData.name}' loaded from database successfully!`);
|
||||
}
|
||||
}
|
||||
disconnectFromDatabase(dbConnection);
|
||||
}
|
||||
|
||||
logToConsole(LOG_INFO, `[AGRP.Clan]: ${tempClans.length} clans loaded from database successfully!`);
|
||||
logToConsole(LOG_INFO, `[V.RP.Clan]: ${tempClans.length} clans loaded from database successfully!`);
|
||||
return tempClans;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function loadClanRanksFromDatabase(clanDatabaseId) {
|
||||
logToConsole(LOG_INFO, `[AGRP.Clan]: Loading ranks for clan ${clanDatabaseId} from database ...`);
|
||||
logToConsole(LOG_INFO, `[V.RP.Clan]: Loading ranks for clan ${clanDatabaseId} from database ...`);
|
||||
|
||||
let dbConnection = connectToDatabase();
|
||||
let dbAssoc = [];
|
||||
@@ -184,13 +184,13 @@ function loadClanRanksFromDatabase(clanDatabaseId) {
|
||||
for (let i in dbAssoc) {
|
||||
let tempClanRankData = new ClanRankData(dbAssoc[i]);
|
||||
tempClanRanks.push(tempClanRankData);
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Clan]: Clan rank '${tempClanRankData.name}' loaded from database successfully!`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Clan]: Clan rank '${tempClanRankData.name}' loaded from database successfully!`);
|
||||
}
|
||||
}
|
||||
disconnectFromDatabase(dbConnection);
|
||||
}
|
||||
|
||||
logToConsole(LOG_INFO, `[AGRP.Clan]: Loaded ranks for clan ${clanDatabaseId} from database successfully!`);
|
||||
logToConsole(LOG_INFO, `[V.RP.Clan]: Loaded ranks for clan ${clanDatabaseId} from database successfully!`);
|
||||
return tempClanRanks;
|
||||
}
|
||||
|
||||
@@ -1285,10 +1285,10 @@ function setClanRankTitle(clanId, rankId, title) {
|
||||
// ===========================================================================
|
||||
|
||||
function saveAllClansToDatabase() {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Clan]: Saving all server clans to database ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Clan]: Saving all server clans to database ...`);
|
||||
|
||||
if (getServerConfig().devServer) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Clan]: Aborting save all clans to database, dev server is enabled.`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Clan]: Aborting save all clans to database, dev server is enabled.`);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1296,7 +1296,7 @@ function saveAllClansToDatabase() {
|
||||
saveClanToDatabase(i);
|
||||
}
|
||||
|
||||
logToConsole(LOG_INFO, `[AGRP.Clan]: Saved all server clans to database`);
|
||||
logToConsole(LOG_INFO, `[V.RP.Clan]: Saved all server clans to database`);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
@@ -162,7 +162,7 @@ function initClientScript() {
|
||||
// ===========================================================================
|
||||
|
||||
function resetClientStuff(client) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Resetting client data for ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Utilities] Resetting client data for ${getPlayerDisplayForConsole(client)}`);
|
||||
|
||||
if (!getPlayerData(client)) {
|
||||
return false;
|
||||
@@ -207,15 +207,15 @@ function kickAllClients() {
|
||||
// ===========================================================================
|
||||
|
||||
function initClient(client) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account] Initializing client ${getPlayerDisplayForConsole(client)} ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account] Initializing client ${getPlayerDisplayForConsole(client)} ...`);
|
||||
|
||||
if (isConsole(client)) {
|
||||
logToConsole(LOG_DEBUG | LOG_ERROR, `[AGRP.Account] Client initialization failed for ${getPlayerDisplayForConsole(client)}! (is console client)`);
|
||||
logToConsole(LOG_DEBUG | LOG_ERROR, `[V.RP.Account] Client initialization failed for ${getPlayerDisplayForConsole(client)}! (is console client)`);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (playerInitialized[client.index] == true) {
|
||||
logToConsole(LOG_DEBUG | LOG_ERROR, `[AGRP.Account] Client initialization failed for ${getPlayerDisplayForConsole(client)}! (already initialized)`);
|
||||
logToConsole(LOG_DEBUG | LOG_ERROR, `[V.RP.Account] Client initialization failed for ${getPlayerDisplayForConsole(client)}! (already initialized)`);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -223,25 +223,25 @@ function initClient(client) {
|
||||
|
||||
//setEntityData(client, "v.rp.isInitialized", true, false);
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account] Initializing GUI for ${getPlayerDisplayForConsole(client)} ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account] Initializing GUI for ${getPlayerDisplayForConsole(client)} ...`);
|
||||
sendPlayerCurrencyString(client);
|
||||
sendPlayerGUIColours(client);
|
||||
sendPlayerGUIInit(client);
|
||||
updatePlayerSnowState(client, getServerConfig().groundSnow);
|
||||
|
||||
//logToConsole(LOG_DEBUG, `[AGRP.Account] Showing connect camera to ${getPlayerDisplayForConsole(client)} ...`);
|
||||
//logToConsole(LOG_DEBUG, `[V.RP.Account] Showing connect camera to ${getPlayerDisplayForConsole(client)} ...`);
|
||||
//showConnectCameraToPlayer(client);
|
||||
|
||||
messageClient(`Please wait ...`, client, getColourByName("softGreen"));
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account] Waiting for 2.5 seconds to prevent race attack ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account] Waiting for 2.5 seconds to prevent race attack ...`);
|
||||
setTimeout(function () {
|
||||
if (client != null) {
|
||||
clearChatBox(client);
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account] Loading account for ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account] Loading account for ${getPlayerDisplayForConsole(client)}`);
|
||||
let tempAccountData = loadAccountFromName(getPlayerName(client), true);
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account] Loading subaccounts for ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account] Loading subaccounts for ${getPlayerDisplayForConsole(client)}`);
|
||||
let tempSubAccounts = loadSubAccountsFromAccount(tempAccountData.databaseId);
|
||||
|
||||
getServerData().clients[getPlayerId(client)] = new ClientData(client, tempAccountData, tempSubAccounts);
|
||||
@@ -258,10 +258,10 @@ function initClient(client) {
|
||||
playRadioStreamForPlayer(client, getServerIntroMusicURL(), true, getPlayerStreamingRadioVolume(client));
|
||||
} else {
|
||||
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login GUI.`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login GUI.`);
|
||||
showPlayerLoginGUI(client);
|
||||
} else {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login message (GUI disabled).`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the login message (GUI disabled).`);
|
||||
messagePlayerNormal(client, getLocaleString(client, "WelcomeBack", getServerName(), getPlayerName(client), "/login"), getColourByName("softGreen"));
|
||||
|
||||
if (checkForGeoIPModule()) {
|
||||
@@ -281,10 +281,10 @@ function initClient(client) {
|
||||
} else {
|
||||
sendPlayerLocaleId(client, 0);
|
||||
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the register GUI.`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the register GUI.`);
|
||||
showPlayerRegistrationGUI(client);
|
||||
} else {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the register message (GUI disabled).`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account] ${getPlayerDisplayForConsole(client)} is being shown the register message (GUI disabled).`);
|
||||
messagePlayerNormal(client, getLocaleString(client, "WelcomeNewPlayer", getServerName(), getPlayerName(client), "/register"), getColourByName("softGreen"));
|
||||
}
|
||||
playRadioStreamForPlayer(client, getServerIntroMusicURL(), true, getPlayerStreamingRadioVolume(client));
|
||||
|
||||
@@ -707,7 +707,7 @@ function addAllCommandHandlers() {
|
||||
let commands = getCommands();
|
||||
for (let i in commands) {
|
||||
for (let j in commands[i]) {
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Command] Adding command handler for ${i} - ${commands[i][j].command}`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Command] Adding command handler for ${i} - ${commands[i][j].command}`);
|
||||
addCommandHandler(commands[i][j].command, processPlayerCommand);
|
||||
commandCount++;
|
||||
}
|
||||
@@ -716,7 +716,7 @@ function addAllCommandHandlers() {
|
||||
removeCommandHandler("help");
|
||||
addCommandHandler("help", helpCommand);
|
||||
|
||||
logToConsole(LOG_INFO, `[AGRP.Command] ${commandCount} command handlers added!`);
|
||||
logToConsole(LOG_INFO, `[V.RP.Command] ${commandCount} command handlers added!`);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -890,7 +890,7 @@ function processPlayerCommand(command, params, client) {
|
||||
}
|
||||
|
||||
if (!doesCommandExist(toLowerCase(command))) {
|
||||
logToConsole(LOG_WARN, `[AGRP.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (invalid command): /${command} ${paramsDisplay}`);
|
||||
logToConsole(LOG_WARN, `[V.RP.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (invalid command): /${command} ${paramsDisplay}`);
|
||||
|
||||
let possibleCommand = getCommandFromParams(command);
|
||||
if (possibleCommand != false && doesPlayerHaveStaffPermission(client, getCommandRequiredPermissions(toLowerCase(possibleCommand.command)))) {
|
||||
@@ -902,7 +902,7 @@ function processPlayerCommand(command, params, client) {
|
||||
}
|
||||
|
||||
if (!commandData.enabled) {
|
||||
logToConsole(LOG_WARN, `[AGRP.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (command is disabled): /${command} ${paramsDisplay}`);
|
||||
logToConsole(LOG_WARN, `[V.RP.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (command is disabled): /${command} ${paramsDisplay}`);
|
||||
messagePlayerError(client, `The command {ALTCOLOUR}/${command}{MAINCOLOUR} is disabled!`);
|
||||
messagePlayerError(client, getLocaleString(client, "CommandDisabled", `{ALTCOLOUR}/${command}{MAINCOLOUR}`));
|
||||
return false;
|
||||
@@ -910,7 +910,7 @@ function processPlayerCommand(command, params, client) {
|
||||
|
||||
if (doesCommandRequireLogin(toLowerCase(command))) {
|
||||
if (!isPlayerLoggedIn(client)) {
|
||||
logToConsole(LOG_WARN, `[AGRP.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (requires login first): /${command} ${paramsDisplay}`);
|
||||
logToConsole(LOG_WARN, `[V.RP.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (requires login first): /${command} ${paramsDisplay}`);
|
||||
messagePlayerError(client, getLocaleString(client, "CommandRequiresLogin", `{ALTCOLOUR}/${command}{MAINCOLOUR}`));
|
||||
return false;
|
||||
}
|
||||
@@ -918,7 +918,7 @@ function processPlayerCommand(command, params, client) {
|
||||
|
||||
if (isClientFromDiscord(client)) {
|
||||
if (!isCommandAllowedOnDiscord(command)) {
|
||||
logToConsole(LOG_WARN, `[AGRP.Command] ${getPlayerDisplayForConsole(client)} attempted to use command from discord, but failed (not available on discord): /${command} ${paramsDisplay}`);
|
||||
logToConsole(LOG_WARN, `[V.RP.Command] ${getPlayerDisplayForConsole(client)} attempted to use command from discord, but failed (not available on discord): /${command} ${paramsDisplay}`);
|
||||
messagePlayerError(client, `The {ALTCOLOUR}/${command}{MAINCOLOUR} command isn't available on discord!`);
|
||||
return false;
|
||||
}
|
||||
@@ -926,13 +926,13 @@ function processPlayerCommand(command, params, client) {
|
||||
|
||||
if (!isConsole(client)) {
|
||||
if (!doesPlayerHaveStaffPermission(client, getCommandRequiredPermissions(toLowerCase(command)))) {
|
||||
logToConsole(LOG_WARN, `[AGRP.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (no permission): /${command} ${paramsDisplay}`);
|
||||
logToConsole(LOG_WARN, `[V.RP.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (no permission): /${command} ${paramsDisplay}`);
|
||||
messagePlayerError(client, getLocaleString(client, "CommandNoPermissions", `{ALTCOLOUR}/${toLowerCase(command)}{MAINCOLOUR}`));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Command] ${getPlayerDisplayForConsole(client)} used command: /${command} ${paramsDisplay}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Command] ${getPlayerDisplayForConsole(client)} used command: /${command} ${paramsDisplay}`);
|
||||
commandData.handlerFunction(toLowerCase(command), params, client);
|
||||
}
|
||||
|
||||
|
||||
@@ -266,49 +266,49 @@ function loadGlobalConfig() {
|
||||
try {
|
||||
getGlobalConfig().database = loadDatabaseConfig();
|
||||
} catch (error) {
|
||||
logToConsole(LOG_ERROR, `[AGRP.Config] Failed to load global configuration. Error: ${error}`);
|
||||
logToConsole(LOG_ERROR, `[V.RP.Config] Failed to load global configuration. Error: ${error}`);
|
||||
thisResource.stop();
|
||||
}
|
||||
|
||||
try {
|
||||
getGlobalConfig().economy = loadEconomyConfig();
|
||||
} catch (error) {
|
||||
logToConsole(LOG_ERROR, `[AGRP.Config] Failed to load economy configuration. Error: ${error}`);
|
||||
logToConsole(LOG_ERROR, `[V.RP.Config] Failed to load economy configuration. Error: ${error}`);
|
||||
thisResource.stop();
|
||||
}
|
||||
|
||||
try {
|
||||
getGlobalConfig().locale = loadLocaleConfig();
|
||||
} catch (error) {
|
||||
logToConsole(LOG_ERROR, `[AGRP.Config] Failed to load locale configuration. Error: ${error}`);
|
||||
logToConsole(LOG_ERROR, `[V.RP.Config] Failed to load locale configuration. Error: ${error}`);
|
||||
thisResource.stop();
|
||||
}
|
||||
|
||||
try {
|
||||
getGlobalConfig().accents = loadAccentConfig();
|
||||
} catch (error) {
|
||||
logToConsole(LOG_ERROR, `[AGRP.Config] Failed to load accent configuration. Error: ${error}`);
|
||||
logToConsole(LOG_ERROR, `[V.RP.Config] Failed to load accent configuration. Error: ${error}`);
|
||||
thisResource.stop();
|
||||
}
|
||||
|
||||
try {
|
||||
getGlobalConfig().discord = loadDiscordConfig();
|
||||
} catch (error) {
|
||||
logToConsole(LOG_ERROR, `[AGRP.Config] Failed to load discord configuration. Error: ${error}`);
|
||||
logToConsole(LOG_ERROR, `[V.RP.Config] Failed to load discord configuration. Error: ${error}`);
|
||||
thisResource.stop();
|
||||
}
|
||||
|
||||
try {
|
||||
getGlobalConfig().keyBind = loadKeyBindConfig();
|
||||
} catch (error) {
|
||||
logToConsole(LOG_ERROR, `[AGRP.Config] Failed to load keybind configuration. Error: ${error}`);
|
||||
logToConsole(LOG_ERROR, `[V.RP.Config] Failed to load keybind configuration. Error: ${error}`);
|
||||
thisResource.stop();
|
||||
}
|
||||
|
||||
try {
|
||||
getGlobalConfig().email = loadEmailConfig();
|
||||
} catch (error) {
|
||||
logToConsole(LOG_ERROR, `[AGRP.Config] Failed to load email configuration. Error: ${error}`);
|
||||
logToConsole(LOG_ERROR, `[V.RP.Config] Failed to load email configuration. Error: ${error}`);
|
||||
thisResource.stop();
|
||||
}
|
||||
|
||||
@@ -379,12 +379,12 @@ function applyConfigToServer(tempServerConfig) {
|
||||
updateServerGameTime();
|
||||
|
||||
//if (isTimeSupported()) {
|
||||
// logToConsole(LOG_DEBUG, `[AGRP.Config]: Setting time to to ${tempServerConfig.hour}:${tempServerConfig.minute} with minute duration of ${tempServerConfig.minuteDuration}`);
|
||||
// logToConsole(LOG_DEBUG, `[V.RP.Config]: Setting time to to ${tempServerConfig.hour}:${tempServerConfig.minute} with minute duration of ${tempServerConfig.minuteDuration}`);
|
||||
// setGameTime(tempServerConfig.hour, tempServerConfig.minute, tempServerConfig.minuteDuration);
|
||||
//}
|
||||
|
||||
if (isWeatherSupported()) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Config]: Setting weather to ${tempServerConfig.weather}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Config]: Setting weather to ${tempServerConfig.weather}`);
|
||||
game.forceWeather(getWeatherData(tempServerConfig.weather).weatherId);
|
||||
}
|
||||
|
||||
@@ -394,7 +394,7 @@ function applyConfigToServer(tempServerConfig) {
|
||||
// ===========================================================================
|
||||
|
||||
function saveServerConfigToDatabase() {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Config]: Saving server ${getServerConfig().databaseId} configuration to database ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Config]: Saving server ${getServerConfig().databaseId} configuration to database ...`);
|
||||
if (getServerConfig().needsSaved) {
|
||||
let dbConnection = connectToDatabase();
|
||||
if (dbConnection) {
|
||||
@@ -458,7 +458,7 @@ function saveServerConfigToDatabase() {
|
||||
|
||||
}
|
||||
}
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Config]: Server ${getServerConfig().databaseId} configuration saved to database!`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Config]: Server ${getServerConfig().databaseId} configuration saved to database!`);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -932,7 +932,7 @@ function reloadEmailConfigurationCommand(command, params, client) {
|
||||
*/
|
||||
function reloadDatabaseConfigurationCommand(command, params, client) {
|
||||
if (getDatabaseConfig().usePersistentConnection && isDatabaseConnected(persistentDatabaseConnection)) {
|
||||
logToConsole(LOG_WARN, `[AGRP.Database] Closing persistent database connection`);
|
||||
logToConsole(LOG_WARN, `[V.RP.Database] Closing persistent database connection`);
|
||||
persistentDatabaseConnection.close();
|
||||
persistentDatabaseConnection = null;
|
||||
}
|
||||
@@ -1132,14 +1132,14 @@ function loadServerConfig() {
|
||||
serverConfig = loadServerConfigFromGame(getGame());
|
||||
|
||||
if (serverConfig == false) {
|
||||
logToConsole(LOG_ERROR, `[AGRP.Config] Could not load server configuration for game ${getGame()}`);
|
||||
logToConsole(LOG_ERROR, `[V.RP.Config] Could not load server configuration for game ${getGame()}`);
|
||||
server.shutdown();
|
||||
}
|
||||
} else {
|
||||
serverConfig = loadServerConfigFromGameAndPort(getGame(), getServerPort());
|
||||
|
||||
if (serverConfig == false) {
|
||||
logToConsole(LOG_ERROR, `[AGRP.Config] Could not load server configuration for game ${getGame()} and port ${getServerPort()}`);
|
||||
logToConsole(LOG_ERROR, `[V.RP.Config] Could not load server configuration for game ${getGame()} and port ${getServerPort()}`);
|
||||
server.shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ function addAllEventHandlers() {
|
||||
// ===========================================================================
|
||||
|
||||
function onPlayerConnect(event, ipAddress, port) {
|
||||
logToConsole(LOG_INFO, `[AGRP.Event] onPlayerConnect - Client connecting (IP: ${ipAddress})`);
|
||||
logToConsole(LOG_INFO, `[V.RP.Event] onPlayerConnect - Client connecting (IP: ${ipAddress})`);
|
||||
//if(isIpAddressBanned(ipAddress)) {
|
||||
// messagePlayerError(client, "You are banned from this server!");
|
||||
// return false;
|
||||
@@ -56,7 +56,7 @@ function onPlayerConnect(event, ipAddress, port) {
|
||||
// ===========================================================================
|
||||
|
||||
function onPlayerJoin(event, client) {
|
||||
logToConsole(LOG_INFO, `[AGRP.Event] onPlayerJoin - Client ${getPlayerDisplayForConsole(client)} joining from ${getPlayerIP(client)}`);
|
||||
logToConsole(LOG_INFO, `[V.RP.Event] onPlayerJoin - Client ${getPlayerDisplayForConsole(client)} joining from ${getPlayerIP(client)}`);
|
||||
|
||||
playerResourceReady[getPlayerId(client)] = false;
|
||||
playerResourceStarted[getPlayerId(client)] = false;
|
||||
@@ -77,7 +77,7 @@ function onPlayerJoin(event, client) {
|
||||
// ===========================================================================
|
||||
|
||||
function onPlayerJoined(event, client) {
|
||||
logToConsole(LOG_INFO, `[AGRP.Event] onPlayerJoined - Client ${getPlayerDisplayForConsole(client)} joined from ${getPlayerIP(client)}`);
|
||||
logToConsole(LOG_INFO, `[V.RP.Event] onPlayerJoined - Client ${getPlayerDisplayForConsole(client)} joined from ${getPlayerIP(client)}`);
|
||||
//initClient(client);
|
||||
}
|
||||
|
||||
@@ -214,7 +214,7 @@ function onPedExitingVehicle(event, ped, vehicle) {
|
||||
// ===========================================================================
|
||||
|
||||
function onResourceStart(event, resource) {
|
||||
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Resource ${resource.name} started!`);
|
||||
logToConsole(LOG_WARN | LOG_DEBUG, `[V.RP.Event] Resource ${resource.name} started!`);
|
||||
|
||||
if (resource == thisResource) {
|
||||
//messageAdmins(`{MAINCOLOUR}Resource {ALTCOLOUR}${resource.name}{MAINCOLOUR} started!`);
|
||||
@@ -225,7 +225,7 @@ function onResourceStart(event, resource) {
|
||||
// ===========================================================================
|
||||
|
||||
function onResourceStop(event, resource) {
|
||||
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Resource ${resource.name} stopped!`);
|
||||
logToConsole(LOG_WARN | LOG_DEBUG, `[V.RP.Event] Resource ${resource.name} stopped!`);
|
||||
|
||||
//if(resource != thisResource) {
|
||||
// messageAdmins(`{MAINCOLOUR}Resource {ALTCOLOUR}${resource.name}{MAINCOLOUR} stopped!`);
|
||||
@@ -252,7 +252,7 @@ function onPedEnteredSphere(event, ped, sphere) {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Ped ${ped.id} entered sphere ${sphere.id}!`);
|
||||
logToConsole(LOG_WARN | LOG_DEBUG, `[V.RP.Event] Ped ${ped.id} entered sphere ${sphere.id}!`);
|
||||
//if (ped.isType(ELEMENT_PLAYER)) {
|
||||
// let client = getClientFromPlayerElement(ped);
|
||||
|
||||
@@ -276,7 +276,7 @@ function onPedExitedSphere(event, ped, sphere) {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Ped ${ped.id} exited sphere ${sphere.id}!`);
|
||||
logToConsole(LOG_WARN | LOG_DEBUG, `[V.RP.Event] Ped ${ped.id} exited sphere ${sphere.id}!`);
|
||||
//if (ped.isType(ELEMENT_PLAYER)) {
|
||||
// let client = getClientFromPlayerElement(ped);
|
||||
//}
|
||||
@@ -293,7 +293,7 @@ function onPedPickupPickedUp(event, ped, pickup) {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Ped ${ped.id} picked up pickup ${pickup.id}!`);
|
||||
logToConsole(LOG_WARN | LOG_DEBUG, `[V.RP.Event] Ped ${ped.id} picked up pickup ${pickup.id}!`);
|
||||
|
||||
if (ped.isType(ELEMENT_PLAYER)) {
|
||||
let client = getClientFromPlayerElement(ped);
|
||||
@@ -310,7 +310,7 @@ function onPedPickupPickedUp(event, ped, pickup) {
|
||||
|
||||
/*
|
||||
function onPedWasted(event, ped, killerPed, weapon, pedPiece) {
|
||||
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Ped ${ped.id} wasted by ped ${killerPed.id}!`);
|
||||
logToConsole(LOG_WARN | LOG_DEBUG, `[V.RP.Event] Ped ${ped.id} wasted by ped ${killerPed.id}!`);
|
||||
|
||||
if (ped.isType(ELEMENT_PLAYER)) {
|
||||
let killerClient = null;
|
||||
@@ -325,7 +325,7 @@ function onPedWasted(event, ped, killerPed, weapon, pedPiece) {
|
||||
// ===========================================================================
|
||||
|
||||
function onPlayerDeath(client, killer, weapon, pedPiece) {
|
||||
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Player ${getPlayerDisplayForConsole(client)} died!`);
|
||||
logToConsole(LOG_WARN | LOG_DEBUG, `[V.RP.Event] Player ${getPlayerDisplayForConsole(client)} died!`);
|
||||
|
||||
logToConsole(LOG_INFO, `${getPlayerDisplayForConsole(client)} died.`);
|
||||
getPlayerData(client).pedState = V_PEDSTATE_DEAD;
|
||||
@@ -418,7 +418,7 @@ function onPlayerDeath(client, killer, weapon, pedPiece) {
|
||||
// ===========================================================================
|
||||
|
||||
function onPedSpawn(ped) {
|
||||
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Ped ${ped.id} spawned!`);
|
||||
logToConsole(LOG_WARN | LOG_DEBUG, `[V.RP.Event] Ped ${ped.id} spawned!`);
|
||||
|
||||
//if (ped.type == ELEMENT_PLAYER) {
|
||||
// if (getGame() != V_GAME_MAFIA_ONE) {
|
||||
@@ -431,14 +431,14 @@ function onPedSpawn(ped) {
|
||||
// ===========================================================================
|
||||
|
||||
async function onPlayerSpawn(client) {
|
||||
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Player ${getPlayerDisplayForConsole(client)} spawned!`);
|
||||
//logToConsole(LOG_DEBUG, `[AGRP.Event] Checking for ${getPlayerDisplayForConsole(client)}'s player ped`);
|
||||
logToConsole(LOG_WARN | LOG_DEBUG, `[V.RP.Event] Player ${getPlayerDisplayForConsole(client)} spawned!`);
|
||||
//logToConsole(LOG_DEBUG, `[V.RP.Event] Checking for ${getPlayerDisplayForConsole(client)}'s player ped`);
|
||||
//if(getPlayerPed(client) == null) {
|
||||
// logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)}'s player element not set yet. Rechecking ...`);
|
||||
// logToConsole(LOG_DEBUG, `[V.RP.Event] ${getPlayerDisplayForConsole(client)}'s player element not set yet. Rechecking ...`);
|
||||
// setTimeout(onPlayerSpawn, 500, client);
|
||||
// return false;
|
||||
//}
|
||||
//logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)}'s player ped is valid. Continuing spawn processing ...`);
|
||||
//logToConsole(LOG_DEBUG, `[V.RP.Event] ${getPlayerDisplayForConsole(client)}'s player ped is valid. Continuing spawn processing ...`);
|
||||
|
||||
if (areServerElementsSupported()) {
|
||||
await waitUntil(() => client != null && getPlayerPed(client) != null);
|
||||
@@ -446,53 +446,53 @@ async function onPlayerSpawn(client) {
|
||||
|
||||
stopRadioStreamForPlayer(client);
|
||||
|
||||
//logToConsole(LOG_DEBUG, `[AGRP.Event] Checking ${getPlayerDisplayForConsole(client)}'s player data`);
|
||||
//logToConsole(LOG_DEBUG, `[V.RP.Event] Checking ${getPlayerDisplayForConsole(client)}'s player data`);
|
||||
if (!getPlayerData(client)) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)}'s player data is invalid. Kicking them from server.`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Event] ${getPlayerDisplayForConsole(client)}'s player data is invalid. Kicking them from server.`);
|
||||
getPlayerData(targetClient).customDisconnectReason = "Desync";
|
||||
disconnectPlayer(client);
|
||||
return false;
|
||||
}
|
||||
|
||||
//logToConsole(LOG_DEBUG, `[AGRP.Event] Checking ${getPlayerDisplayForConsole(client)}'s login status`);
|
||||
//logToConsole(LOG_DEBUG, `[V.RP.Event] Checking ${getPlayerDisplayForConsole(client)}'s login status`);
|
||||
if (!isPlayerLoggedIn(client)) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)} is NOT logged in. Despawning their player.`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Event] ${getPlayerDisplayForConsole(client)} is NOT logged in. Despawning their player.`);
|
||||
getPlayerData(targetClient).customDisconnectReason = "Desync";
|
||||
disconnectPlayer(client);
|
||||
return false;
|
||||
}
|
||||
|
||||
//logToConsole(LOG_DEBUG, `[AGRP.Event] Checking ${getPlayerDisplayForConsole(client)}'s selected character status`);
|
||||
//logToConsole(LOG_DEBUG, `[V.RP.Event] Checking ${getPlayerDisplayForConsole(client)}'s selected character status`);
|
||||
if (getPlayerData(client).currentSubAccount == -1) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)} has NOT selected a character. Despawning their player.`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Event] ${getPlayerDisplayForConsole(client)} has NOT selected a character. Despawning their player.`);
|
||||
getPlayerData(targetClient).customDisconnectReason = "Desync";
|
||||
disconnectPlayer(client);
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)}'s player data is valid. Continuing spawn processing ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Event] ${getPlayerDisplayForConsole(client)}'s player data is valid. Continuing spawn processing ...`);
|
||||
|
||||
if (isGameFeatureSupported("pedScale")) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Event] Setting ${getPlayerDisplayForConsole(client)}'s ped scale (${getPlayerCurrentSubAccount(client).pedScale})`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Event] Setting ${getPlayerDisplayForConsole(client)}'s ped scale (${getPlayerCurrentSubAccount(client).pedScale})`);
|
||||
setEntityData(getPlayerPed(client), "v.rp.scale", getPlayerCurrentSubAccount(client).pedScale, true);
|
||||
}
|
||||
|
||||
//if (isPlayerSwitchingCharacter(client) || isPlayerCreatingCharacter(client)) {
|
||||
// logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)}'s ped is being used for character selection/creation. No further spawn processing needed'`);
|
||||
// logToConsole(LOG_DEBUG, `[V.RP.Event] ${getPlayerDisplayForConsole(client)}'s ped is being used for character selection/creation. No further spawn processing needed'`);
|
||||
// return false;
|
||||
//}
|
||||
|
||||
if (isCustomCameraSupported()) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Event] Restoring ${getPlayerDisplayForConsole(client)}'s camera`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Event] Restoring ${getPlayerDisplayForConsole(client)}'s camera`);
|
||||
restorePlayerCamera(client);
|
||||
}
|
||||
|
||||
if (areServerElementsSupported()) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Event] Storing ${getPlayerDisplayForConsole(client)} ped in client data `);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Event] Storing ${getPlayerDisplayForConsole(client)} ped in client data `);
|
||||
getPlayerData(client).ped = getPlayerPed(client);
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Event] Sending ${getPlayerDisplayForConsole(client)} the 'now playing as' message`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Event] Sending ${getPlayerDisplayForConsole(client)} the 'now playing as' message`);
|
||||
messagePlayerAlert(client, `You are now playing as: {businessBlue}${getCharacterFullName(client)}`, getColourByName("white"));
|
||||
//messagePlayerNormal(client, "This server is in early development and may restart at any time for updates.", getColourByName("orange"));
|
||||
//messagePlayerNormal(client, "Please report any bugs using /bug and suggestions using /idea", getColourByName("yellow"));
|
||||
@@ -506,65 +506,65 @@ async function onPlayerSpawn(client) {
|
||||
//}
|
||||
|
||||
if (isGameFeatureSupported("interior")) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Event] Setting player interior for ${getPlayerDisplayForConsole(client)} to ${getPlayerCurrentSubAccount(client).interior}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Event] Setting player interior for ${getPlayerDisplayForConsole(client)} to ${getPlayerCurrentSubAccount(client).interior}`);
|
||||
setPlayerInterior(client, getPlayerCurrentSubAccount(client).interior);
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Event] Setting player dimension for ${getPlayerDisplayForConsole(client)} to ${getPlayerCurrentSubAccount(client).dimension}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Event] Setting player dimension for ${getPlayerDisplayForConsole(client)} to ${getPlayerCurrentSubAccount(client).dimension}`);
|
||||
setPlayerDimension(client, getPlayerCurrentSubAccount(client).dimension);
|
||||
|
||||
//if(getPlayerCurrentSubAccount(client).interior != 0 || getPlayerCurrentSubAccount(client).dimension != 0) {
|
||||
// updateAllInteriorVehiclesForPlayer(client, getPlayerCurrentSubAccount(client).interior, getPlayerCurrentSubAccount(client).dimension);
|
||||
//}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Event] Setting player health for ${getPlayerDisplayForConsole(client)} to ${getPlayerCurrentSubAccount(client).health}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Event] Setting player health for ${getPlayerDisplayForConsole(client)} to ${getPlayerCurrentSubAccount(client).health}`);
|
||||
setPlayerHealth(client, getPlayerCurrentSubAccount(client).health);
|
||||
|
||||
if (isGameFeatureSupported("pedArmour")) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Event] Setting player armour for ${getPlayerDisplayForConsole(client)} to ${getPlayerCurrentSubAccount(client).armour}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Event] Setting player armour for ${getPlayerDisplayForConsole(client)} to ${getPlayerCurrentSubAccount(client).armour}`);
|
||||
setPlayerArmour(client, getPlayerCurrentSubAccount(client).armour);
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Event] Sending ${getPlayerDisplayForConsole(client)}'s job type to their client (${getJobIndexFromDatabaseId(getPlayerCurrentSubAccount(client))})`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Event] Sending ${getPlayerDisplayForConsole(client)}'s job type to their client (${getJobIndexFromDatabaseId(getPlayerCurrentSubAccount(client))})`);
|
||||
sendPlayerJobType(client, getPlayerCurrentSubAccount(client).job);
|
||||
|
||||
if (isGameFeatureSupported("rendering2D")) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Event] Enabling all rendering states for ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Event] Enabling all rendering states for ${getPlayerDisplayForConsole(client)}`);
|
||||
setPlayer2DRendering(client, true, true, true, true, true, true);
|
||||
}
|
||||
|
||||
//if (isGameFeatureSupported("snow")) {
|
||||
// logToConsole(LOG_DEBUG, `[AGRP.Event] Sending snow states to ${getPlayerDisplayForConsole(client)}`);
|
||||
// logToConsole(LOG_DEBUG, `[V.RP.Event] Sending snow states to ${getPlayerDisplayForConsole(client)}`);
|
||||
// updatePlayerSnowState(client, true);
|
||||
//}
|
||||
|
||||
if (areServerElementsSupported() && isGameFeatureSupported("walkStyle")) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Event] Setting player walking style for ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Event] Setting player walking style for ${getPlayerDisplayForConsole(client)}`);
|
||||
setEntityData(getPlayerPed(client), "v.rp.walkStyle", getPlayerCurrentSubAccount(client).walkStyle, true);
|
||||
}
|
||||
|
||||
if (isGameFeatureSupported("fightStyle")) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Event] Setting player fighting style for ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Event] Setting player fighting style for ${getPlayerDisplayForConsole(client)}`);
|
||||
setPlayerFightStyle(client, getPlayerCurrentSubAccount(client).fightStyle);
|
||||
}
|
||||
|
||||
if (isGameFeatureSupported("rendering2D")) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Event] Updating logo state for ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Event] Updating logo state for ${getPlayerDisplayForConsole(client)}`);
|
||||
updatePlayerShowLogoState(client, (getServerConfig().showLogo && doesPlayerHaveLogoEnabled(client)));
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Event] Caching ${getPlayerDisplayForConsole(client)}'s hotbar items`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Event] Caching ${getPlayerDisplayForConsole(client)}'s hotbar items`);
|
||||
cachePlayerHotBarItems(client);
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Event] Syncing ${getPlayerDisplayForConsole(client)}'s hotbar`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Event] Syncing ${getPlayerDisplayForConsole(client)}'s hotbar`);
|
||||
updatePlayerHotBar(client);
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Event] Setting ${getPlayerDisplayForConsole(client)}'s switchchar state to false`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Event] Setting ${getPlayerDisplayForConsole(client)}'s switchchar state to false`);
|
||||
getPlayerData(client).switchingCharacter = false;
|
||||
|
||||
if (!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand(client, "enter")) {
|
||||
let keyId = getPlayerKeyBindForCommand(client, "enter");
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Event] Sending custom enter property key ID (${keyId.key}, ${toUpperCase(getKeyNameFromId(keyId.key))}) to ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Event] Sending custom enter property key ID (${keyId.key}, ${toUpperCase(getKeyNameFromId(keyId.key))}) to ${getPlayerDisplayForConsole(client)}`);
|
||||
sendPlayerEnterPropertyKey(client, keyId.key);
|
||||
}
|
||||
|
||||
@@ -595,7 +595,7 @@ async function onPlayerSpawn(client) {
|
||||
//sendPlayerPedPartsAndProps(client);
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Event] Setting ${getPlayerDisplayForConsole(client)}'s ped state to ready`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Event] Setting ${getPlayerDisplayForConsole(client)}'s ped state to ready`);
|
||||
getPlayerData(client).pedState = V_PEDSTATE_READY;
|
||||
|
||||
if (areServerElementsSupported()) {
|
||||
@@ -605,16 +605,16 @@ async function onPlayerSpawn(client) {
|
||||
//}, 1000);
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Event] Syncing ${getPlayerDisplayForConsole(client)}'s cash ${getPlayerCurrentSubAccount(client).cash}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Event] Syncing ${getPlayerDisplayForConsole(client)}'s cash ${getPlayerCurrentSubAccount(client).cash}`);
|
||||
updatePlayerCash(client);
|
||||
|
||||
if (isGameFeatureSupported("customNametag")) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Event] Sending player nametag distance to ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Event] Sending player nametag distance to ${getPlayerDisplayForConsole(client)}`);
|
||||
sendNameTagDistanceToClient(client, getServerConfig().nameTagDistance);
|
||||
}
|
||||
|
||||
if (!areServerElementsSupported() || getGame() == V_GAME_MAFIA_ONE || getGame() == V_GAME_GTA_IV) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Event] Sending properties, jobs, and vehicles to ${getPlayerDisplayForConsole(client)} (no server elements)`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Event] Sending properties, jobs, and vehicles to ${getPlayerDisplayForConsole(client)} (no server elements)`);
|
||||
sendAllBusinessesToPlayer(client);
|
||||
sendAllHousesToPlayer(client);
|
||||
if (getGame() != V_GAME_GTA_IV) {
|
||||
@@ -627,7 +627,7 @@ async function onPlayerSpawn(client) {
|
||||
sendAllVehiclesToPlayer(client);
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Event] Updating spawned state for ${getPlayerDisplayForConsole(client)} to true`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Event] Updating spawned state for ${getPlayerDisplayForConsole(client)} to true`);
|
||||
updatePlayerSpawnedState(client, true);
|
||||
|
||||
getPlayerData(client).payDayTickStart = sdl.ticks;
|
||||
@@ -635,7 +635,7 @@ async function onPlayerSpawn(client) {
|
||||
// Locales are handled via resource files now. No need to send anymore, but kept in case revert is needed.
|
||||
//sendPlayerLocaleStrings(client);
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Event] Updating all player name tags`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Event] Updating all player name tags`);
|
||||
updateAllPlayerNameTags();
|
||||
|
||||
setPlayerWeaponDamageEvent(client, V_WEAPON_DAMAGE_EVENT_NORMAL);
|
||||
@@ -692,7 +692,7 @@ async function onPlayerSpawn(client) {
|
||||
// ===========================================================================
|
||||
|
||||
function onPlayerCommand(event, client, command, params) {
|
||||
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Player used command ${command}!`);
|
||||
logToConsole(LOG_WARN | LOG_DEBUG, `[V.RP.Event] Player used command ${command}!`);
|
||||
|
||||
if (!doesCommandExist(command)) {
|
||||
processPlayerCommand(command, params, client);
|
||||
@@ -710,7 +710,7 @@ function onPedExitedVehicle(event, ped, vehicle, seat) {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Ped ${ped.id} exited vehicle ${vehicle.id} from seat ${seat}!`);
|
||||
logToConsole(LOG_WARN | LOG_DEBUG, `[V.RP.Event] Ped ${ped.id} exited vehicle ${vehicle.id} from seat ${seat}!`);
|
||||
|
||||
if (getVehicleData(vehicle) == false) {
|
||||
return false;
|
||||
@@ -743,7 +743,7 @@ function onPedExitedVehicle(event, ped, vehicle, seat) {
|
||||
|
||||
getVehicleData(vehicle).lastActiveTime = getCurrentUnixTimestamp();
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)} exited a ${getVehicleName(vehicle)} (ID: ${vehicle.getData("v.rp.dataSlot")}, Database ID: ${getVehicleData(vehicle).databaseId})`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Event] ${getPlayerDisplayForConsole(client)} exited a ${getVehicleName(vehicle)} (ID: ${vehicle.getData("v.rp.dataSlot")}, Database ID: ${getVehicleData(vehicle).databaseId})`);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -752,31 +752,31 @@ function onPedExitedVehicle(event, ped, vehicle, seat) {
|
||||
|
||||
function onPedEnteredVehicle(event, ped, vehicle, seat) {
|
||||
if (ped == null) {
|
||||
logToConsole(LOG_ERROR | LOG_DEBUG, `[AGRP.Event] Ped ${ped.id} entered vehicle ${vehicle.id} in seat ${seat}, but ped is null`);
|
||||
logToConsole(LOG_ERROR | LOG_DEBUG, `[V.RP.Event] Ped ${ped.id} entered vehicle ${vehicle.id} in seat ${seat}, but ped is null`);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (vehicle == null) {
|
||||
logToConsole(LOG_ERROR | LOG_DEBUG, `[AGRP.Event] Ped ${ped.id} entered vehicle ${vehicle.id} in seat ${seat}, but vehicle is null`);
|
||||
logToConsole(LOG_ERROR | LOG_DEBUG, `[V.RP.Event] Ped ${ped.id} entered vehicle ${vehicle.id} in seat ${seat}, but vehicle is null`);
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Ped ${ped.id} entered vehicle ${vehicle.id} in seat ${seat}!`);
|
||||
logToConsole(LOG_WARN | LOG_DEBUG, `[V.RP.Event] Ped ${ped.id} entered vehicle ${vehicle.id} in seat ${seat}!`);
|
||||
|
||||
if (ped.isType(ELEMENT_PLAYER)) {
|
||||
let client = getClientFromPlayerElement(ped);
|
||||
if (client != null) {
|
||||
if (getPlayerData(client) == false) {
|
||||
logToConsole(LOG_ERROR | LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)} entered vehicle ${vehicle.id} in seat ${seat}, but player data is false`);
|
||||
logToConsole(LOG_ERROR | LOG_DEBUG, `[V.RP.Event] ${getPlayerDisplayForConsole(client)} entered vehicle ${vehicle.id} in seat ${seat}, but player data is false`);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!getVehicleData(vehicle)) {
|
||||
logToConsole(LOG_ERROR | LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)} entered vehicle ${vehicle.id} in seat ${seat}, but vehicle data is false`);
|
||||
logToConsole(LOG_ERROR | LOG_DEBUG, `[V.RP.Event] ${getPlayerDisplayForConsole(client)} entered vehicle ${vehicle.id} in seat ${seat}, but vehicle data is false`);
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)} entered a ${getVehicleName(vehicle)} (ID: ${vehicle.getData("v.rp.dataSlot")}, Database ID: ${getVehicleData(vehicle).databaseId})`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Event] ${getPlayerDisplayForConsole(client)} entered a ${getVehicleName(vehicle)} (ID: ${vehicle.getData("v.rp.dataSlot")}, Database ID: ${getVehicleData(vehicle).databaseId})`);
|
||||
|
||||
getPlayerData(client).lastVehicle = vehicle;
|
||||
getVehicleData(vehicle).lastActiveTime = getCurrentUnixTimestamp();
|
||||
@@ -887,7 +887,7 @@ function onPedEnteringVehicle(event, ped, vehicle, seat) {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Ped ${ped.id} is entering vehicle ${vehicle.id} in seat ${seat}!`);
|
||||
logToConsole(LOG_WARN | LOG_DEBUG, `[V.RP.Event] Ped ${ped.id} is entering vehicle ${vehicle.id} in seat ${seat}!`);
|
||||
|
||||
if (ped.isType(ELEMENT_PLAYER)) {
|
||||
let client = getClientFromPlayerElement(ped);
|
||||
@@ -911,7 +911,7 @@ function onPedExitingVehicle(event, ped, vehicle, seat) {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Ped ${ped.id} is exiting vehicle ${vehicle.id} in seat ${seat}!`);
|
||||
logToConsole(LOG_WARN | LOG_DEBUG, `[V.RP.Event] Ped ${ped.id} is exiting vehicle ${vehicle.id} in seat ${seat}!`);
|
||||
|
||||
if (ped.isType(ELEMENT_PLAYER)) {
|
||||
let client = getClientFromPlayerElement(ped);
|
||||
|
||||
@@ -45,8 +45,8 @@ class GateData {
|
||||
// ===========================================================================
|
||||
|
||||
function initGateScript() {
|
||||
logToConsole(LOG_INFO, `[AGRP.Gate]: Initializing gate script ...`);
|
||||
logToConsole(LOG_INFO, `[AGRP.Gate]: Gate script initialized successfully!`);
|
||||
logToConsole(LOG_INFO, `[V.RP.Gate]: Initializing gate script ...`);
|
||||
logToConsole(LOG_INFO, `[V.RP.Gate]: Gate script initialized successfully!`);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -193,7 +193,7 @@ function saveGateToDatabase(gateId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Gate]: Saving gate ${tempGateData.databaseId} to database ...`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Gate]: Saving gate ${tempGateData.databaseId} to database ...`);
|
||||
let dbConnection = connectToDatabase();
|
||||
if (dbConnection) {
|
||||
let safeGateName = escapeDatabaseString(tempGateData.name);
|
||||
@@ -227,7 +227,7 @@ function saveGateToDatabase(gateId) {
|
||||
disconnectFromDatabase(dbConnection);
|
||||
return true;
|
||||
}
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Gate]: Saved gate ${gateDataId} to database!`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Gate]: Saved gate ${gateDataId} to database!`);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -248,13 +248,13 @@ function loadGatesFromDatabase() {
|
||||
for (let i in dbAssoc) {
|
||||
let tempGateData = new GateData(dbAssoc[i]);
|
||||
tempGates.push(tempGateData);
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Gate]: Gate '${tempGateData.name}' loaded from database successfully!`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Gate]: Gate '${tempGateData.name}' loaded from database successfully!`);
|
||||
}
|
||||
}
|
||||
disconnectFromDatabase(dbConnection);
|
||||
}
|
||||
|
||||
logToConsole(LOG_INFO, `[AGRP.Gate]: ${tempGates.length} gates loaded from database successfully!`);
|
||||
logToConsole(LOG_INFO, `[V.RP.Gate]: ${tempGates.length} gates loaded from database successfully!`);
|
||||
return tempGates;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
// ===========================================================================
|
||||
|
||||
function initHelpScript() {
|
||||
logToConsole(LOG_INFO, `[AGRP.Help]: Initializing help script ...`);
|
||||
logToConsole(LOG_INFO, `[AGRP.Help]: Help script initialized successfully!`);
|
||||
logToConsole(LOG_INFO, `[V.RP.Help]: Initializing help script ...`);
|
||||
logToConsole(LOG_INFO, `[V.RP.Help]: Help script initialized successfully!`);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
@@ -187,12 +187,12 @@ function loadHousesFromDatabase() {
|
||||
for (let i in dbAssoc) {
|
||||
let tempHouseData = new HouseData(dbAssoc[i]);
|
||||
tempHouses.push(tempHouseData);
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.House]: House '${tempHouseData.description}' (ID ${tempHouseData.databaseId}) loaded!`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.House]: House '${tempHouseData.description}' (ID ${tempHouseData.databaseId}) loaded!`);
|
||||
}
|
||||
}
|
||||
disconnectFromDatabase(dbConnection);
|
||||
}
|
||||
logToConsole(LOG_INFO, `[AGRP.House]: ${tempHouses.length} houses loaded from database successfully!`);
|
||||
logToConsole(LOG_INFO, `[V.RP.House]: ${tempHouses.length} houses loaded from database successfully!`);
|
||||
return tempHouses;
|
||||
}
|
||||
|
||||
@@ -877,9 +877,9 @@ function getPlayerHouse(client) {
|
||||
// ===========================================================================
|
||||
|
||||
function saveAllHousesToDatabase() {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.House]: Saving all server houses to database ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.House]: Saving all server houses to database ...`);
|
||||
if (getServerConfig().devServer) {
|
||||
logToConsole(LOG_DEBUG | LOG_WARN, `[AGRP.House]: Aborting save all houses to database, dev server is enabled.`);
|
||||
logToConsole(LOG_DEBUG | LOG_WARN, `[V.RP.House]: Aborting save all houses to database, dev server is enabled.`);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -888,7 +888,7 @@ function saveAllHousesToDatabase() {
|
||||
saveHouseToDatabase(i);
|
||||
}
|
||||
}
|
||||
logToConsole(LOG_INFO, `[AGRP.House]: Saved all server houses to database`);
|
||||
logToConsole(LOG_INFO, `[V.RP.House]: Saved all server houses to database`);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -900,7 +900,7 @@ function saveHouseToDatabase(houseId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.House]: Saving house '${tempHouseData.description}' to database ...`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.House]: Saving house '${tempHouseData.description}' to database ...`);
|
||||
let dbConnection = connectToDatabase();
|
||||
if (dbConnection) {
|
||||
let safeHouseDescription = escapeDatabaseString(dbConnection, tempHouseData.description);
|
||||
@@ -954,7 +954,7 @@ function saveHouseToDatabase(houseId) {
|
||||
disconnectFromDatabase(dbConnection);
|
||||
return true;
|
||||
}
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.House]: Saved house '${tempHouseData.description}' to database!`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.House]: Saved house '${tempHouseData.description}' to database!`);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -968,7 +968,7 @@ function saveHouseLocationToDatabase(houseId, locationId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.House]: Saving house location ${locationId} for house ${houseId} to database ...`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.House]: Saving house location ${locationId} for house ${houseId} to database ...`);
|
||||
let dbConnection = connectToDatabase();
|
||||
if (dbConnection) {
|
||||
let data = [
|
||||
@@ -1009,7 +1009,7 @@ function saveHouseLocationToDatabase(houseId, locationId) {
|
||||
disconnectFromDatabase(dbConnection);
|
||||
return true;
|
||||
}
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.House]: Saved location ${locationId} for house ${houseId} to database`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.House]: Saved location ${locationId} for house ${houseId} to database`);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -288,7 +288,7 @@ function initItemScript() {
|
||||
// ===========================================================================
|
||||
|
||||
function loadItemsFromDatabase() {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Item]: Loading items from database ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Item]: Loading items from database ...`);
|
||||
let tempItems = [];
|
||||
let dbConnection = connectToDatabase();
|
||||
let dbAssoc = [];
|
||||
@@ -299,19 +299,19 @@ function loadItemsFromDatabase() {
|
||||
for (let i in dbAssoc) {
|
||||
let tempItemData = new ItemData(dbAssoc[i]);
|
||||
tempItems.push(tempItemData);
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Item]: Loaded item ${tempItemData.databaseId} (type ${tempItemData.itemType})} from database`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Item]: Loaded item ${tempItemData.databaseId} (type ${tempItemData.itemType})} from database`);
|
||||
}
|
||||
}
|
||||
disconnectFromDatabase(dbConnection);
|
||||
}
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Item]: Loaded ${tempItems.length} items from database ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Item]: Loaded ${tempItems.length} items from database ...`);
|
||||
return tempItems;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function loadItemTypesFromDatabase() {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Item]: Loading item types from database ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Item]: Loading item types from database ...`);
|
||||
let tempItemTypes = [];
|
||||
let dbConnection = connectToDatabase();
|
||||
let dbAssoc = [];
|
||||
@@ -323,13 +323,13 @@ function loadItemTypesFromDatabase() {
|
||||
for (let i in dbAssoc) {
|
||||
let tempItemTypeData = new ItemTypeData(dbAssoc[i]);
|
||||
tempItemTypes.push(tempItemTypeData);
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Item]: Loaded item type ${tempItemTypeData.name} (id ${tempItemTypeData.databaseId}} from database`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Item]: Loaded item type ${tempItemTypeData.name} (id ${tempItemTypeData.databaseId}} from database`);
|
||||
}
|
||||
}
|
||||
disconnectFromDatabase(dbConnection);
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Item]: Loaded ${tempItemTypes.length} item types from database ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Item]: Loaded ${tempItemTypes.length} item types from database ...`);
|
||||
return tempItemTypes;
|
||||
}
|
||||
|
||||
@@ -1352,7 +1352,7 @@ function playerUseItem(client, hotBarSlot) {
|
||||
let itemIndex = getPlayerData(client).hotBarItems[hotBarSlot];
|
||||
|
||||
if (itemIndex == -1) {
|
||||
logToConsole(LOG_DEBUG | LOG_WARN, `[AGRP.Item] ${getPlayerDisplayForConsole(client)} tried to use an empty hotbar slot ${hotBarSlot}`);
|
||||
logToConsole(LOG_DEBUG | LOG_WARN, `[V.RP.Item] ${getPlayerDisplayForConsole(client)} tried to use an empty hotbar slot ${hotBarSlot}`);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1366,7 +1366,7 @@ function playerUseItem(client, hotBarSlot) {
|
||||
let itemTypeData = getItemTypeData(itemData.itemTypeIndex);
|
||||
let hotBarItems = getPlayerData(client).hotBarItems;
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Item] ${getPlayerDisplayForConsole(client)} used a ${itemTypeData.name} (use type ${itemTypeData.useType} - ${typeof itemTypeData.useType}) item (ID: ${itemData.index}/${itemData.databaseId}, TypeID: ${itemTypeData.index}/${itemTypeData.databaseId})`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Item] ${getPlayerDisplayForConsole(client)} used a ${itemTypeData.name} (use type ${itemTypeData.useType} - ${typeof itemTypeData.useType}) item (ID: ${itemData.index}/${itemData.databaseId}, TypeID: ${itemTypeData.index}/${itemTypeData.databaseId})`);
|
||||
|
||||
markPlayerActionTipSeen(client, "UseItemKeyAfterEquipping");
|
||||
|
||||
@@ -1909,7 +1909,7 @@ function playerSwitchItem(client, newHotBarSlot) {
|
||||
}
|
||||
|
||||
let currentHotBarSlot = getPlayerData(client).activeHotBarSlot;
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Item] ${getPlayerDisplayForConsole(client)} switched from hotbar slot ${currentHotBarSlot} to ${newHotBarSlot}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Item] ${getPlayerDisplayForConsole(client)} switched from hotbar slot ${currentHotBarSlot} to ${newHotBarSlot}`);
|
||||
|
||||
let currentHotBarItem = -1;
|
||||
let newHotBarItem = -1;
|
||||
@@ -2564,7 +2564,7 @@ function saveItemToDatabase(itemId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Item]: Saving item '${itemData.index}' to database ...`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Item]: Saving item '${itemData.index}' to database ...`);
|
||||
|
||||
let position = getItemPosition(itemId);
|
||||
|
||||
@@ -2621,7 +2621,7 @@ function saveItemTypeToDatabase(itemTypeId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Item]: Saving item type '${itemTypeData.name}' to database ...`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Item]: Saving item type '${itemTypeData.name}' to database ...`);
|
||||
|
||||
let dbConnection = connectToDatabase();
|
||||
if (dbConnection) {
|
||||
@@ -2753,7 +2753,7 @@ function getItemTypeIndexFromDatabaseId(databaseId) {
|
||||
// ===========================================================================
|
||||
|
||||
function playerItemActionDelayComplete(client) {
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Item]: Player ${getPlayerDisplayForConsole(client)} item action delay complete (State: ${getPlayerData(client).itemActionState})`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Item]: Player ${getPlayerDisplayForConsole(client)} item action delay complete (State: ${getPlayerData(client).itemActionState})`);
|
||||
switch (getPlayerData(client).itemActionState) {
|
||||
case V_ITEM_ACTION_USE:
|
||||
playerUseItem(client, getPlayerData(client).itemActionItem);
|
||||
|
||||
@@ -554,13 +554,13 @@ function loadJobsFromDatabase() {
|
||||
tempJobData.routes = loadJobRoutesFromDatabase(tempJobData.databaseId);
|
||||
tempJobData.ranks = loadJobRanksFromDatabase(tempJobData.databaseId);
|
||||
tempJobs.push(tempJobData);
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Job '${tempJobData.name}' loaded from database successfully!`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Job]: Job '${tempJobData.name}' loaded from database successfully!`);
|
||||
}
|
||||
}
|
||||
disconnectFromDatabase(dbConnection);
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: ${tempJobs.length} jobs loaded from database successfully!`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: ${tempJobs.length} jobs loaded from database successfully!`);
|
||||
return tempJobs;
|
||||
}
|
||||
|
||||
@@ -599,7 +599,7 @@ function loadAllJobLocationsFromDatabase() {
|
||||
// ===========================================================================
|
||||
|
||||
function loadJobRanksFromDatabase(jobDatabaseId) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: Loading ranks for job ${jobDatabaseId} from database ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: Loading ranks for job ${jobDatabaseId} from database ...`);
|
||||
|
||||
let tempJobRanks = [];
|
||||
let dbConnection = connectToDatabase();
|
||||
@@ -612,20 +612,20 @@ function loadJobRanksFromDatabase(jobDatabaseId) {
|
||||
for (let i in dbAssoc) {
|
||||
let tempJobRankData = new JobRankData(dbAssoc[i]);
|
||||
tempJobRanks.push(tempJobRankData);
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Job rank '${tempJobRankData.name}' loaded from database successfully!`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Job]: Job rank '${tempJobRankData.name}' loaded from database successfully!`);
|
||||
}
|
||||
}
|
||||
disconnectFromDatabase(dbConnection);
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: ${tempJobRanks.length} ranks for job ${jobDatabaseId} loaded from database successfully!`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: ${tempJobRanks.length} ranks for job ${jobDatabaseId} loaded from database successfully!`);
|
||||
return tempJobRanks;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function loadJobRoutesFromDatabase(jobDatabaseId) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: Loading job routes for job ${jobDatabaseId} from database ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: Loading job routes for job ${jobDatabaseId} from database ...`);
|
||||
|
||||
let tempJobRoutes = [];
|
||||
let dbConnection = connectToDatabase();
|
||||
@@ -639,20 +639,20 @@ function loadJobRoutesFromDatabase(jobDatabaseId) {
|
||||
let tempJobRouteData = new JobRouteData(dbAssoc[i]);
|
||||
tempJobRouteData.locations = loadJobRouteLocationsFromDatabase(tempJobRouteData.databaseId);
|
||||
tempJobRoutes.push(tempJobRouteData);
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Job route '${tempJobRouteData.name}' loaded from database successfully!`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Job]: Job route '${tempJobRouteData.name}' loaded from database successfully!`);
|
||||
}
|
||||
}
|
||||
disconnectFromDatabase(dbConnection);
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: ${tempJobRoutes.length} job routes for job ${jobDatabaseId} loaded from database successfully!`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: ${tempJobRoutes.length} job routes for job ${jobDatabaseId} loaded from database successfully!`);
|
||||
return tempJobRoutes;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function loadJobRouteLocationsFromDatabase(jobRouteId) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: Loading locations for job route ${jobRouteId} from database ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: Loading locations for job route ${jobRouteId} from database ...`);
|
||||
|
||||
let tempJobRouteLocations = [];
|
||||
let dbConnection = connectToDatabase();
|
||||
@@ -665,20 +665,20 @@ function loadJobRouteLocationsFromDatabase(jobRouteId) {
|
||||
for (let i in dbAssoc) {
|
||||
let tempJobRouteLocationData = new JobRouteLocationData(dbAssoc[i]);
|
||||
tempJobRouteLocations.push(tempJobRouteLocationData);
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Job route location '${tempJobRouteLocationData.databaseId}' loaded from database successfully!`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Job]: Job route location '${tempJobRouteLocationData.databaseId}' loaded from database successfully!`);
|
||||
}
|
||||
}
|
||||
disconnectFromDatabase(dbConnection);
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: ${tempJobRouteLocations.length} locations for job route ${jobRouteId} loaded from database successfully!`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: ${tempJobRouteLocations.length} locations for job route ${jobRouteId} loaded from database successfully!`);
|
||||
return tempJobRouteLocations;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function loadJobEquipmentsFromDatabase(jobDatabaseId) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: Loading job equipments for job ${jobDatabaseId} from database ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: Loading job equipments for job ${jobDatabaseId} from database ...`);
|
||||
|
||||
let tempJobEquipments = [];
|
||||
let dbConnection = connectToDatabase();
|
||||
@@ -692,20 +692,20 @@ function loadJobEquipmentsFromDatabase(jobDatabaseId) {
|
||||
let tempJobEquipmentData = new JobEquipmentData(dbAssoc[i]);
|
||||
tempJobEquipmentData.items = loadJobEquipmentItemsFromDatabase(tempJobEquipmentData.databaseId);
|
||||
tempJobEquipments.push(tempJobEquipmentData);
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Job equipment '${tempJobEquipmentData.name}' loaded from database successfully!`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Job]: Job equipment '${tempJobEquipmentData.name}' loaded from database successfully!`);
|
||||
}
|
||||
}
|
||||
disconnectFromDatabase(dbConnection);
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: ${tempJobEquipments.length} job equipments for job ${jobDatabaseId} loaded from database successfully!`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: ${tempJobEquipments.length} job equipments for job ${jobDatabaseId} loaded from database successfully!`);
|
||||
return tempJobEquipments;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function loadJobLocationsFromDatabase(jobDatabaseId) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: Loading job locations for job ${jobDatabaseId} from database ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: Loading job locations for job ${jobDatabaseId} from database ...`);
|
||||
|
||||
let tempJobLocations = [];
|
||||
let dbConnection = connectToDatabase();
|
||||
@@ -718,20 +718,20 @@ function loadJobLocationsFromDatabase(jobDatabaseId) {
|
||||
for (let i in dbAssoc) {
|
||||
let tempJobLocationData = new JobLocationData(dbAssoc[i]);
|
||||
tempJobLocations.push(tempJobLocationData);
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Job location '${tempJobLocationData.databaseId}' loaded from database successfully!`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Job]: Job location '${tempJobLocationData.databaseId}' loaded from database successfully!`);
|
||||
}
|
||||
}
|
||||
disconnectFromDatabase(dbConnection);
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: ${tempJobLocations.length} job locations for job ${jobDatabaseId} loaded from database successfully!`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: ${tempJobLocations.length} job locations for job ${jobDatabaseId} loaded from database successfully!`);
|
||||
return tempJobLocations;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function loadJobUniformsFromDatabase(jobDatabaseId) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: Loading job uniforms for job ${jobDatabaseId} from database ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: Loading job uniforms for job ${jobDatabaseId} from database ...`);
|
||||
|
||||
let tempJobUniforms = [];
|
||||
let dbConnection = connectToDatabase();
|
||||
@@ -744,20 +744,20 @@ function loadJobUniformsFromDatabase(jobDatabaseId) {
|
||||
for (let i in dbAssoc) {
|
||||
let tempJobUniformData = new JobUniformData(dbAssoc[i]);
|
||||
tempJobUniforms.push(tempJobUniformData);
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Job uniform '${tempJobUniformData.databaseId}' loaded from database successfully!`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Job]: Job uniform '${tempJobUniformData.databaseId}' loaded from database successfully!`);
|
||||
}
|
||||
}
|
||||
disconnectFromDatabase(dbConnection);
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: ${tempJobUniforms.length} job uniforms for job ${jobDatabaseId} loaded from database successfully!`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: ${tempJobUniforms.length} job uniforms for job ${jobDatabaseId} loaded from database successfully!`);
|
||||
return tempJobUniforms;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function loadJobEquipmentItemsFromDatabase(jobEquipmentDatabaseId) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: Loading job equipment items for job equipment ${jobEquipmentDatabaseId} from database ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: Loading job equipment items for job equipment ${jobEquipmentDatabaseId} from database ...`);
|
||||
|
||||
let tempJobEquipmentItems = [];
|
||||
let dbConnection = connectToDatabase();
|
||||
@@ -770,13 +770,13 @@ function loadJobEquipmentItemsFromDatabase(jobEquipmentDatabaseId) {
|
||||
for (let i in dbAssoc) {
|
||||
let tempJobEquipmentItemData = new JobEquipmentItemData(dbAssoc[i]);
|
||||
tempJobEquipmentItems.push(tempJobEquipmentItemData);
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Job equipment item '${tempJobEquipmentItemData.databaseId}' loaded from database successfully!`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Job]: Job equipment item '${tempJobEquipmentItemData.databaseId}' loaded from database successfully!`);
|
||||
}
|
||||
}
|
||||
disconnectFromDatabase(dbConnection);
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: ${tempJobEquipmentItems.length} job equipment items for equipment ${jobEquipmentDatabaseId} loaded from database successfully!`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: ${tempJobEquipmentItems.length} job equipment items for equipment ${jobEquipmentDatabaseId} loaded from database successfully!`);
|
||||
return tempJobEquipmentItems;
|
||||
}
|
||||
|
||||
@@ -787,13 +787,13 @@ function createAllJobBlips() {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job] Spawning all job location blips ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job] Spawning all job location blips ...`);
|
||||
for (let i in getServerData().jobs) {
|
||||
for (let j in getServerData().jobs[i].locations) {
|
||||
createJobLocationBlip(i, j);
|
||||
}
|
||||
}
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job] All job location blips spawned!`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job] All job location blips spawned!`);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -803,7 +803,7 @@ function createAllJobPickups() {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job] Spawning all job location pickups ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job] Spawning all job location pickups ...`);
|
||||
let pickupCount = 0;
|
||||
for (let i in getServerData().jobs) {
|
||||
if (getServerData().jobs[i].pickupModel != 0) {
|
||||
@@ -819,11 +819,11 @@ function createAllJobPickups() {
|
||||
setElementDimension(getServerData().jobs[i].locations[j].pickup, getServerData().jobs[i].locations[j].dimension);
|
||||
addToWorld(getServerData().jobs[i].locations[j].pickup);
|
||||
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Job] Job '${getServerData().jobs[i].name}' location pickup ${j} spawned!`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Job] Job '${getServerData().jobs[i].name}' location pickup ${j} spawned!`);
|
||||
}
|
||||
}
|
||||
}
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job] All job location pickups (${pickupCount}) spawned!`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job] All job location pickups (${pickupCount}) spawned!`);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -2720,11 +2720,11 @@ function saveJobToDatabase(jobData) {
|
||||
}
|
||||
|
||||
if (jobData.needsSaved == false) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: Job ${jobData.name} doesn't need saved. Skipping ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: Job ${jobData.name} doesn't need saved. Skipping ...`);
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: Saving job ${jobData.name} to database ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: Saving job ${jobData.name} to database ...`);
|
||||
let dbConnection = connectToDatabase();
|
||||
if (dbConnection) {
|
||||
let safeName = escapeDatabaseString(dbConnection, jobData.name);
|
||||
@@ -2761,7 +2761,7 @@ function saveJobToDatabase(jobData) {
|
||||
disconnectFromDatabase(dbConnection);
|
||||
return true;
|
||||
}
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: Saved job ${jobData.name} to database!`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: Saved job ${jobData.name} to database!`);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -2775,11 +2775,11 @@ function saveJobRankToDatabase(jobRankData) {
|
||||
}
|
||||
|
||||
if (jobRankData.needsSaved == false) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: Job route ${jobRankData.name} (DB ID ${jobRankData.databaseId}) doesn't need saved. Skipping ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: Job route ${jobRankData.name} (DB ID ${jobRankData.databaseId}) doesn't need saved. Skipping ...`);
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: Saving job route ${jobRankData.name} to database ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: Saving job route ${jobRankData.name} to database ...`);
|
||||
let dbConnection = connectToDatabase();
|
||||
if (dbConnection) {
|
||||
let safeName = escapeDatabaseString(dbConnection, jobRankData.name);
|
||||
@@ -2810,7 +2810,7 @@ function saveJobRankToDatabase(jobRankData) {
|
||||
disconnectFromDatabase(dbConnection);
|
||||
return true;
|
||||
}
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: Saved job rank ${jobRankData.name} to database!`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: Saved job rank ${jobRankData.name} to database!`);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -2824,11 +2824,11 @@ function saveJobRouteToDatabase(jobRouteData) {
|
||||
}
|
||||
|
||||
if (jobRouteData.needsSaved == false) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: Job route ${jobRouteData.name} (DB ID ${jobRouteData.databaseId}) doesn't need saved. Skipping ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: Job route ${jobRouteData.name} (DB ID ${jobRouteData.databaseId}) doesn't need saved. Skipping ...`);
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: Saving job route ${jobRouteData.name} to database ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: Saving job route ${jobRouteData.name} to database ...`);
|
||||
let dbConnection = connectToDatabase();
|
||||
if (dbConnection) {
|
||||
let safeName = escapeDatabaseString(dbConnection, jobRouteData.name);
|
||||
@@ -2869,7 +2869,7 @@ function saveJobRouteToDatabase(jobRouteData) {
|
||||
disconnectFromDatabase(dbConnection);
|
||||
return true;
|
||||
}
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: Saved job route ${jobRouteData.name} to database!`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: Saved job route ${jobRouteData.name} to database!`);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -2883,11 +2883,11 @@ function saveJobRouteLocationToDatabase(jobRouteLocationData) {
|
||||
}
|
||||
|
||||
if (jobRouteLocationData.needsSaved == false) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: Job route location ${jobRouteLocationData.name} (DB ID ${jobRouteLocationData.databaseId}) doesn't need saved. Skipping ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: Job route location ${jobRouteLocationData.name} (DB ID ${jobRouteLocationData.databaseId}) doesn't need saved. Skipping ...`);
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: Saving job route location ${jobRouteLocationData.name} to database ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: Saving job route location ${jobRouteLocationData.name} to database ...`);
|
||||
let dbConnection = connectToDatabase();
|
||||
if (dbConnection) {
|
||||
let safeName = escapeDatabaseString(dbConnection, jobRouteLocationData.name);
|
||||
@@ -2919,7 +2919,7 @@ function saveJobRouteLocationToDatabase(jobRouteLocationData) {
|
||||
disconnectFromDatabase(dbConnection);
|
||||
return true;
|
||||
}
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: Saved job route location ${jobRoutePositionData.name} (${jobRouteLocationData.databaseId}) to database!`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: Saved job route location ${jobRoutePositionData.name} (${jobRouteLocationData.databaseId}) to database!`);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -2933,11 +2933,11 @@ function saveJobLocationToDatabase(jobLocationData) {
|
||||
}
|
||||
|
||||
if (!jobLocationData.needsSaved) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: Job location ${jobLocationData.name} (${jobLocationData.databaseId}) doesn't need saved. Skipping ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: Job location ${jobLocationData.name} (${jobLocationData.databaseId}) doesn't need saved. Skipping ...`);
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: Saving job location ${jobLocationData.databaseId} to database ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: Saving job location ${jobLocationData.databaseId} to database ...`);
|
||||
let dbConnection = connectToDatabase();
|
||||
if (dbConnection) {
|
||||
let data = [
|
||||
@@ -2968,7 +2968,7 @@ function saveJobLocationToDatabase(jobLocationData) {
|
||||
return true;
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: Saved job location ${jobLocationData.databaseId} to database`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: Saved job location ${jobLocationData.databaseId} to database`);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -2982,11 +2982,11 @@ function saveJobEquipmentToDatabase(jobEquipmentData) {
|
||||
}
|
||||
|
||||
if (!jobEquipmentData.needsSaved) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: Job equipment ${jobEquipmentData.name} (${jobEquipmentData.databaseId}) doesn't need saved. Skipping ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: Job equipment ${jobEquipmentData.name} (${jobEquipmentData.databaseId}) doesn't need saved. Skipping ...`);
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: Saving job equipment ${jobEquipmentData.databaseId} to database ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: Saving job equipment ${jobEquipmentData.databaseId} to database ...`);
|
||||
let dbConnection = connectToDatabase();
|
||||
if (dbConnection) {
|
||||
let safeName = escapeDatabaseString(dbConnection, jobEquipmentData.name);
|
||||
@@ -3014,7 +3014,7 @@ function saveJobEquipmentToDatabase(jobEquipmentData) {
|
||||
disconnectFromDatabase(dbConnection);
|
||||
return true;
|
||||
}
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: Saved job equipment ${jobEquipmentData.databaseId} to database`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: Saved job equipment ${jobEquipmentData.databaseId} to database`);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -3028,11 +3028,11 @@ function saveJobEquipmentItemToDatabase(jobEquipmentItemData) {
|
||||
}
|
||||
|
||||
if (!jobEquipmentItemData.needsSaved) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: Job equipment item ${jobEquipmentItemData.databaseId} doesn't need saved. Skipping ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: Job equipment item ${jobEquipmentItemData.databaseId} doesn't need saved. Skipping ...`);
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: Saving job equipment weapon ${jobEquipmentItemData.databaseId} to database ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: Saving job equipment weapon ${jobEquipmentItemData.databaseId} to database ...`);
|
||||
let dbConnection = connectToDatabase();
|
||||
if (dbConnection) {
|
||||
let data = [
|
||||
@@ -3059,7 +3059,7 @@ function saveJobEquipmentItemToDatabase(jobEquipmentItemData) {
|
||||
disconnectFromDatabase(dbConnection);
|
||||
return true;
|
||||
}
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: Saved job equipment weapon ${jobEquipmentItemData.databaseId} to database`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: Saved job equipment weapon ${jobEquipmentItemData.databaseId} to database`);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -3073,11 +3073,11 @@ function saveJobUniformToDatabase(jobUniformData) {
|
||||
}
|
||||
|
||||
if (!jobUniformData.needSaved) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: Job uniform ${jobUniformData.databaseId} doesn't need saved. Skipping ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: Job uniform ${jobUniformData.databaseId} doesn't need saved. Skipping ...`);
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: Saving job uniform ${jobUniformData.databaseId} to database ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: Saving job uniform ${jobUniformData.databaseId} to database ...`);
|
||||
let dbConnection = connectToDatabase();
|
||||
if (dbConnection) {
|
||||
let safeName = escapeDatabaseString(dbConnection, jobUniformData.name);
|
||||
@@ -3106,7 +3106,7 @@ function saveJobUniformToDatabase(jobUniformData) {
|
||||
disconnectFromDatabase(dbConnection);
|
||||
return true;
|
||||
}
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Job]: Saved job uniform ${jobUniformData.databaseId} to database`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Job]: Saved job uniform ${jobUniformData.databaseId} to database`);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -3174,7 +3174,7 @@ function createJobLocationPickup(jobId, locationId) {
|
||||
|
||||
let tempJobData = getJobData(jobId);
|
||||
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Creating pickup for location ${locationId} of the ${tempJobData.name} job`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Job]: Creating pickup for location ${locationId} of the ${tempJobData.name} job`);
|
||||
|
||||
if (tempJobData.pickupModel != -1) {
|
||||
let pickupModelId = -1;
|
||||
|
||||
@@ -116,7 +116,7 @@ function addPlayerKeyBind(client, keyId, command, params, tempKey = false) {
|
||||
|
||||
if (!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand(client, "enter")) {
|
||||
let keyId = getPlayerKeyBindForCommand(client, "enter");
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Event] Sending custom enter property key ID (${keyId.key}, ${toUpperCase(getKeyNameFromId(keyId.key))}) to ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Event] Sending custom enter property key ID (${keyId.key}, ${toUpperCase(getKeyNameFromId(keyId.key))}) to ${getPlayerDisplayForConsole(client)}`);
|
||||
sendPlayerEnterPropertyKey(client, keyId.key);
|
||||
} else {
|
||||
sendPlayerEnterPropertyKey(client, false);
|
||||
@@ -140,7 +140,7 @@ function removePlayerKeyBind(client, keyId) {
|
||||
|
||||
if (!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand(client, "enter")) {
|
||||
let keyId = getPlayerKeyBindForCommand(client, "enter");
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Event] Sending custom enter property key ID (${keyId.key}, ${toUpperCase(getKeyNameFromId(keyId.key))}) to ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Event] Sending custom enter property key ID (${keyId.key}, ${toUpperCase(getKeyNameFromId(keyId.key))}) to ${getPlayerDisplayForConsole(client)}`);
|
||||
sendPlayerEnterPropertyKey(client, keyId.key);
|
||||
} else {
|
||||
sendPlayerEnterPropertyKey(client, false);
|
||||
@@ -208,7 +208,7 @@ function playerUsedKeyBind(client, key, duration = 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.KeyBind] ${getPlayerDisplayForConsole(client)} used keybind ${toUpperCase(getKeyNameFromId(key))} (${key})`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.KeyBind] ${getPlayerDisplayForConsole(client)} used keybind ${toUpperCase(getKeyNameFromId(key))} (${key})`);
|
||||
if (!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForKey(client, key)) {
|
||||
let keyBindData = getPlayerKeyBindForKey(client, key);
|
||||
if (keyBindData.enabled) {
|
||||
|
||||
@@ -40,7 +40,7 @@ function getLocaleString(client, stringName, ...args) {
|
||||
|
||||
let tempString = getRawLocaleString(getPlayerData(client).locale, stringName);
|
||||
if (tempString == "" || tempString == null || typeof tempString == "undefined") {
|
||||
logToConsole(LOG_WARN, `[AGRP.Locale] Locale string missing for ${stringName} on language ${getLocaleData(getPlayerData(client).locale).englishName}`);
|
||||
logToConsole(LOG_WARN, `[V.RP.Locale] Locale string missing for ${stringName} on language ${getLocaleData(getPlayerData(client).locale).englishName}`);
|
||||
submitBugReport(client, `(AUTOMATED REPORT) Locale string "${stringName}" is missing for "${getPlayerLocaleName(client)}"`);
|
||||
return "";
|
||||
}
|
||||
@@ -57,7 +57,7 @@ function getLocaleString(client, stringName, ...args) {
|
||||
function getLanguageLocaleString(localeId, stringName, ...args) {
|
||||
let tempString = getRawLocaleString(localeId, stringName);
|
||||
if (tempString == "" || tempString == null || typeof tempString == "undefined") {
|
||||
logToConsole(LOG_WARN, `[AGRP.Locale] Locale string missing for ${stringName} on language ${getLocaleData(localeId).englishName}`);
|
||||
logToConsole(LOG_WARN, `[V.RP.Locale] Locale string missing for ${stringName} on language ${getLocaleData(localeId).englishName}`);
|
||||
submitBugReport(null, `(AUTOMATED REPORT) Locale string "${stringName}" is missing for "${getLocaleData(localeId).englishName}"`);
|
||||
return "";
|
||||
}
|
||||
@@ -74,7 +74,7 @@ function getLanguageLocaleString(localeId, stringName, ...args) {
|
||||
function getLanguageGroupedLocaleString(localeId, stringName, index, ...args) {
|
||||
let tempString = getRawGroupedLocaleString(localeId, stringName, index);
|
||||
if (tempString == "" || tempString == null || typeof tempString == "undefined") {
|
||||
logToConsole(LOG_WARN, `[AGRP.Locale] Locale string missing for index ${index} of "${stringName}" on language ${getLocaleData(localeId).englishName}`);
|
||||
logToConsole(LOG_WARN, `[V.RP.Locale] Locale string missing for index ${index} of "${stringName}" on language ${getLocaleData(localeId).englishName}`);
|
||||
submitBugReport(null, `(AUTOMATED REPORT) Locale string index ${index} of "${stringName}" is missing for "${getLocaleData(localeId).englishName}"`);
|
||||
return "";
|
||||
}
|
||||
@@ -106,7 +106,7 @@ function getGroupedLocaleString(client, stringName, index, ...args) {
|
||||
|
||||
function getRawLocaleString(localeId, stringName) {
|
||||
if (typeof getLocaleStrings()[localeId][stringName] == "undefined") {
|
||||
logToConsole(LOG_WARN, `[AGRP.Locale] Locale string missing for ${getLocaleStrings()[localeId][stringName]} on language ${getLocaleData(localeId).englishName}[${localeId}]`);
|
||||
logToConsole(LOG_WARN, `[V.RP.Locale] Locale string missing for ${getLocaleStrings()[localeId][stringName]} on language ${getLocaleData(localeId).englishName}[${localeId}]`);
|
||||
submitBugReport(null, `(AUTOMATED REPORT) Locale string is missing for "${getLocaleStrings()[localeId][stringName]}" on language ${getLocaleData(localeId).englishName}[${localeId}]`);
|
||||
return "";
|
||||
}
|
||||
@@ -127,7 +127,7 @@ function getRawLocaleString(localeId, stringName) {
|
||||
|
||||
function getRawGroupedLocaleString(localeId, stringName, index) {
|
||||
if (typeof getLocaleStrings()[localeId][stringName][index] == "undefined") {
|
||||
logToConsole(LOG_WARN, `[AGRP.Locale] Grouped locale string missing for index ${index} of string ${getLocaleStrings()[localeId][stringName][index]} on language ${getLocaleData(localeId).englishName}[${localeId}]`);
|
||||
logToConsole(LOG_WARN, `[V.RP.Locale] Grouped locale string missing for index ${index} of string ${getLocaleStrings()[localeId][stringName][index]} on language ${getLocaleData(localeId).englishName}[${localeId}]`);
|
||||
submitBugReport(null, `(AUTOMATED REPORT) Grouped locale string is missing for index ${index} of string "${getLocaleStrings()[localeId][stringName][index]}" on language ${getLocaleData(localeId).englishName}[${localeId}]`);
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -417,7 +417,7 @@ function enterExitPropertyCommand(command, params, client) {
|
||||
}, 1100);
|
||||
}
|
||||
}
|
||||
//logToConsole(LOG_DEBUG, `[AGRP.Misc] ${getPlayerDisplayForConsole(client)} exited business ${inBusiness.name}[${inBusiness.index}/${inBusiness.databaseId}]`);
|
||||
//logToConsole(LOG_DEBUG, `[V.RP.Misc] ${getPlayerDisplayForConsole(client)} exited business ${inBusiness.name}[${inBusiness.index}/${inBusiness.databaseId}]`);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -826,24 +826,24 @@ function getPlayerWeapon(client) {
|
||||
function connectToDatabase() {
|
||||
if (getDatabaseConfig().usePersistentConnection) {
|
||||
if (persistentDatabaseConnection == null) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Database] Initializing database connection ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Database] Initializing database connection ...`);
|
||||
persistentDatabaseConnection = module.mysql.connect(getDatabaseConfig().host, getDatabaseConfig().user, getDatabaseConfig().pass, getDatabaseConfig().name, getDatabaseConfig().port);
|
||||
if (persistentDatabaseConnection.error) {
|
||||
logToConsole(LOG_ERROR, `[AGRP.Database] Database connection error: ${persistentDatabaseConnection.error}`);
|
||||
logToConsole(LOG_ERROR, `[V.RP.Database] Database connection error: ${persistentDatabaseConnection.error}`);
|
||||
persistentDatabaseConnection = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Database] Database connection successful!`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Database] Database connection successful!`);
|
||||
return persistentDatabaseConnection;
|
||||
} else {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Database] Using existing database connection.`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Database] Using existing database connection.`);
|
||||
return persistentDatabaseConnection;
|
||||
}
|
||||
} else {
|
||||
let databaseConnection = module.mysql.connect(getDatabaseConfig().host, getDatabaseConfig().user, getDatabaseConfig().pass, getDatabaseConfig().name, getDatabaseConfig().port);
|
||||
if (databaseConnection.error) {
|
||||
logToConsole(LOG_ERROR, `[AGRP.Database] Database connection error: ${persistentDatabaseConnection.error}`);
|
||||
logToConsole(LOG_ERROR, `[V.RP.Database] Database connection error: ${persistentDatabaseConnection.error}`);
|
||||
return false;
|
||||
} else {
|
||||
return databaseConnection;
|
||||
@@ -857,9 +857,9 @@ function disconnectFromDatabase(dbConnection, force = false) {
|
||||
if (!getDatabaseConfig().usePersistentConnection || force == true) {
|
||||
try {
|
||||
dbConnection.close();
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Database] Database connection closed successfully`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Database] Database connection closed successfully`);
|
||||
} catch (error) {
|
||||
logToConsole(LOG_ERROR, `[AGRP.Database] Database connection could not be closed! (Error: ${error})`);
|
||||
logToConsole(LOG_ERROR, `[V.RP.Database] Database connection could not be closed! (Error: ${error})`);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -868,7 +868,7 @@ function disconnectFromDatabase(dbConnection, force = false) {
|
||||
// ===========================================================================
|
||||
|
||||
function queryDatabase(dbConnection, queryString, useThread = false) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Database] Query string: ${queryString}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Database] Query string: ${queryString}`);
|
||||
if (useThread == true) {
|
||||
Promise.resolve().then(() => {
|
||||
let queryResult = dbConnection.query(queryString);
|
||||
@@ -942,19 +942,19 @@ function quickDatabaseQuery(queryString) {
|
||||
let dbConnection = connectToDatabase();
|
||||
let insertId = 0;
|
||||
if (dbConnection) {
|
||||
//logToConsole(LOG_DEBUG, `[AGRP.Database] Query string: ${queryString}`);
|
||||
//logToConsole(LOG_DEBUG, `[V.RP.Database] Query string: ${queryString}`);
|
||||
let dbQuery = queryDatabase(dbConnection, queryString);
|
||||
if (getDatabaseInsertId(dbConnection)) {
|
||||
insertId = getDatabaseInsertId(dbConnection);
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Database] Query returned insert id ${insertId}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Database] Query returned insert id ${insertId}`);
|
||||
}
|
||||
|
||||
if (dbQuery) {
|
||||
try {
|
||||
freeDatabaseQuery(dbQuery);
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Database] Query result free'd successfully`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Database] Query result free'd successfully`);
|
||||
} catch (error) {
|
||||
logToConsole(LOG_ERROR, `[AGRP.Database] Query result could not be free'd! (Error: ${error})`);
|
||||
logToConsole(LOG_ERROR, `[V.RP.Database] Query result could not be free'd! (Error: ${error})`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1006,9 +1006,9 @@ function setConstantsAsGlobalVariablesInDatabase() {
|
||||
let dbConnection = connectToDatabase();
|
||||
let entries = Object.entries(global);
|
||||
for (let i in entries) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Database] Checking entry ${i} (${entries[i]})`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Database] Checking entry ${i} (${entries[i]})`);
|
||||
if (toString(i).slice(0, 3).indexOf("V_") != -1) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Database] Adding ${i} (${entries[i]}) to database global variables`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Database] Adding ${i} (${entries[i]}) to database global variables`);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1193,7 +1193,7 @@ function setVehicleHealth(vehicle, health) {
|
||||
// ===========================================================================
|
||||
|
||||
function givePlayerWeapon(client, weaponId, ammo, active = true) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending signal to ${getPlayerDisplayForConsole(client)} to give weapon (Weapon: ${weaponId}, Ammo: ${ammo})`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending signal to ${getPlayerDisplayForConsole(client)} to give weapon (Weapon: ${weaponId}, Ammo: ${ammo})`);
|
||||
sendNetworkEventToPlayer("v.rp.giveWeapon", client, weaponId, ammo, active);
|
||||
}
|
||||
|
||||
@@ -1447,7 +1447,7 @@ function hideElementForPlayer(element, client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Native.Connected] Hiding element ${element.id} for player ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Native.Connected] Hiding element ${element.id} for player ${getPlayerDisplayForConsole(client)}`);
|
||||
element.setExistsFor(client, false);
|
||||
}
|
||||
|
||||
@@ -1462,7 +1462,7 @@ function showElementForPlayer(element, client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Native.Connected] Showing element ${element.id} for player ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Native.Connected] Showing element ${element.id} for player ${getPlayerDisplayForConsole(client)}`);
|
||||
element.setExistsFor(client, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -742,24 +742,24 @@ function getPlayerWeapon(client) {
|
||||
function connectToDatabase() {
|
||||
if (getDatabaseConfig().usePersistentConnection) {
|
||||
if (persistentDatabaseConnection == null) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Database] Initializing database connection ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Database] Initializing database connection ...`);
|
||||
persistentDatabaseConnection = module.mysql.connect(getDatabaseConfig().host, getDatabaseConfig().user, getDatabaseConfig().pass, getDatabaseConfig().name, getDatabaseConfig().port);
|
||||
if (persistentDatabaseConnection.error) {
|
||||
logToConsole(LOG_ERROR, `[AGRP.Database] Database connection error: ${persistentDatabaseConnection.error}`);
|
||||
logToConsole(LOG_ERROR, `[V.RP.Database] Database connection error: ${persistentDatabaseConnection.error}`);
|
||||
persistentDatabaseConnection = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Database] Database connection successful!`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Database] Database connection successful!`);
|
||||
return persistentDatabaseConnection;
|
||||
} else {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Database] Using existing database connection.`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Database] Using existing database connection.`);
|
||||
return persistentDatabaseConnection;
|
||||
}
|
||||
} else {
|
||||
let databaseConnection = module.mysql.connect(getDatabaseConfig().host, getDatabaseConfig().user, getDatabaseConfig().pass, getDatabaseConfig().name, getDatabaseConfig().port);
|
||||
if (databaseConnection.error) {
|
||||
logToConsole(LOG_ERROR, `[AGRP.Database] Database connection error: ${persistentDatabaseConnection.error}`);
|
||||
logToConsole(LOG_ERROR, `[V.RP.Database] Database connection error: ${persistentDatabaseConnection.error}`);
|
||||
return false;
|
||||
} else {
|
||||
return databaseConnection;
|
||||
@@ -773,9 +773,9 @@ function disconnectFromDatabase(dbConnection) {
|
||||
if (!getDatabaseConfig().usePersistentConnection) {
|
||||
try {
|
||||
dbConnection.close();
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Database] Database connection closed successfully`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Database] Database connection closed successfully`);
|
||||
} catch (error) {
|
||||
logToConsole(LOG_ERROR, `[AGRP.Database] Database connection could not be closed! (Error: ${error})`);
|
||||
logToConsole(LOG_ERROR, `[V.RP.Database] Database connection could not be closed! (Error: ${error})`);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -784,7 +784,7 @@ function disconnectFromDatabase(dbConnection) {
|
||||
// ===========================================================================
|
||||
|
||||
function queryDatabase(dbConnection, queryString, useThread = false) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Database] Query string: ${queryString}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Database] Query string: ${queryString}`);
|
||||
if (useThread == true) {
|
||||
Promise.resolve().then(() => {
|
||||
let queryResult = dbConnection.query(queryString);
|
||||
@@ -849,19 +849,19 @@ function quickDatabaseQuery(queryString) {
|
||||
let dbConnection = connectToDatabase();
|
||||
let insertId = 0;
|
||||
if (dbConnection) {
|
||||
//logToConsole(LOG_DEBUG, `[AGRP.Database] Query string: ${queryString}`);
|
||||
//logToConsole(LOG_DEBUG, `[V.RP.Database] Query string: ${queryString}`);
|
||||
let dbQuery = queryDatabase(dbConnection, queryString);
|
||||
if (getDatabaseInsertId(dbConnection)) {
|
||||
insertId = getDatabaseInsertId(dbConnection);
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Database] Query returned insert id ${insertId}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Database] Query returned insert id ${insertId}`);
|
||||
}
|
||||
|
||||
if (dbQuery) {
|
||||
try {
|
||||
freeDatabaseQuery(dbQuery);
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Database] Query result free'd successfully`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Database] Query result free'd successfully`);
|
||||
} catch (error) {
|
||||
logToConsole(LOG_ERROR, `[AGRP.Database] Query result could not be free'd! (Error: ${error})`);
|
||||
logToConsole(LOG_ERROR, `[V.RP.Database] Query result could not be free'd! (Error: ${error})`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -998,7 +998,7 @@ function setVehicleHealth(vehicle, health) {
|
||||
// ===========================================================================
|
||||
|
||||
function givePlayerWeapon(client, weaponId, ammo, active = true) {
|
||||
//logToConsole(LOG_DEBUG, `[AGRP.Client] Sending signal to ${getPlayerDisplayForConsole(client)} to give weapon (Weapon: ${weaponId}, Ammo: ${ammo})`);
|
||||
//logToConsole(LOG_DEBUG, `[V.RP.Client] Sending signal to ${getPlayerDisplayForConsole(client)} to give weapon (Weapon: ${weaponId}, Ammo: ${ammo})`);
|
||||
//sendNetworkEventToPlayer("v.rp.giveWeapon", client, weaponId, ammo, active);
|
||||
client.giveWeapon(weaponId, ammo);
|
||||
}
|
||||
|
||||
@@ -87,14 +87,14 @@ function updatePlayerNameTag(client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending ${getPlayerDisplayForConsole(client)}'s updated nametag to all players`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending ${getPlayerDisplayForConsole(client)}'s updated nametag to all players`);
|
||||
sendNetworkEventToPlayer("v.rp.nametag", null, getPlayerName(client), getPlayerNameForNameTag(client), getPlayerColour(client), getPlayerData(client).afk, getPlayerPing(client));
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function updateAllPlayerNameTags() {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending updated nametags to all players`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending updated nametags to all players`);
|
||||
let clients = getClients();
|
||||
for (let i in clients) {
|
||||
updatePlayerNameTag(clients[i]);
|
||||
@@ -104,7 +104,7 @@ function updateAllPlayerNameTags() {
|
||||
// ===========================================================================
|
||||
|
||||
function updatePlayerPing(client) {
|
||||
//logToConsole(LOG_DEBUG, `[AGRP.Client] Sending ${getPlayerDisplayForConsole(client)}'s ping to all players`);
|
||||
//logToConsole(LOG_DEBUG, `[V.RP.Client] Sending ${getPlayerDisplayForConsole(client)}'s ping to all players`);
|
||||
sendNetworkEventToPlayer("v.rp.ping", null, getPlayerName(client), getPlayerPing(client));
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ function updatePlayerPing(client) {
|
||||
|
||||
function playerClientReady(client) {
|
||||
playerResourceReady[client.index] = true;
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] ${getPlayerDisplayForConsole(client)}'s client resources are downloaded and ready! Started: ${getYesNoFromBool(playerResourceStarted[client.index])}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] ${getPlayerDisplayForConsole(client)}'s client resources are downloaded and ready! Started: ${getYesNoFromBool(playerResourceStarted[client.index])}`);
|
||||
if (playerResourceStarted[client.index] == true && playerInitialized[client.index] == false) {
|
||||
initClient(client);
|
||||
}
|
||||
@@ -122,14 +122,14 @@ function playerClientReady(client) {
|
||||
|
||||
function playerGUIReady(client) {
|
||||
playerGUI[client.index] = true;
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] ${getPlayerDisplayForConsole(client)}'s client GUI is initialized and ready!`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] ${getPlayerDisplayForConsole(client)}'s client GUI is initialized and ready!`);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function playerClientStarted(client) {
|
||||
playerResourceStarted[client.index] = true;
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] ${getPlayerDisplayForConsole(client)}'s client resources are started and running! Ready: ${getYesNoFromBool(playerResourceReady[client.index])}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] ${getPlayerDisplayForConsole(client)}'s client resources are started and running! Ready: ${getYesNoFromBool(playerResourceReady[client.index])}`);
|
||||
if (playerResourceReady[client.index] == true && playerInitialized[client.index] == false) {
|
||||
initClient(client);
|
||||
}
|
||||
@@ -138,7 +138,7 @@ function playerClientStarted(client) {
|
||||
// ===========================================================================
|
||||
|
||||
function playerClientStopped(client) {
|
||||
logToConsole(LOG_DEBUG | LOG_WARN, `[AGRP.Client] ${getPlayerDisplayForConsole(client)}'s client resources have stopped (possibly error?)`);
|
||||
logToConsole(LOG_DEBUG | LOG_WARN, `[V.RP.Client] ${getPlayerDisplayForConsole(client)}'s client resources have stopped (possibly error?)`);
|
||||
getPlayerData(client).customDisconnectReason = "ClientScriptVerificationFail";
|
||||
//disconnectPlayer(client);
|
||||
}
|
||||
@@ -146,7 +146,7 @@ function playerClientStopped(client) {
|
||||
// ===========================================================================
|
||||
|
||||
function showSmallGameMessage(client, text, colour, duration, fontName = "Roboto") {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Showing game message to ${getPlayerDisplayForConsole(client)} (${text}) for ${duration} milliseconds`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Showing game message to ${getPlayerDisplayForConsole(client)} (${text}) for ${duration} milliseconds`);
|
||||
|
||||
if (getGame() <= V_GAME_GTA_IV_EFLC) {
|
||||
fontName = "Pricedown";
|
||||
@@ -163,7 +163,7 @@ function enableCityAmbienceForPlayer(client, clearElements = false) {
|
||||
// return false;
|
||||
//}
|
||||
|
||||
//logToConsole(LOG_DEBUG, `[AGRP.Client] Setting ${getPlayerDisplayForConsole(client)}'s city ambience to ${toUpperCase(getOnOffFromBool(false))}`);
|
||||
//logToConsole(LOG_DEBUG, `[V.RP.Client] Setting ${getPlayerDisplayForConsole(client)}'s city ambience to ${toUpperCase(getOnOffFromBool(false))}`);
|
||||
//sendNetworkEventToPlayer("v.rp.ambience", client, true);
|
||||
}
|
||||
|
||||
@@ -174,21 +174,21 @@ function disableCityAmbienceForPlayer(client, clearElements = false) {
|
||||
// return false;
|
||||
//}
|
||||
|
||||
//logToConsole(LOG_DEBUG, `[AGRP.Client] Setting ${getPlayerDisplayForConsole(client)}'s city ambience to ${toUpperCase(getOnOffFromBool(false))}`);
|
||||
//logToConsole(LOG_DEBUG, `[V.RP.Client] Setting ${getPlayerDisplayForConsole(client)}'s city ambience to ${toUpperCase(getOnOffFromBool(false))}`);
|
||||
//sendNetworkEventToPlayer("v.rp.ambience", client, false, clearElements);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function clearPlayerOwnedPeds(client) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Clearing peds owned by ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Clearing peds owned by ${getPlayerDisplayForConsole(client)}`);
|
||||
sendNetworkEventToPlayer("v.rp.clearPeds", client);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function updatePlayerSpawnedState(client, state) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Setting ${getPlayerDisplayForConsole(client)}'s spawned state ${toUpperCase(getOnOffFromBool(state))}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Setting ${getPlayerDisplayForConsole(client)}'s spawned state ${toUpperCase(getOnOffFromBool(state))}`);
|
||||
getPlayerData(client).spawned = true;
|
||||
sendNetworkEventToPlayer("v.rp.spawned", client, state);
|
||||
}
|
||||
@@ -196,21 +196,21 @@ function updatePlayerSpawnedState(client, state) {
|
||||
// ===========================================================================
|
||||
|
||||
function setPlayerControlState(client, state) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Setting ${getPlayerDisplayForConsole(client)}'s control state ${toUpperCase(getOnOffFromBool(state))}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Setting ${getPlayerDisplayForConsole(client)}'s control state ${toUpperCase(getOnOffFromBool(state))}`);
|
||||
sendNetworkEventToPlayer("v.rp.control", client, state, !state);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function updatePlayerShowLogoState(client, state) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Setting ${getPlayerDisplayForConsole(client)}'s logo state ${toUpperCase(getOnOffFromBool(state))}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Setting ${getPlayerDisplayForConsole(client)}'s logo state ${toUpperCase(getOnOffFromBool(state))}`);
|
||||
sendNetworkEventToPlayer("v.rp.logo", client, state);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function restorePlayerCamera(client) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Restoring ${getPlayerDisplayForConsole(client)}'s camera`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Restoring ${getPlayerDisplayForConsole(client)}'s camera`);
|
||||
sendNetworkEventToPlayer("v.rp.restoreCamera", client);
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ function setPlayer2DRendering(client, hudState = false, labelState = false, smal
|
||||
// ===========================================================================
|
||||
|
||||
function syncPlayerProperties(client) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending signal to sync ${getPlayerDisplayForConsole(client)}'s player ped properties`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending signal to sync ${getPlayerDisplayForConsole(client)}'s player ped properties`);
|
||||
sendNetworkEventToPlayer("v.rp.syncElement", null, getPlayerPed(client).id);
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ function syncPlayerProperties(client) {
|
||||
|
||||
function updatePlayerSnowState(client, forceGroundSnow = false) {
|
||||
if (isSnowSupported(getGame())) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Setting ${getPlayerDisplayForConsole(client)}'s snow state (Falling: ${toUpperCase(getOnOffFromBool(getServerConfig().fallingSnow))}, Ground: ${toUpperCase(getOnOffFromBool(getServerConfig().groundSnow))})`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Setting ${getPlayerDisplayForConsole(client)}'s snow state (Falling: ${toUpperCase(getOnOffFromBool(getServerConfig().fallingSnow))}, Ground: ${toUpperCase(getOnOffFromBool(getServerConfig().groundSnow))})`);
|
||||
sendNetworkEventToPlayer("v.rp.snow", client, getServerConfig().fallingSnow, getServerConfig().groundSnow, forceGroundSnow);
|
||||
}
|
||||
}
|
||||
@@ -239,7 +239,7 @@ function updatePlayerSnowState(client, forceGroundSnow = false) {
|
||||
// ===========================================================================
|
||||
|
||||
function updatePlayerHotBar(client) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending updated hotbar data to ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending updated hotbar data to ${getPlayerDisplayForConsole(client)}`);
|
||||
let tempHotBarItems = [];
|
||||
for (let i in getPlayerData(client).hotBarItems) {
|
||||
let itemImage = "";
|
||||
@@ -262,14 +262,14 @@ function updatePlayerHotBar(client) {
|
||||
// ===========================================================================
|
||||
|
||||
function setPlayerWeaponDamageEnabled(client, state) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending weapon damage state for ${getPlayerDisplayForConsole(client)} to all players`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending weapon damage state for ${getPlayerDisplayForConsole(client)} to all players`);
|
||||
sendNetworkEventToPlayer("v.rp.weaponDamageEnabled", null, getPlayerName(client), state);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function setPlayerWeaponDamageEvent(client, eventType) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending weapon damage event (${eventType}) for ${getPlayerDisplayForConsole(client)} to all players`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending weapon damage event (${eventType}) for ${getPlayerDisplayForConsole(client)} to all players`);
|
||||
sendNetworkEventToPlayer("v.rp.weaponDamageEvent", null, getPlayerName(client), eventType);
|
||||
getPlayerData(client).weaponDamageEvent = eventType;
|
||||
}
|
||||
@@ -277,259 +277,259 @@ function setPlayerWeaponDamageEvent(client, eventType) {
|
||||
// ===========================================================================
|
||||
|
||||
function sendJobRouteLocationToPlayer(client, position, colour) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending job route location data to ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending job route location data to ${getPlayerDisplayForConsole(client)}`);
|
||||
sendNetworkEventToPlayer("v.rp.showJobRouteLocation", client, position, colour);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function showPlayerLoginSuccessGUI(client) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending login success GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending login success GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||
sendNetworkEventToPlayer("v.rp.loginSuccess", client);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function showPlayerLoginFailedGUI(client, errorMessage) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending login failed GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending login failed GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||
sendNetworkEventToPlayer("v.rp.loginFailed", client, errorMessage);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function showPlayerRegistrationSuccessGUI(client) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending registration success GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending registration success GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||
sendNetworkEventToPlayer("v.rp.registrationSuccess", client);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function showPlayerRegistrationFailedGUI(client, errorMessage) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending registration failed GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending registration failed GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||
sendNetworkEventToPlayer("v.rp.registrationFailed", client, errorMessage);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function sendPlayerGUIColours(client) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending GUI colours to ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending GUI colours to ${getPlayerDisplayForConsole(client)}`);
|
||||
sendNetworkEventToPlayer("v.rp.guiColour", client, getServerConfig().guiColourPrimary[0], getServerConfig().guiColourPrimary[1], getServerConfig().guiColourPrimary[2], getServerConfig().guiColourSecondary[0], getServerConfig().guiColourSecondary[1], getServerConfig().guiColourSecondary[2], getServerConfig().guiTextColourPrimary[0], getServerConfig().guiTextColourPrimary[1], getServerConfig().guiTextColourPrimary[2]);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function sendPlayerGUIInit(client) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending GUI init signal to ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending GUI init signal to ${getPlayerDisplayForConsole(client)}`);
|
||||
sendNetworkEventToPlayer("v.rp.guiInit", client);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function showPlayerLoginGUI(client, errorMessage = "") {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending show login GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending show login GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||
sendNetworkEventToPlayer("v.rp.showLogin", client);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function showPlayerRegistrationGUI(client, errorMessage = "") {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending show registration GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending show registration GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||
sendNetworkEventToPlayer("v.rp.showRegistration", client);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function showPlayerNewCharacterGUI(client) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending show new character GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending show new character GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||
sendNetworkEventToPlayer("v.rp.showNewCharacter", client);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function showPlayerChangePasswordGUI(client, errorMessage = "") {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending show change password GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending show change password GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||
sendNetworkEventToPlayer("v.rp.showChangePassword", client, errorMessage);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function showPlayerResetPasswordCodeInputGUI(client) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending show reset password code input GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending show reset password code input GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||
sendNetworkEventToPlayer("v.rp.showResetPasswordCodeInput", client);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function showPlayerResetPasswordEmailInputGUI(client) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending show reset password email input GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending show reset password email input GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||
sendNetworkEventToPlayer("v.rp.showResetPasswordEmailInput", client);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function showPlayerCharacterSelectGUI(client, firstName, lastName, cash, clan, lastPlayed, skin) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending character select GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending character select GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||
sendNetworkEventToPlayer("v.rp.showCharacterSelect", client, firstName, lastName, cash, clan, lastPlayed, skin);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function updatePlayerCharacterSelectGUI(client, firstName, lastName, cash, clan, lastPlayed, skin) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending update character select GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending update character select GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||
sendNetworkEventToPlayer("v.rp.switchCharacterSelect", client, firstName, lastName, cash, clan, lastPlayed, skin);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function showPlayerCharacterSelectSuccessGUI(client) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending character select success GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending character select success GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||
sendNetworkEventToPlayer("v.rp.characterSelectSuccess", client);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function showPlayerCharacterSelectFailedGUI(client) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending character select failed GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending character select failed GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||
sendNetworkEventToPlayer("v.rp.characterSelectFailed", client);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function showPlayerPromptGUI(client, promptMessage, promptTitle, yesButtonText = "Yes", noButtonText = "No") {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending show prompt GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${promptTitle}, Message: ${promptMessage}, YesButton: ${yesButtonText}, NoButton: ${noButtonText})`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending show prompt GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${promptTitle}, Message: ${promptMessage}, YesButton: ${yesButtonText}, NoButton: ${noButtonText})`);
|
||||
sendNetworkEventToPlayer("v.rp.showPrompt", client, promptMessage, promptTitle, yesButtonText, noButtonText);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function showPlayerInfoGUI(client, infoMessage, infoTitle, buttonText = "OK") {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending show info GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${infoTitle}, Message: ${infoMessage})`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending show info GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${infoTitle}, Message: ${infoMessage})`);
|
||||
sendNetworkEventToPlayer("v.rp.showInfo", client, infoMessage, infoTitle, buttonText);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function showPlayerErrorGUI(client, errorMessage, errorTitle, buttonText = "OK") {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending show error GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${errorTitle}, Message: ${errorMessage})`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending show error GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${errorTitle}, Message: ${errorMessage})`);
|
||||
sendNetworkEventToPlayer("v.rp.showError", client, errorMessage, errorTitle, buttonText);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function sendRunCodeToClient(client, code, returnTo) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending runcode to ${getPlayerDisplayForConsole(client)} (returnTo: ${getPlayerDisplayForConsole(getClientFromIndex(returnTo))}, Code: ${code})`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending runcode to ${getPlayerDisplayForConsole(client)} (returnTo: ${getPlayerDisplayForConsole(getClientFromIndex(returnTo))}, Code: ${code})`);
|
||||
sendNetworkEventToPlayer("v.rp.runCode", client, code, getPlayerId(returnTo));
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function sendPlayerWorkingState(client, state) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending working state (${toUpperCase(getYesNoFromBool(state))}) to ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending working state (${toUpperCase(getYesNoFromBool(state))}) to ${getPlayerDisplayForConsole(client)}`);
|
||||
sendNetworkEventToPlayer("v.rp.working", client, state);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function sendPlayerJobType(client, jobType) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending job type (${jobType}) to ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending job type (${jobType}) to ${getPlayerDisplayForConsole(client)}`);
|
||||
sendNetworkEventToPlayer("v.rp.jobType", client, jobType);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function sendPlayerStopJobRoute(client) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending signal to abort job route to ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending signal to abort job route to ${getPlayerDisplayForConsole(client)}`);
|
||||
sendNetworkEventToPlayer("v.rp.hideJobRouteLocation", client);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function sendPlayerMouseCameraToggle(client) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending signal to toggle mouse camera ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending signal to toggle mouse camera ${getPlayerDisplayForConsole(client)}`);
|
||||
sendNetworkEventToPlayer("v.rp.mouseCamera", client);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function setPlayerMouseCameraState(client, state) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending signal to toggle mouse camera ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending signal to toggle mouse camera ${getPlayerDisplayForConsole(client)}`);
|
||||
sendNetworkEventToPlayer("v.rp.mouseCameraForce", client, state);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function sendPlayerMouseCursorToggle(client) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending signal to toggle mouse cursor ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending signal to toggle mouse cursor ${getPlayerDisplayForConsole(client)}`);
|
||||
sendNetworkEventToPlayer("v.rp.mouseCursor", client);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function sendAddAccountKeyBindToClient(client, key, keyState) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending added keybind to ${getPlayerDisplayForConsole(client)} (Key: ${toUpperCase(getKeyNameFromId(key))}, State: ${(keyState) ? "down" : "up"})`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending added keybind to ${getPlayerDisplayForConsole(client)} (Key: ${toUpperCase(getKeyNameFromId(key))}, State: ${(keyState) ? "down" : "up"})`);
|
||||
sendNetworkEventToPlayer("v.rp.addKeyBind", client, toInteger(key), (keyState) ? KEYSTATE_DOWN : KEYSTATE_UP);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function sendClearKeyBindsToClient(client, key, keyState) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending added keybind to ${getPlayerDisplayForConsole(client)} (Key: ${toUpperCase(getKeyNameFromId(key))}, State: ${(keyState) ? "down" : "up"})`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending added keybind to ${getPlayerDisplayForConsole(client)} (Key: ${toUpperCase(getKeyNameFromId(key))}, State: ${(keyState) ? "down" : "up"})`);
|
||||
sendNetworkEventToPlayer("v.rp.clearKeyBinds", client);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function sendRemoveAccountKeyBindToClient(client, key) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending deleted keybind to ${getPlayerDisplayForConsole(client)} (Key: ${toUpperCase(getKeyNameFromId(key))})`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending deleted keybind to ${getPlayerDisplayForConsole(client)} (Key: ${toUpperCase(getKeyNameFromId(key))})`);
|
||||
sendNetworkEventToPlayer("v.rp.delKeyBind", client, toInteger(key));
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function sendPlayerSetPosition(client, position) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending set position signal to ${getPlayerDisplayForConsole(client)} (Position: ${position.x}, ${position.y}, ${position.z})`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending set position signal to ${getPlayerDisplayForConsole(client)} (Position: ${position.x}, ${position.y}, ${position.z})`);
|
||||
sendNetworkEventToPlayer("v.rp.position", client, position);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function sendPlayerSetHeading(client, heading) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending set heading signal to ${getPlayerDisplayForConsole(client)} (Heading: ${heading})`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending set heading signal to ${getPlayerDisplayForConsole(client)} (Heading: ${heading})`);
|
||||
sendNetworkEventToPlayer("v.rp.heading", client, heading);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function sendPlayerSetInterior(client, interior) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending set interior signal to ${getPlayerDisplayForConsole(client)} (Interior: ${interior})`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending set interior signal to ${getPlayerDisplayForConsole(client)} (Interior: ${interior})`);
|
||||
sendNetworkEventToPlayer("v.rp.interior", client, interior);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function sendPlayerFrozenState(client, state) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending set frozen signal to ${getPlayerDisplayForConsole(client)} (State: ${toUpperCase(getYesNoFromBool(state))})`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending set frozen signal to ${getPlayerDisplayForConsole(client)} (State: ${toUpperCase(getYesNoFromBool(state))})`);
|
||||
sendNetworkEventToPlayer("v.rp.frozen", client, state);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function clearPlayerWeapons(client, clearData = true) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending signal to ${getPlayerDisplayForConsole(client)} to clear weapons`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending signal to ${getPlayerDisplayForConsole(client)} to clear weapons`);
|
||||
sendNetworkEventToPlayer("v.rp.clearWeapons", client, clearData);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function showPlayerNewCharacterFailedGUI(client, errorMessage) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending new character failed GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending new character failed GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||
sendNetworkEventToPlayer("v.rp.newCharacterFailed", client, errorMessage);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function sendPlayerRemoveFromVehicle(client) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Sending remove from vehicle signal to ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Sending remove from vehicle signal to ${getPlayerDisplayForConsole(client)}`);
|
||||
sendNetworkEventToPlayer("v.rp.removeFromVehicle", client);
|
||||
}
|
||||
|
||||
@@ -547,10 +547,10 @@ function showPlayerItemTakeDelay(client, itemId) {
|
||||
if (getItemData(itemId)) {
|
||||
let delay = getItemTypeData(getItemData(itemId).itemTypeIndex).pickupDelay;
|
||||
if (delay > 0) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item TAKE delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Showing item TAKE delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
|
||||
sendNetworkEventToPlayer("v.rp.showItemActionDelay", client, delay);
|
||||
} else {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item TAKE delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Showing item TAKE delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
||||
playerItemActionDelayComplete(client);
|
||||
}
|
||||
}
|
||||
@@ -562,10 +562,10 @@ function showPlayerItemUseDelay(client, itemSlot) {
|
||||
if (getItemData(getPlayerData(client).hotBarItems[itemSlot])) {
|
||||
let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).useDelay;
|
||||
if (delay > 0) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item USE delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Showing item USE delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
|
||||
sendNetworkEventToPlayer("v.rp.showItemActionDelay", client, delay);
|
||||
} else {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item USE delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Showing item USE delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
||||
playerItemActionDelayComplete(client);
|
||||
}
|
||||
}
|
||||
@@ -577,10 +577,10 @@ function showPlayerItemDropDelay(client, itemSlot) {
|
||||
if (getItemData(getPlayerData(client).hotBarItems[itemSlot])) {
|
||||
let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).dropDelay;
|
||||
if (delay > 0) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item DROP delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Showing item DROP delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
|
||||
sendNetworkEventToPlayer("v.rp.showItemActionDelay", client, delay);
|
||||
} else {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item DROP delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Showing item DROP delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
||||
playerItemActionDelayComplete(client);
|
||||
}
|
||||
}
|
||||
@@ -592,10 +592,10 @@ function showPlayerItemPickupDelay(client, itemId) {
|
||||
if (getItemData(itemId)) {
|
||||
let delay = getItemTypeData(getItemData(itemId).itemTypeIndex).pickupDelay;
|
||||
if (delay > 0) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item PICKUP delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Showing item PICKUP delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
|
||||
sendNetworkEventToPlayer("v.rp.showItemActionDelay", client, delay);
|
||||
} else {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item PICKUP delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Showing item PICKUP delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
||||
playerItemActionDelayComplete(client);
|
||||
}
|
||||
}
|
||||
@@ -607,10 +607,10 @@ function showPlayerItemPutDelay(client, itemSlot) {
|
||||
if (getItemData(getPlayerData(client).hotBarItems[itemSlot])) {
|
||||
let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).putDelay;
|
||||
if (delay > 0) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item PUT delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Showing item PUT delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
|
||||
sendNetworkEventToPlayer("v.rp.showItemActionDelay", client, delay);
|
||||
} else {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item PUT delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Showing item PUT delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
||||
playerItemActionDelayComplete(client);
|
||||
}
|
||||
}
|
||||
@@ -623,18 +623,18 @@ function showPlayerItemSwitchDelay(client, itemSlot) {
|
||||
if (getPlayerData(client).hotBarItems[itemSlot] != -1) {
|
||||
let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).switchDelay;
|
||||
if (delay > 0) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
|
||||
sendNetworkEventToPlayer("v.rp.showItemActionDelay", client, delay);
|
||||
} else {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
||||
playerItemActionDelayComplete(client);
|
||||
}
|
||||
} else {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
||||
playerItemActionDelayComplete(client);
|
||||
}
|
||||
} else {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (instant)`);
|
||||
playerSwitchItem(client, itemSlot);
|
||||
}
|
||||
}
|
||||
@@ -642,14 +642,14 @@ function showPlayerItemSwitchDelay(client, itemSlot) {
|
||||
// ===========================================================================
|
||||
|
||||
function sendPlayerDrunkEffect(client, amount, duration) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Setting drunk effect for ${getPlayerDisplayForConsole(client)} to ${amount} for ${duration} milliseconds`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Setting drunk effect for ${getPlayerDisplayForConsole(client)} to ${amount} for ${duration} milliseconds`);
|
||||
sendNetworkEventToPlayer("v.rp.drunkEffect", client, amount, duration);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function sendPlayerClearPedState(client) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Clearing ped state for ${getPlayerDisplayForConsole(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Clearing ped state for ${getPlayerDisplayForConsole(client)}`);
|
||||
sendNetworkEventToPlayer("v.rp.clearPedState", client);
|
||||
}
|
||||
|
||||
@@ -659,29 +659,29 @@ function playerDamagedByPlayer(client, damagerEntityName, weaponId, pedPiece, he
|
||||
let damagerEntity = getPlayerFromParams(damagerEntityName);
|
||||
|
||||
if (isNull(damagerEntity)) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] ${getPlayerDisplayForConsole(client)}'s damager entity from ID is null`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] ${getPlayerDisplayForConsole(client)}'s damager entity from ID is null`);
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] ${getPlayerDisplayForConsole(client)} was damaged by ${damagerEntity}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] ${getPlayerDisplayForConsole(client)} was damaged by ${damagerEntity}`);
|
||||
|
||||
if (isNull(damagerEntity)) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] ${getPlayerDisplayForConsole(client)}'s damager client is INVALID`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] ${getPlayerDisplayForConsole(client)}'s damager client is INVALID`);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!getPlayerData(damagerEntity) || !getPlayerData(client)) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] ${getPlayerDisplayForConsole(client)}'s damager's client data is INVALID`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] ${getPlayerDisplayForConsole(client)}'s damager's client data is INVALID`);
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] ${getPlayerDisplayForConsole(client)}'s damager is ${getPlayerDisplayForConsole(damagerEntity)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] ${getPlayerDisplayForConsole(client)}'s damager is ${getPlayerDisplayForConsole(damagerEntity)}`);
|
||||
|
||||
switch (getPlayerData(damagerEntity).weaponDamageEvent) {
|
||||
case V_WEAPON_DAMAGE_EVENT_TAZER:
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] ${getPlayerDisplayForConsole(client)}'s damager ${getPlayerDisplayForConsole(damagerEntity)} is using a tazer`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] ${getPlayerDisplayForConsole(client)}'s damager ${getPlayerDisplayForConsole(damagerEntity)} is using a tazer`);
|
||||
if (!isPlayerTazed(client) && !isPlayerHandCuffed(client) && !isPlayerInAnyVehicle(client)) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] ${getPlayerDisplayForConsole(client)} was not previously tazed, binded, or in a vehicle. Taze successful`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] ${getPlayerDisplayForConsole(client)} was not previously tazed, binded, or in a vehicle. Taze successful`);
|
||||
meActionToNearbyPlayers(damagerEntity, `electrifies ${getCharacterFullName(client)} with their tazer`);
|
||||
tazePlayer(client);
|
||||
}
|
||||
@@ -694,10 +694,10 @@ function playerDamagedByPlayer(client, damagerEntityName, weaponId, pedPiece, he
|
||||
break;
|
||||
|
||||
case V_WEAPON_DAMAGE_EVENT_NORMAL:
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] ${getPlayerDisplayForConsole(client)}'s damager ${getPlayerDisplayForConsole(damagerEntity)} caused ${healthLoss} damage (damage reduction makes it ${(healthLoss * getPlayerData(client).incomingDamageMultiplier)})`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] ${getPlayerDisplayForConsole(client)}'s damager ${getPlayerDisplayForConsole(damagerEntity)} caused ${healthLoss} damage (damage reduction makes it ${(healthLoss * getPlayerData(client).incomingDamageMultiplier)})`);
|
||||
let remainingDamage = healthLoss * getPlayerData(client).incomingDamageMultiplier;
|
||||
if (getPlayerArmour(client) > 0) {
|
||||
//logToConsole(LOG_DEBUG, `[AGRP.Client] ${getPlayerDisplayForConsole(client)}'s armour was ${getPlayerArmour(client)}, so it was reduced by ${healthLoss}`);
|
||||
//logToConsole(LOG_DEBUG, `[V.RP.Client] ${getPlayerDisplayForConsole(client)}'s armour was ${getPlayerArmour(client)}, so it was reduced by ${healthLoss}`);
|
||||
if (getPlayerArmour(client) - remainingDamage < 0) {
|
||||
setPlayerArmour(client, 0);
|
||||
remainingDamage = remainingDamage - getPlayerArmour(client);
|
||||
@@ -709,7 +709,7 @@ function playerDamagedByPlayer(client, damagerEntityName, weaponId, pedPiece, he
|
||||
break;
|
||||
|
||||
default:
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] ${getPlayerDisplayForConsole(client)}'s damager ${getPlayerDisplayForConsole(damagerEntity)} caused ${healthLoss} damage (damage reduction makes it ${(healthLoss * getPlayerData(client).incomingDamageMultiplier)})`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] ${getPlayerDisplayForConsole(client)}'s damager ${getPlayerDisplayForConsole(damagerEntity)} caused ${healthLoss} damage (damage reduction makes it ${(healthLoss * getPlayerData(client).incomingDamageMultiplier)})`);
|
||||
setPlayerHealth(client, getPlayerHealth(client) - (healthLoss * getPlayerData(client).incomingDamageMultiplier));
|
||||
break;
|
||||
}
|
||||
@@ -969,21 +969,21 @@ function sendPlayerChatAutoHideDelay(client, delay) {
|
||||
// ===========================================================================
|
||||
|
||||
function playRadioStreamForPlayer(client, streamURL, loop = true, volume = 0, element = false) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Forcing ${getPlayerDisplayForConsole(client)} to stream ${streamURL}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Forcing ${getPlayerDisplayForConsole(client)} to stream ${streamURL}`);
|
||||
sendNetworkEventToPlayer("v.rp.radioStream", client, streamURL, loop, volume, element);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function playAudioFileForPlayer(client, audioName, loop = true, volume = 0, element = false) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Forcing ${getPlayerDisplayForConsole(client)} to play audio ${audioName}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Forcing ${getPlayerDisplayForConsole(client)} to play audio ${audioName}`);
|
||||
sendNetworkEventToPlayer("v.rp.audioFileStream", client, audioName, loop, volume);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function stopRadioStreamForPlayer(client) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Client] Forcing ${getPlayerDisplayForConsole(client)} to stop their radio stream`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Client] Forcing ${getPlayerDisplayForConsole(client)} to stop their radio stream`);
|
||||
sendNetworkEventToPlayer("v.rp.stopRadioStream", client);
|
||||
}
|
||||
|
||||
|
||||
@@ -246,7 +246,7 @@ function createNPCCommand(command, params, client) {
|
||||
// ===========================================================================
|
||||
|
||||
function loadNPCsFromDatabase() {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.NPC]: Loading NPCs from database ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.NPC]: Loading NPCs from database ...`);
|
||||
let dbConnection = connectToDatabase();
|
||||
let tempNPCs = [];
|
||||
let dbAssoc = [];
|
||||
@@ -263,14 +263,14 @@ function loadNPCsFromDatabase() {
|
||||
disconnectFromDatabase(dbConnection);
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.NPC]: ${tempNPCs.length} NPCs loaded from database successfully!`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.NPC]: ${tempNPCs.length} NPCs loaded from database successfully!`);
|
||||
return tempNPCs;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function loadNPCTriggersFromDatabase(npcDatabaseId) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.NPC]: Loading NPC triggers for NPC ${npcDatabaseId} from database ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.NPC]: Loading NPC triggers for NPC ${npcDatabaseId} from database ...`);
|
||||
let dbConnection = connectToDatabase();
|
||||
let tempNPCTriggers = [];
|
||||
let dbAssoc = [];
|
||||
@@ -288,14 +288,14 @@ function loadNPCTriggersFromDatabase(npcDatabaseId) {
|
||||
disconnectFromDatabase(dbConnection);
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.NPC]: ${tempNPCTriggers.length} NPC triggers loaded for NPC ${npcDatabaseId} from database successfully!`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.NPC]: ${tempNPCTriggers.length} NPC triggers loaded for NPC ${npcDatabaseId} from database successfully!`);
|
||||
return tempNPCTriggers;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function loadNPCTriggerConditionsFromDatabase(npcTriggerDatabaseId) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.NPC]: Loading NPC trigger conditions for trigger ${npcTriggerDatabaseId} from database ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.NPC]: Loading NPC trigger conditions for trigger ${npcTriggerDatabaseId} from database ...`);
|
||||
let dbConnection = connectToDatabase();
|
||||
let tempNPCTriggerConditions = [];
|
||||
let dbAssoc;
|
||||
@@ -311,14 +311,14 @@ function loadNPCTriggerConditionsFromDatabase(npcTriggerDatabaseId) {
|
||||
disconnectFromDatabase(dbConnection);
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.NPC]: ${tempNPCTriggerConditions.length} conditions loaded for trigger ${npcTriggerDatabaseId} from database successfully!`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.NPC]: ${tempNPCTriggerConditions.length} conditions loaded for trigger ${npcTriggerDatabaseId} from database successfully!`);
|
||||
return tempNPCTriggerConditions;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function loadNPCTriggerResponsesFromDatabase(npcTriggerDatabaseId) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.NPC]: Loading NPC trigger responses for trigger ${npcTriggerDatabaseId} from database ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.NPC]: Loading NPC trigger responses for trigger ${npcTriggerDatabaseId} from database ...`);
|
||||
let dbConnection = connectToDatabase();
|
||||
let tempNPCTriggerResponses = [];
|
||||
let dbAssoc;
|
||||
@@ -337,7 +337,7 @@ function loadNPCTriggerResponsesFromDatabase(npcTriggerDatabaseId) {
|
||||
disconnectFromDatabase(dbConnection);
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.NPC]: ${tempNPCTriggerResponses.length} responses loaded for trigger ${npcTriggerDatabaseId} from database successfully!`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.NPC]: ${tempNPCTriggerResponses.length} responses loaded for trigger ${npcTriggerDatabaseId} from database successfully!`);
|
||||
return tempNPCTriggerResponses;
|
||||
}
|
||||
|
||||
@@ -357,28 +357,28 @@ function saveAllNPCsToDatabase() {
|
||||
|
||||
function saveNPCToDatabase(npcDataId) {
|
||||
if (getServerConfig().devServer) {
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.NPC]: NPC ${npcDataId} can't be saved because server is running as developer only. Aborting save ...`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.NPC]: NPC ${npcDataId} can't be saved because server is running as developer only. Aborting save ...`);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getNPCData(npcDataId) == false) {
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.NPC]: NPC ${npcDataId} data is invalid. Aborting save ...`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.NPC]: NPC ${npcDataId} data is invalid. Aborting save ...`);
|
||||
return false;
|
||||
}
|
||||
|
||||
let tempNPCData = getNPCData(npcDataId);
|
||||
|
||||
if (tempNPCData.databaseId == -1) {
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.NPC]: NPC ${npcDataId} is a temp NPC. Aborting save ...`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.NPC]: NPC ${npcDataId} is a temp NPC. Aborting save ...`);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!tempNPCData.needsSaved) {
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.NPC]: NPC ${npcDataId} hasn't changed data. Aborting save ...`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.NPC]: NPC ${npcDataId} hasn't changed data. Aborting save ...`);
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.NPC]: Saving NPC ${tempNPCData.databaseId} to database ...`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.NPC]: Saving NPC ${tempNPCData.databaseId} to database ...`);
|
||||
let dbConnection = connectToDatabase();
|
||||
if (dbConnection) {
|
||||
if (tempNPCData.ped != false) {
|
||||
@@ -445,7 +445,7 @@ function saveNPCToDatabase(npcDataId) {
|
||||
disconnectFromDatabase(dbConnection);
|
||||
return true;
|
||||
}
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.NPC]: Saved NPC ${npcDataId} to database!`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.NPC]: Saved NPC ${npcDataId} to database!`);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ function startPaintBall(client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.PaintBall]: Starting paintball for ${getPlayerDisplayForConsole(client)} ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.PaintBall]: Starting paintball for ${getPlayerDisplayForConsole(client)} ...`);
|
||||
if (isPlayerWorking(client)) {
|
||||
stopWorking(client);
|
||||
}
|
||||
@@ -79,7 +79,7 @@ function startPaintBall(client) {
|
||||
|
||||
messagePlayerAlert(client, getLocaleString(client, "JoinedPaintBall"));
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.PaintBall]: Started paintball for ${getPlayerDisplayForConsole(client)} successfully`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.PaintBall]: Started paintball for ${getPlayerDisplayForConsole(client)} successfully`);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -89,7 +89,7 @@ function stopPaintBall(client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.PaintBall]: Stopping paintball for ${getPlayerDisplayForConsole(client)} ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.PaintBall]: Stopping paintball for ${getPlayerDisplayForConsole(client)} ...`);
|
||||
clearPlayerWeapons(client);
|
||||
deletePaintBallItems(client);
|
||||
restorePlayerTempLockerItems(client);
|
||||
@@ -119,13 +119,13 @@ function stopPaintBall(client) {
|
||||
|
||||
//checkRemainingPaintBallPlayers(tempBusiness);
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.PaintBall]: Stopped paintball for ${getPlayerDisplayForConsole(client)} successfully`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.PaintBall]: Stopped paintball for ${getPlayerDisplayForConsole(client)} successfully`);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function givePlayerPaintBallItems(client) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.PaintBall]: Giving ${getPlayerDisplayForConsole(client)} paintball items ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.PaintBall]: Giving ${getPlayerDisplayForConsole(client)} paintball items ...`);
|
||||
for (let i in paintBallItems) {
|
||||
let itemId = createItem(paintBallItems[i], 999999, V_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId);
|
||||
getItemData(itemId).needsSaved = false;
|
||||
@@ -135,26 +135,26 @@ function givePlayerPaintBallItems(client) {
|
||||
getPlayerData(client).paintBallItemCache.push(itemId);
|
||||
updatePlayerHotBar(client);
|
||||
}
|
||||
logToConsole(LOG_DEBUG, `[AGRP.PaintBall]: Gave ${getPlayerDisplayForConsole(client)} paintball items successfully`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.PaintBall]: Gave ${getPlayerDisplayForConsole(client)} paintball items successfully`);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function deletePaintBallItems(client) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.PaintBall]: Deleting paintball items for ${getPlayerDisplayForConsole(client)} ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.PaintBall]: Deleting paintball items for ${getPlayerDisplayForConsole(client)} ...`);
|
||||
for (let i in getPlayerData(client).paintBallItemCache) {
|
||||
deleteItem(getPlayerData(client).paintBallItemCache[i]);
|
||||
}
|
||||
|
||||
cachePlayerHotBarItems(client);
|
||||
updatePlayerHotBar(client);
|
||||
logToConsole(LOG_DEBUG, `[AGRP.PaintBall]: Deleting paintball items for ${getPlayerDisplayForConsole(client)} successfully`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.PaintBall]: Deleting paintball items for ${getPlayerDisplayForConsole(client)} successfully`);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function cacheAllPaintBallItemTypes() {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.PaintBall]: Cacheing all paintball item types ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.PaintBall]: Cacheing all paintball item types ...`);
|
||||
for (let i in paintBallItemNames[getGame()]) {
|
||||
let itemTypeId = getItemTypeFromParams(paintBallItemNames[getGame()][i]);
|
||||
if (itemTypeId != -1 && getItemTypeData(itemTypeId) != false) {
|
||||
@@ -162,13 +162,13 @@ function cacheAllPaintBallItemTypes() {
|
||||
}
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.PaintBall]: Cached all paintball item types`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.PaintBall]: Cached all paintball item types`);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function respawnPlayerForPaintBall(client) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.PaintBall]: Respawning ${getPlayerDisplayForConsole(client)} for paintball ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.PaintBall]: Respawning ${getPlayerDisplayForConsole(client)} for paintball ...`);
|
||||
despawnPlayer(client);
|
||||
|
||||
let businessId = getPlayerData(client).paintBallBusiness;
|
||||
@@ -183,7 +183,7 @@ function respawnPlayerForPaintBall(client) {
|
||||
makePlayerStopAnimation(client);
|
||||
setPlayerControlState(client, true);
|
||||
resetPlayerBlip(client);
|
||||
logToConsole(LOG_DEBUG, `[AGRP.PaintBall]: Respawned ${getPlayerDisplayForConsole(client)} for paintball successfully`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.PaintBall]: Respawned ${getPlayerDisplayForConsole(client)} for paintball successfully`);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
@@ -32,7 +32,7 @@ function playerPromptAnswerNo(client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Prompt] ${getPlayerDisplayForConsole(client)} answered NO to their prompt (${getPlayerData(client).promptType})`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Prompt] ${getPlayerDisplayForConsole(client)} answered NO to their prompt (${getPlayerData(client).promptType})`);
|
||||
|
||||
switch (getPlayerData(client).promptType) {
|
||||
case V_PROMPT_CREATEFIRSTCHAR:
|
||||
@@ -71,7 +71,7 @@ function playerPromptAnswerYes(client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Prompt] ${getPlayerDisplayForConsole(client)} answered YES to their prompt (${getPlayerData(client).promptType})`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Prompt] ${getPlayerDisplayForConsole(client)} answered YES to their prompt (${getPlayerData(client).promptType})`);
|
||||
|
||||
switch (getPlayerData(client).promptType) {
|
||||
case V_PROMPT_CREATEFIRSTCHAR: {
|
||||
@@ -82,7 +82,7 @@ function playerPromptAnswerYes(client) {
|
||||
case V_PROMPT_BIZORDER: {
|
||||
if (getPlayerData(client).businessOrderAmount > 0) {
|
||||
if (getBusinessData(getPlayerData(client).businessOrderBusiness).till < getPlayerData(client).businessOrderCost) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Prompt] ${getPlayerDisplayForConsole(client)} failed to order ${getPlayerData(client).businessOrderAmount} ${getItemTypeData(getPlayerData(client).businessOrderItem).name} at ${getPlayerData(client).businessOrderCost / getPlayerData(client).businessOrderAmount} each for business ${getBusinessData(getPlayerData(client).businessOrderBusiness).name} (Reason: Not enough money in business till)`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Prompt] ${getPlayerDisplayForConsole(client)} failed to order ${getPlayerData(client).businessOrderAmount} ${getItemTypeData(getPlayerData(client).businessOrderItem).name} at ${getPlayerData(client).businessOrderCost / getPlayerData(client).businessOrderAmount} each for business ${getBusinessData(getPlayerData(client).businessOrderBusiness).name} (Reason: Not enough money in business till)`);
|
||||
if (doesPlayerHaveGUIEnabled(client)) {
|
||||
showPlayerErrorGUI(client, getLocaleString(client, "BusinessOrderNotEnoughMoney", `{ALTCOLOUR}/bizdeposit{MAINCOLOUR}`), getLocaleString(client, "BusinessOrderCanceled"));
|
||||
} else {
|
||||
@@ -93,7 +93,7 @@ function playerPromptAnswerYes(client) {
|
||||
getPlayerData(client).businessOrderItem = -1;
|
||||
getPlayerData(client).businessOrderValue = -1;
|
||||
} else {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Prompt] ${getPlayerDisplayForConsole(client)} successfully ordered ${getPlayerData(client).businessOrderAmount} ${getItemTypeData(getPlayerData(client).businessOrderItem).name} at ${getPlayerData(client).businessOrderCost / getPlayerData(client).businessOrderAmount} each for business ${getBusinessData(getPlayerData(client).businessOrderBusiness).name}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Prompt] ${getPlayerDisplayForConsole(client)} successfully ordered ${getPlayerData(client).businessOrderAmount} ${getItemTypeData(getPlayerData(client).businessOrderItem).name} at ${getPlayerData(client).businessOrderCost / getPlayerData(client).businessOrderAmount} each for business ${getBusinessData(getPlayerData(client).businessOrderBusiness).name}`);
|
||||
|
||||
showPlayerInfoGUI(client, getLocaleString(client, "BusinessOrderSuccessInfo", getPlayerData(client).businessOrderAmount, getItemTypeData(getPlayerData(client).businessOrderItem).name, getItemValueDisplay(getPlayerData(client).businessOrderItem, getPlayerData(client).businessOrderValue), getPlayerData(client).businessOrderCost), getLocaleString(client, "GUIInfoTitle"));
|
||||
createItem(getPlayerData(client).businessOrderItem, getPlayerData(client).businessOrderValue, V_ITEM_OWNER_BIZFLOOR, getBusinessData(getPlayerData(client).businessOrderBusiness).databaseId, getPlayerData(client).businessOrderAmount);
|
||||
|
||||
@@ -190,20 +190,20 @@ function loadPropertiesFromDatabase() {
|
||||
let tempPropertyData = new PropertyData(dbAssoc[i]);
|
||||
tempPropertyData.locations = loadPropertyLocationsFromDatabase(tempPropertyData.databaseId);
|
||||
tempProperties.push(tempPropertyData);
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Property]: Property '${tempPropertyData.name}' (ID ${tempPropertyData.databaseId}) loaded from database successfully!`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Property]: Property '${tempPropertyData.name}' (ID ${tempPropertyData.databaseId}) loaded from database successfully!`);
|
||||
}
|
||||
}
|
||||
disconnectFromDatabase(dbConnection);
|
||||
}
|
||||
|
||||
logToConsole(LOG_INFO, `[AGRP.Property]: ${tempProperties.length} properties loaded from database successfully!`);
|
||||
logToConsole(LOG_INFO, `[V.RP.Property]: ${tempProperties.length} properties loaded from database successfully!`);
|
||||
return tempProperties;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function loadPropertyLocationsFromDatabase(propertyIndex) {
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Property]: Loading property locations for property ${propertyIndex} from database ...`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Property]: Loading property locations for property ${propertyIndex} from database ...`);
|
||||
|
||||
let tempPropertyLocations = [];
|
||||
let dbConnection = connectToDatabase();
|
||||
@@ -219,7 +219,7 @@ function loadPropertyLocationsFromDatabase(propertyIndex) {
|
||||
for (let i in dbAssoc) {
|
||||
let tempPropertyLocationData = new PropertyLocationData(dbAssoc[i]);
|
||||
tempPropertyLocations.push(tempPropertyLocationData);
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Property]: Location '${tempPropertyLocationData.name}' loaded from database successfully!`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Property]: Location '${tempPropertyLocationData.name}' loaded from database successfully!`);
|
||||
}
|
||||
}
|
||||
freeDatabaseQuery(dbQuery);
|
||||
@@ -227,7 +227,7 @@ function loadPropertyLocationsFromDatabase(propertyIndex) {
|
||||
disconnectFromDatabase(dbConnection);
|
||||
}
|
||||
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Property]: ${tempPropertyLocations.length} location for property ${propertyIndex} loaded from database successfully!`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Property]: ${tempPropertyLocations.length} location for property ${propertyIndex} loaded from database successfully!`);
|
||||
return tempPropertyLocations;
|
||||
}
|
||||
|
||||
@@ -1208,7 +1208,7 @@ function orderItemForPropertyCommand(command, params, client) {
|
||||
let value = toInteger(splitParams.slice(-1)) || getItemTypeData(itemType).capacity;
|
||||
let propertyIndex = getPlayerProperty(client);
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Property] ${getPlayerDisplayForConsole(client)} is ordering ${amount} ${splitParams.slice(0, -2).join(" ")} (${value})`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Property] ${getPlayerDisplayForConsole(client)} is ordering ${amount} ${splitParams.slice(0, -2).join(" ")} (${value})`);
|
||||
|
||||
if (!getPropertyData(propertyIndex)) {
|
||||
messagePlayerError(client, getLocaleString(client, "InvalidProperty"));
|
||||
@@ -1460,7 +1460,7 @@ function savePropertyToDatabase(propertyIndex) {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Property]: Saving business '${tempPropertyData.name}' to database ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Property]: Saving business '${tempPropertyData.name}' to database ...`);
|
||||
let dbConnection = connectToDatabase();
|
||||
if (dbConnection) {
|
||||
let safePropertyName = escapeDatabaseString(dbConnection, tempPropertyData.name);
|
||||
@@ -1516,7 +1516,7 @@ function savePropertyToDatabase(propertyIndex) {
|
||||
disconnectFromDatabase(dbConnection);
|
||||
return true;
|
||||
}
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Property]: Saved property '${tempPropertyData.name}' to database!`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Property]: Saved property '${tempPropertyData.name}' to database!`);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -1575,7 +1575,7 @@ function createPropertyEntrancePickup(propertyIndex) {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Creating entrance pickup for property ${propertyData.name}`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Job]: Creating entrance pickup for property ${propertyData.name}`);
|
||||
|
||||
if (areServerElementsSupported() && getGame() != V_GAME_MAFIA_ONE) {
|
||||
let entrancePickup = null;
|
||||
@@ -1652,7 +1652,7 @@ function createPropertyEntranceBlip(propertyIndex) {
|
||||
blipModelId = propertyData.entranceBlipModel;
|
||||
}
|
||||
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Creating entrance blip for business ${propertyData.name} (model ${blipModelId})`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Job]: Creating entrance blip for business ${propertyData.name} (model ${blipModelId})`);
|
||||
|
||||
if (areServerElementsSupported()) {
|
||||
let entranceBlip = createGameBlip(propertyData.entrancePosition, blipModelId, 1, getColourByType("propertyColour"));
|
||||
@@ -1697,7 +1697,7 @@ function createPropertyExitPickup(propertyIndex) {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Creating exit pickup for business ${propertyData.name}`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Job]: Creating exit pickup for business ${propertyData.name}`);
|
||||
|
||||
let exitPickup = null;
|
||||
if (isGameFeatureSupported("pickup")) {
|
||||
@@ -1764,7 +1764,7 @@ function createPropertyExitBlip(propertyIndex) {
|
||||
blipModelId = propertyData.exitBlipModel;
|
||||
}
|
||||
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Creating exit blip for property ${propertyData.name} (model ${blipModelId})`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Job]: Creating exit blip for property ${propertyData.name} (model ${blipModelId})`);
|
||||
|
||||
let exitBlip = createGameBlip(propertyData.exitPosition, blipModelId, 1, getColourByName("propertyColour"));
|
||||
if (exitBlip != null) {
|
||||
@@ -2270,11 +2270,11 @@ function cachePropertyItems(propertyIndex) {
|
||||
clearArray(getPropertyData(propertyIndex).storageItemCache);
|
||||
|
||||
//let propertyData = getPropertyData(propertyIndex);
|
||||
//logToConsole(LOG_VERBOSE, `[AGRP.Property] Caching business items for business ${propertyIndex} (${propertyData.name}) ...`);
|
||||
//logToConsole(LOG_VERBOSE, `[V.RP.Property] Caching business items for business ${propertyIndex} (${propertyData.name}) ...`);
|
||||
//getPropertyData(propertyIndex).floorItemCache = getServerData().items.filter(item => item.ownerType == V_ITEM_OWNER_BIZFLOOR && item.ownerId == propertyData.databaseId).map(i => i.index);
|
||||
//getPropertyData(propertyIndex).storageItemCache = getServerData().items.filter(item => item.ownerType == V_ITEM_OWNER_BIZSTORAGE && item.ownerId == propertyData.databaseId);
|
||||
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Property] Caching business items for business ${propertyIndex} (${getPropertyData(propertyIndex).name}) ...`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Property] Caching business items for business ${propertyIndex} (${getPropertyData(propertyIndex).name}) ...`);
|
||||
for (let i in getServerData().items) {
|
||||
if (getItemData(i).ownerType == V_ITEM_OWNER_BIZFLOOR && getItemData(i).ownerId == getPropertyData(propertyIndex).databaseId) {
|
||||
getPropertyData(propertyIndex).floorItemCache.push(i);
|
||||
@@ -2283,7 +2283,7 @@ function cachePropertyItems(propertyIndex) {
|
||||
}
|
||||
}
|
||||
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Property] Successfully cached ${getPropertyData(propertyIndex).floorItemCache.length} floor items and ${getPropertyData(propertyIndex).storageItemCache} storage items for business ${propertyIndex} (${getPropertyData(propertyIndex).name})!`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Property] Successfully cached ${getPropertyData(propertyIndex).floorItemCache.length} floor items and ${getPropertyData(propertyIndex).storageItemCache} storage items for business ${propertyIndex} (${getPropertyData(propertyIndex).name})!`);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
@@ -53,7 +53,7 @@ function loadRadioStationsFromDatabase() {
|
||||
disconnectFromDatabase(dbConnection);
|
||||
}
|
||||
|
||||
logToConsole(LOG_INFO, `[AGRP.Radio]: ${tempRadioStations.length} radio stations loaded from database successfully!`);
|
||||
logToConsole(LOG_INFO, `[V.RP.Radio]: ${tempRadioStations.length} radio stations loaded from database successfully!`);
|
||||
return tempRadioStations;
|
||||
}
|
||||
|
||||
|
||||
@@ -220,7 +220,7 @@ function loadSubAccountsFromAccount(accountId) {
|
||||
let jobRankIndex = getJobRankIndexFromDatabaseId(jobIndex, tempSubAccount.jobRank);
|
||||
if (!getJobRankData(jobIndex, jobRankIndex)) {
|
||||
let newJobRankIndex = getLowestJobRank(jobIndex);
|
||||
console.log(`[AGRP.SubAccount]: Job ${jobIndex} has no rank ${tempSubAccount.jobRank}! Using lowest rank ${newJobRankIndex} instead.`);
|
||||
console.log(`[V.RP.SubAccount]: Job ${jobIndex} has no rank ${tempSubAccount.jobRank}! Using lowest rank ${newJobRankIndex} instead.`);
|
||||
tempSubAccount.jobRank = getJobRankData(jobIndex, newJobRankIndex).databaseId;
|
||||
tempSubAccount.jobRankIndex = newJobRankIndex;
|
||||
} else {
|
||||
@@ -339,7 +339,7 @@ function saveSubAccountToDatabase(subAccountData) {
|
||||
// ===========================================================================
|
||||
|
||||
function createSubAccount(accountId, firstName, lastName) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Account] Attempting to create subaccount ${firstName} ${lastName} in database`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Account] Attempting to create subaccount ${firstName} ${lastName} in database`);
|
||||
|
||||
let dbConnection = connectToDatabase();
|
||||
let dbQuery = false;
|
||||
@@ -373,7 +373,7 @@ function showCharacterSelectToClient(client) {
|
||||
|
||||
if (doesPlayerHaveAutoSelectLastCharacterEnabled(client)) {
|
||||
if (getPlayerData(client).subAccounts.length > 0) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.SubAccount] ${getPlayerDisplayForConsole(client)} is being auto-spawned as character ID ${getPlayerLastUsedSubAccount(client)}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.SubAccount] ${getPlayerDisplayForConsole(client)} is being auto-spawned as character ID ${getPlayerLastUsedSubAccount(client)}`);
|
||||
selectCharacter(client, getPlayerLastUsedSubAccount(client));
|
||||
return true;
|
||||
}
|
||||
@@ -381,7 +381,7 @@ function showCharacterSelectToClient(client) {
|
||||
|
||||
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
|
||||
getPlayerData(client).currentSubAccount = 0;
|
||||
logToConsole(LOG_DEBUG, `[AGRP.SubAccount] Setting ${getPlayerDisplayForConsole(client)}'s character to ID ${getPlayerData(client).currentSubAccount}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.SubAccount] Setting ${getPlayerDisplayForConsole(client)}'s character to ID ${getPlayerData(client).currentSubAccount}`);
|
||||
let tempSubAccount = getPlayerData(client).subAccounts[0];
|
||||
let clanName = (tempSubAccount.clan != 0) ? getClanData(getClanIndexFromDatabaseId(tempSubAccount.clan)).name : "None";
|
||||
let lastPlayedText = (tempSubAccount.lastLogin != 0) ? `${msToTime(getCurrentUnixTimestamp() - tempSubAccount.lastLogin)} ago` : "Never";
|
||||
@@ -391,7 +391,7 @@ function showCharacterSelectToClient(client) {
|
||||
//setTimeout(function() {
|
||||
// showCharacterSelectCameraToPlayer(client);
|
||||
//}, 500);
|
||||
logToConsole(LOG_DEBUG, `[AGRP.SubAccount] ${getPlayerDisplayForConsole(client)} is being shown the character select GUI`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.SubAccount] ${getPlayerDisplayForConsole(client)} is being shown the character select GUI`);
|
||||
} else {
|
||||
let charactersList = getPlayerData(client).subAccounts.map((sacct, index) => `{teal}${index + 1}: {ALTCOLOUR}${sacct.firstName} ${sacct.lastName}`);
|
||||
let chunkedList = splitArrayIntoChunks(charactersList, 5);
|
||||
@@ -400,7 +400,7 @@ function showCharacterSelectToClient(client) {
|
||||
messagePlayerNormal(client, chunkedList[i].join("{MAINCOLOUR} • "));
|
||||
}
|
||||
messagePlayerInfo(client, getLocaleString(client, "CharacterSelectHelpText", `{ALTCOLOUR}/usechar{MAINCOLOUR}`, `{ALTCOLOUR}/newchar{MAINCOLOUR}`));
|
||||
logToConsole(LOG_DEBUG, `[AGRP.SubAccount] ${getPlayerDisplayForConsole(client)} is being shown the character select/list message (GUI disabled)`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.SubAccount] ${getPlayerDisplayForConsole(client)} is being shown the character select/list message (GUI disabled)`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -420,7 +420,7 @@ function checkNewCharacter(client, firstName, lastName) {
|
||||
lastName = lastName.trim();
|
||||
|
||||
if (doesNameContainInvalidCharacters(firstName) || doesNameContainInvalidCharacters(lastName)) {
|
||||
logToConsole(LOG_INFO | LOG_WARN, `[AGRP.Account] Subaccount ${firstName} ${lastName} could not be created (invalid characters in name)`);
|
||||
logToConsole(LOG_INFO | LOG_WARN, `[V.RP.Account] Subaccount ${firstName} ${lastName} could not be created (invalid characters in name)`);
|
||||
showPlayerNewCharacterFailedGUI(client, "Invalid characters in name!");
|
||||
return false;
|
||||
}
|
||||
@@ -467,7 +467,7 @@ function checkPreviousCharacter(client) {
|
||||
let lastPlayedText = (tempSubAccount.lastLogin != 0) ? `${msToTime(getCurrentUnixTimestamp() - tempSubAccount.lastLogin)} ago` : "Never";
|
||||
showPlayerCharacterSelectGUI(client, tempSubAccount.firstName, tempSubAccount.lastName, tempSubAccount.cash, clanName, lastPlayedText, getGameConfig().skins[getGame()][tempSubAccount.skin][0]);
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.SubAccount] Setting ${getPlayerDisplayForConsole(client)}'s character to ID ${getPlayerData(client).currentSubAccount}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.SubAccount] Setting ${getPlayerDisplayForConsole(client)}'s character to ID ${getPlayerData(client).currentSubAccount}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -488,16 +488,16 @@ function checkNextCharacter(client) {
|
||||
let lastPlayedText = (tempSubAccount.lastLogin != 0) ? `${msToTime(getCurrentUnixTimestamp() - tempSubAccount.lastLogin)} ago` : "Never";
|
||||
showPlayerCharacterSelectGUI(client, tempSubAccount.firstName, tempSubAccount.lastName, tempSubAccount.cash, clanName, lastPlayedText, getGameConfig().skins[getGame()][tempSubAccount.skin][0]);
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.SubAccount] Setting ${getPlayerDisplayForConsole(client)}'s character to ID ${getPlayerData(client).currentSubAccount}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.SubAccount] Setting ${getPlayerDisplayForConsole(client)}'s character to ID ${getPlayerData(client).currentSubAccount}`);
|
||||
}
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function selectCharacter(client, characterId = -1) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.SubAccount] ${getPlayerDisplayForConsole(client)} character select called (Character ID ${characterId})`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.SubAccount] ${getPlayerDisplayForConsole(client)} character select called (Character ID ${characterId})`);
|
||||
if (characterId != -1) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.SubAccount] ${getPlayerDisplayForConsole(client)} provided character ID (${characterId}) to spawn with`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.SubAccount] ${getPlayerDisplayForConsole(client)} provided character ID (${characterId}) to spawn with`);
|
||||
getPlayerData(client).currentSubAccount = characterId;
|
||||
}
|
||||
|
||||
@@ -511,7 +511,7 @@ function selectCharacter(client, characterId = -1) {
|
||||
|
||||
getPlayerData(client).switchingCharacter = false;
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.SubAccount] Spawning ${getPlayerDisplayForConsole(client)} as character ID ${getPlayerData(client).currentSubAccount} with skin ${skin} (${spawnPosition.x}, ${spawnPosition.y}, ${spawnPosition.z})`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.SubAccount] Spawning ${getPlayerDisplayForConsole(client)} as character ID ${getPlayerData(client).currentSubAccount} with skin ${skin} (${spawnPosition.x}, ${spawnPosition.y}, ${spawnPosition.z})`);
|
||||
//setPlayerCameraLookAt(client, getPosBehindPos(spawnPosition, spawnHeading, 5), spawnPosition);
|
||||
getPlayerData(client).pedState = V_PEDSTATE_SPAWNING;
|
||||
|
||||
@@ -520,14 +520,14 @@ function selectCharacter(client, characterId = -1) {
|
||||
onPlayerSpawn(client);
|
||||
} else if (getGame() == V_GAME_MAFIA_ONE) {
|
||||
//spawnPlayer(client, spawnPosition, spawnHeading, getGameConfig().skins[getGame()][skin][0]);
|
||||
//logToConsole(LOG_DEBUG, `[AGRP.SubAccount] Spawning ${getPlayerDisplayForConsole(client)} as ${getGameConfig().skins[getGame()][skin][1]} (${getGameConfig().skins[getGame()][skin][0]})`);
|
||||
//logToConsole(LOG_DEBUG, `[V.RP.SubAccount] Spawning ${getPlayerDisplayForConsole(client)} as ${getGameConfig().skins[getGame()][skin][1]} (${getGameConfig().skins[getGame()][skin][0]})`);
|
||||
spawnPlayer(client, spawnPosition, spawnHeading, getGameConfig().skins[getGame()][skin][0]);
|
||||
onPlayerSpawn(client);
|
||||
}
|
||||
|
||||
//removePlayerKeyBind(client, getKeyIdFromParams("insert"));
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.SubAccount] Spawned ${getPlayerDisplayForConsole(client)} as character ID ${getPlayerData(client).currentSubAccount} with skin ${skin} (${spawnPosition.x}, ${spawnPosition.y}, ${spawnPosition.z})`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.SubAccount] Spawned ${getPlayerDisplayForConsole(client)} as character ID ${getPlayerData(client).currentSubAccount} with skin ${skin} (${spawnPosition.x}, ${spawnPosition.y}, ${spawnPosition.z})`);
|
||||
|
||||
getPlayerCurrentSubAccount(client).lastLogin = getCurrentUnixTimestamp();
|
||||
}
|
||||
@@ -535,14 +535,14 @@ function selectCharacter(client, characterId = -1) {
|
||||
// ===========================================================================
|
||||
|
||||
function switchCharacterCommand(command, params, client) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.SubAccount] ${getPlayerDisplayForConsole(client)} is requesting to switch characters (current character: ${getCharacterFullName(client)} [${getPlayerData(client).currentSubAccount}/${getPlayerCurrentSubAccount(client).databaseId}])`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.SubAccount] ${getPlayerDisplayForConsole(client)} is requesting to switch characters (current character: ${getCharacterFullName(client)} [${getPlayerData(client).currentSubAccount}/${getPlayerCurrentSubAccount(client).databaseId}])`);
|
||||
if (!isPlayerSpawned(client)) {
|
||||
logToConsole(LOG_WARN, `[AGRP.SubAccount] ${getPlayerDisplayForConsole(client)} is not allowed to switch characters (not spawned)`);
|
||||
logToConsole(LOG_WARN, `[V.RP.SubAccount] ${getPlayerDisplayForConsole(client)} is not allowed to switch characters (not spawned)`);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isPlayerSwitchingCharacter(client)) {
|
||||
logToConsole(LOG_WARN, `[AGRP.SubAccount] ${getPlayerDisplayForConsole(client)} is not allowed to switch characters (already in switch char mode)`);
|
||||
logToConsole(LOG_WARN, `[V.RP.SubAccount] ${getPlayerDisplayForConsole(client)} is not allowed to switch characters (already in switch char mode)`);
|
||||
messagePlayerError(client, "You are already selecting/switching characters!");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -103,14 +103,14 @@ function initTimers() {
|
||||
// ===========================================================================
|
||||
|
||||
function oneMinuteTimerFunction() {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Event] Checking server game time`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Event] Checking server game time`);
|
||||
checkServerGameTime();
|
||||
|
||||
if (getClients().length > 0) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Event] Checking rentable vehicles`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Event] Checking rentable vehicles`);
|
||||
checkVehicleRenting();
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Event] Updating all player name tags`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Event] Updating all player name tags`);
|
||||
updateAllPlayerNameTags();
|
||||
}
|
||||
}
|
||||
@@ -244,7 +244,7 @@ function checkServerGameTime() {
|
||||
removeAllPlayersFromProperties();
|
||||
removeAllPlayersFromVehicles();
|
||||
saveServerDataToDatabase();
|
||||
logToConsole(LOG_INFO | LOG_WARN, `[AGRP.Timers] Changing server map to night`);
|
||||
logToConsole(LOG_INFO | LOG_WARN, `[V.RP.Timers] Changing server map to night`);
|
||||
messageDiscordEventChannel("🌙 Changing server map to night");
|
||||
game.changeMap(getGameConfig().mainWorldScene[getGame()]);
|
||||
}
|
||||
@@ -258,7 +258,7 @@ function checkServerGameTime() {
|
||||
removeAllPlayersFromProperties();
|
||||
removeAllPlayersFromVehicles();
|
||||
saveServerDataToDatabase();
|
||||
logToConsole(LOG_INFO | LOG_WARN, `[AGRP.Timers] Changing server map to day`);
|
||||
logToConsole(LOG_INFO | LOG_WARN, `[V.RP.Timers] Changing server map to day`);
|
||||
messageDiscordEventChannel("🌞 Changing server map to day");
|
||||
game.changeMap(getGameConfig().mainWorldScene[getGame()]);
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ function initAllClients() {
|
||||
// ===========================================================================
|
||||
|
||||
function updateServerRules() {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Utilities]: Updating all server rules ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Utilities]: Updating all server rules ...`);
|
||||
|
||||
let timeWeatherRule = [];
|
||||
let tempText = "";
|
||||
@@ -116,7 +116,7 @@ function updateServerRules() {
|
||||
}
|
||||
|
||||
setServerRule("Time & Weather", timeWeatherRule.join(", "));
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Utilities]: All server rules updated successfully!`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Utilities]: All server rules updated successfully!`);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -517,15 +517,15 @@ function removeAllPlayersFromVehicles() {
|
||||
// ===========================================================================
|
||||
|
||||
function processPlayerEnteringExitingProperty(client) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Utilities]: Processing property enter/exit for player ${getPlayerDisplayForConsole(client)} ...`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Utilities]: Processing property enter/exit for player ${getPlayerDisplayForConsole(client)} ...`);
|
||||
if (getPlayerData(client).enteringExitingProperty == null) {
|
||||
logToConsole(LOG_DEBUG | LOG_WARN, `[AGRP.Utilities]: Aborting property enter/exit for player ${getPlayerDisplayForConsole(client)}. Assigned property data is null.`);
|
||||
logToConsole(LOG_DEBUG | LOG_WARN, `[V.RP.Utilities]: Aborting property enter/exit for player ${getPlayerDisplayForConsole(client)}. Assigned property data is null.`);
|
||||
return false;
|
||||
}
|
||||
|
||||
let pedState = getPlayerData(client).pedState;
|
||||
if (pedState != V_PEDSTATE_ENTERINGPROPERTY && pedState != V_PEDSTATE_EXITINGPROPERTY) {
|
||||
logToConsole(LOG_DEBUG | LOG_WARN, `[AGRP.Utilities]: Aborting property enter/exit for player ${getPlayerDisplayForConsole(client)}. Ped state is not entering or exiting property.`);
|
||||
logToConsole(LOG_DEBUG | LOG_WARN, `[V.RP.Utilities]: Aborting property enter/exit for player ${getPlayerDisplayForConsole(client)}. Ped state is not entering or exiting property.`);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -537,14 +537,14 @@ function processPlayerEnteringExitingProperty(client) {
|
||||
}
|
||||
|
||||
if (propertyData == null || propertyData == false) {
|
||||
logToConsole(LOG_DEBUG | LOG_WARN, `[AGRP.Utilities]: Aborting property enter/exit for player ${getPlayerDisplayForConsole(client)}. Property is invalid.`);
|
||||
logToConsole(LOG_DEBUG | LOG_WARN, `[V.RP.Utilities]: Aborting property enter/exit for player ${getPlayerDisplayForConsole(client)}. Property is invalid.`);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (pedState == V_PEDSTATE_ENTERINGPROPERTY) {
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Utilities]: Processing property ENTER for player ${getPlayerDisplayForConsole(client)} ...`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Utilities]: Processing property ENTER for player ${getPlayerDisplayForConsole(client)} ...`);
|
||||
if (isGameFeatureSupported("interiorScene") && propertyData.exitScene != "") {
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Utilities]: Player ${getPlayerDisplayForConsole(client)} is entering a property with interior scene (${propertyData.exitScene})`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Utilities]: Player ${getPlayerDisplayForConsole(client)} is entering a property with interior scene (${propertyData.exitScene})`);
|
||||
spawnPlayer(client, propertyData.exitPosition, propertyData.exitRotation, getGameConfig().skins[getGame()][getPlayerCurrentSubAccount(client).skin][0]);
|
||||
onPlayerSpawn(client);
|
||||
} else {
|
||||
@@ -580,9 +580,9 @@ function processPlayerEnteringExitingProperty(client) {
|
||||
getPlayerData(client).enteringExitingProperty = null;
|
||||
getPlayerData(client).pedState = V_PEDSTATE_READY;
|
||||
} else if (pedState == V_PEDSTATE_EXITINGPROPERTY) {
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Utilities]: Processing property EXIT for player ${getPlayerDisplayForConsole(client)} from property ID ${propertyData.index}/${propertyData.databaseId} ...`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Utilities]: Processing property EXIT for player ${getPlayerDisplayForConsole(client)} from property ID ${propertyData.index}/${propertyData.databaseId} ...`);
|
||||
if (isGameFeatureSupported("interiorScene") && propertyData.entranceScene != "") {
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Utilities]: Player ${getPlayerDisplayForConsole(client)} is exiting a property with external interior scene (${propertyData.entranceScene})`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Utilities]: Player ${getPlayerDisplayForConsole(client)} is exiting a property with external interior scene (${propertyData.entranceScene})`);
|
||||
spawnPlayer(client, propertyData.entrancePosition, propertyData.entranceRotation, getGameConfig().skins[getGame()][getPlayerCurrentSubAccount(client).skin][0]);
|
||||
onPlayerSpawn(client);
|
||||
} else {
|
||||
|
||||
@@ -193,7 +193,7 @@ function loadVehiclesFromDatabase() {
|
||||
disconnectFromDatabase(dbConnection);
|
||||
}
|
||||
|
||||
logToConsole(LOG_INFO, `[AGRP.Vehicle]: ${tempVehicles.length} vehicles loaded from database successfully!`);
|
||||
logToConsole(LOG_INFO, `[V.RP.Vehicle]: ${tempVehicles.length} vehicles loaded from database successfully!`);
|
||||
return tempVehicles;
|
||||
}
|
||||
|
||||
@@ -236,7 +236,7 @@ function saveVehicleToDatabase(vehicleDataId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Vehicle]: Saving vehicle ${tempVehicleData.databaseId} to database ...`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Vehicle]: Saving vehicle ${tempVehicleData.databaseId} to database ...`);
|
||||
let dbConnection = connectToDatabase();
|
||||
if (dbConnection) {
|
||||
if (tempVehicleData.vehicle != false) {
|
||||
@@ -313,7 +313,7 @@ function saveVehicleToDatabase(vehicleDataId) {
|
||||
disconnectFromDatabase(dbConnection);
|
||||
return true;
|
||||
}
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Vehicle]: Saved vehicle ${vehicleDataId} to database!`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Vehicle]: Saved vehicle ${vehicleDataId} to database!`);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -1488,7 +1488,7 @@ function respawnVehicle(vehicle) {
|
||||
// ===========================================================================
|
||||
|
||||
function spawnVehicle(vehicleData) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Vehicle]: Spawning ${getVehicleNameFromModel(vehicleData.model)} at ${vehicleData.spawnPosition.x}, ${vehicleData.spawnPosition.y}, ${vehicleData.spawnPosition.z} with heading ${vehicleData.spawnRotation}`);
|
||||
logToConsole(LOG_DEBUG, `[V.RP.Vehicle]: Spawning ${getVehicleNameFromModel(vehicleData.model)} at ${vehicleData.spawnPosition.x}, ${vehicleData.spawnPosition.y}, ${vehicleData.spawnPosition.z} with heading ${vehicleData.spawnRotation}`);
|
||||
let vehicle = createGameVehicle(vehicleData.model, vehicleData.spawnPosition, vehicleData.spawnRotation);
|
||||
|
||||
if (!vehicle) {
|
||||
@@ -1505,25 +1505,25 @@ function spawnVehicle(vehicleData) {
|
||||
vehicle.setRGBColours(vehicleData.colour1RGBA, vehicleData.colour2RGBA);
|
||||
let colour1 = rgbaArrayFromToColour(vehicleData.colour1RGBA);
|
||||
let colour2 = rgbaArrayFromToColour(vehicleData.colour2RGBA);
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Vehicle]: Setting vehicle ${vehicle.id}'s colours to RGBA [${colour1[0]}, ${colour1[1]}, ${colour1[2]}, ${colour1[3]}], [(]${colour2[0]}, ${colour2[1]}, ${colour2[2]}, ${colour2[3]}]`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Vehicle]: Setting vehicle ${vehicle.id}'s colours to RGBA [${colour1[0]}, ${colour1[1]}, ${colour1[2]}, ${colour1[3]}], [(]${colour2[0]}, ${colour2[1]}, ${colour2[2]}, ${colour2[3]}]`);
|
||||
vehicle.setRGBColours(vehicleData.colour1RGBA, vehicleData.colour2RGBA);
|
||||
} else {
|
||||
setVehicleColours(vehicle, vehicleData.colour1, vehicleData.colour2, vehicleData.colour3, vehicleData.colour4);
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Vehicle]: Setting vehicle ${vehicle.id}'s colours to ${vehicleData.colour1}, ${vehicleData.colour2}, ${vehicleData.colour3}, ${vehicleData.colour4}`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Vehicle]: Setting vehicle ${vehicle.id}'s colours to ${vehicleData.colour1}, ${vehicleData.colour2}, ${vehicleData.colour3}, ${vehicleData.colour4}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (vehicleData.spawnLocked == true) {
|
||||
setVehicleEngine(vehicle, false);
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Vehicle]: Setting vehicle ${vehicle.id}'s engine to OFF`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Vehicle]: Setting vehicle ${vehicle.id}'s engine to OFF`);
|
||||
} else {
|
||||
setVehicleEngine(vehicle, intToBool(vehicleData.engine));
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Vehicle]: Setting vehicle ${vehicle.id}'s engine to ${toUpperCase(getOnOffFromBool(getVehicleEngine(vehicle)))}`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Vehicle]: Setting vehicle ${vehicle.id}'s engine to ${toUpperCase(getOnOffFromBool(getVehicleEngine(vehicle)))}`);
|
||||
}
|
||||
|
||||
if (typeof vehicle.locked != "undefined") {
|
||||
setVehicleLocked(vehicle, intToBool(vehicleData.locked));
|
||||
logToConsole(LOG_VERBOSE, `[AGRP.Vehicle]: Setting vehicle ${vehicle.id}'s lock state to ${toUpperCase(getOnOffFromBool(getVehicleLocked(vehicle)))}`);
|
||||
logToConsole(LOG_VERBOSE, `[V.RP.Vehicle]: Setting vehicle ${vehicle.id}'s lock state to ${toUpperCase(getOnOffFromBool(getVehicleLocked(vehicle)))}`);
|
||||
}
|
||||
|
||||
//setVehicleHealth(vehicle, 1000);
|
||||
|
||||
Reference in New Issue
Block a user