diff --git a/scripts/client/afk.js b/scripts/client/afk.js index b0ca14e5..54f3adc5 100644 --- a/scripts/client/afk.js +++ b/scripts/client/afk.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: afk.js // DESC: Provides AFK detection diff --git a/scripts/client/animation.js b/scripts/client/animation.js index 003b0353..22a2ed52 100644 --- a/scripts/client/animation.js +++ b/scripts/client/animation.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: animation.js // DESC: Provides animation functions and usage diff --git a/scripts/client/business.js b/scripts/client/business.js index a8463221..49fb1911 100644 --- a/scripts/client/business.js +++ b/scripts/client/business.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: business.js // DESC: Provides business functions and usage diff --git a/scripts/client/chatbox.js b/scripts/client/chatbox.js index fd790304..6b9d3ff9 100644 --- a/scripts/client/chatbox.js +++ b/scripts/client/chatbox.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: chatbox.js // DESC: Provides extra chatbox features diff --git a/scripts/client/content.js b/scripts/client/content.js index bcae54d0..f77e4304 100644 --- a/scripts/client/content.js +++ b/scripts/client/content.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: content.js // DESC: Provides connection to extra content resources @@ -9,10 +10,10 @@ function getCustomImage(imageName) { let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]); - if(contentResource != null) { - if(contentResource.isStarted) { + if (contentResource != null) { + if (contentResource.isStarted) { let image = contentResource.exports.getCustomImage(imageName); - if(image != null) { + if (image != null) { return image; } } @@ -24,10 +25,10 @@ function getCustomImage(imageName) { function getCustomFont(fontName) { let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]); - if(contentResource != null) { - if(contentResource.isStarted) { + if (contentResource != null) { + if (contentResource.isStarted) { let font = contentResource.exports.getCustomFont(fontName); - if(font != null) { + if (font != null) { return font; } } @@ -39,10 +40,10 @@ function getCustomFont(fontName) { function getCustomAudio(audioName) { let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]); - if(contentResource != null) { - if(contentResource.isStarted) { + if (contentResource != null) { + if (contentResource.isStarted) { let audioFile = contentResource.exports.getCustomAudio(audioName); - if(audioFile != null) { + if (audioFile != null) { return audioFile; } } @@ -54,8 +55,8 @@ function getCustomAudio(audioName) { function playCustomAudio(audioName, volume = 0.5, loop = false) { let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]); - if(contentResource != null) { - if(contentResource.isStarted) { + if (contentResource != null) { + if (contentResource.isStarted) { contentResource.exports.playCustomAudio(audioName, volume, loop); } } diff --git a/scripts/client/event.js b/scripts/client/event.js index 0d80be09..1b56a662 100644 --- a/scripts/client/event.js +++ b/scripts/client/event.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: event.js // DESC: Provides handlers for built in GTAC and Asshat-Gaming created events diff --git a/scripts/client/gps.js b/scripts/client/gps.js index 8e9d6563..81adfaa4 100644 --- a/scripts/client/gps.js +++ b/scripts/client/gps.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: gps.js // DESC: Provides GPS functions and usage diff --git a/scripts/client/gui.js b/scripts/client/gui.js index a98a2854..3f6e1506 100644 --- a/scripts/client/gui.js +++ b/scripts/client/gui.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: gui.js // DESC: Provides GUI functionality and styles (using MexUI) diff --git a/scripts/client/gui/2fa.js b/scripts/client/gui/2fa.js index 31efe267..e72d09eb 100644 --- a/scripts/client/gui/2fa.js +++ b/scripts/client/gui/2fa.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: 2fa.js // DESC: Provides two factor authentication GUI diff --git a/scripts/client/gui/bizmgr.js b/scripts/client/gui/bizmgr.js index bce4ce16..717eda31 100644 --- a/scripts/client/gui/bizmgr.js +++ b/scripts/client/gui/bizmgr.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: bizmgr.js // DESC: Provides business manager GUI diff --git a/scripts/client/gui/changepass.js b/scripts/client/gui/changepass.js index 0186e1dd..23f09d15 100644 --- a/scripts/client/gui/changepass.js +++ b/scripts/client/gui/changepass.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: changepass.js // DESC: Provides change password GUI diff --git a/scripts/client/gui/charselect.js b/scripts/client/gui/charselect.js index f2068da7..f46f4a9c 100644 --- a/scripts/client/gui/charselect.js +++ b/scripts/client/gui/charselect.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: charselect.js // DESC: Provides character select GUI diff --git a/scripts/client/gui/clanmgr.js b/scripts/client/gui/clanmgr.js index 33348a65..7928a7be 100644 --- a/scripts/client/gui/clanmgr.js +++ b/scripts/client/gui/clanmgr.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: clanmgr.js // DESC: Provides clan manager GUI diff --git a/scripts/client/gui/error.js b/scripts/client/gui/error.js index 360afa9e..65f67f76 100644 --- a/scripts/client/gui/error.js +++ b/scripts/client/gui/error.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: error.js // DESC: Provides error box GUI @@ -17,7 +18,7 @@ let errorDialog = { function initErrorDialogGUI() { logToConsole(LOG_DEBUG, `[VRR.GUI] Creating error GUI ...`); - errorDialog.window = mexui.window(getScreenWidth()/2-200, getScreenHeight()/2-70, 400, 140, 'ERROR', { + errorDialog.window = mexui.window(getScreenWidth() / 2 - 200, getScreenHeight() / 2 - 70, 400, 140, 'ERROR', { main: { backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha), transitionTime: 500, diff --git a/scripts/client/gui/housemgr.js b/scripts/client/gui/housemgr.js index c9bb1c32..1c421d6e 100644 --- a/scripts/client/gui/housemgr.js +++ b/scripts/client/gui/housemgr.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: housemgr.js // DESC: Provides house manager GUI diff --git a/scripts/client/gui/info.js b/scripts/client/gui/info.js index c6066df8..3845de36 100644 --- a/scripts/client/gui/info.js +++ b/scripts/client/gui/info.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: info.js // DESC: Provides info dialog box GUI @@ -16,8 +17,8 @@ let infoDialog = { // =========================================================================== function initInfoDialogGUI() { - logToConsole(LOG_DEBUG, `[VRR.GUI] Creating info dialog GUI ...`); - infoDialog.window = mexui.window(getScreenWidth()/2-200, getScreenHeight()/2-70, 400, 140, 'Information', { + logToConsole(LOG_DEBUG, `[VRR.GUI] Creating info dialog GUI ...`); + infoDialog.window = mexui.window(getScreenWidth() / 2 - 200, getScreenHeight() / 2 - 70, 400, 140, 'Information', { main: { backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha), }, diff --git a/scripts/client/gui/list.js b/scripts/client/gui/list.js index 00d94be9..bbf5f1b3 100644 --- a/scripts/client/gui/list.js +++ b/scripts/client/gui/list.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: list.js // DESC: Provides simple list GUI @@ -16,8 +17,8 @@ let listDialog = { // =========================================================================== function initListGUI() { - logToConsole(LOG_DEBUG, `[VRR.GUI] Creating list dialog GUI ...`); - listDialog.window = mexui.window(game.width/2-200, game.height/2-70, 400, 500, 'List', { + logToConsole(LOG_DEBUG, `[VRR.GUI] Creating list dialog GUI ...`); + listDialog.window = mexui.window(game.width / 2 - 200, game.height / 2 - 70, 400, 500, 'List', { main: { backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha), }, @@ -50,21 +51,21 @@ function initListGUI() { listDialog.listGrid = listDialog.window.grid(5, 25, 390, 450, { main: { - backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha), + backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha), }, column: { - lineColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha), + lineColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha), }, - header: { - backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha-50), - textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], windowTitleAlpha), + header: { + backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha - 50), + textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], windowTitleAlpha), }, cell: { - backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha), - textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], windowTitleAlpha), + backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha), + textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], windowTitleAlpha), }, row: { - lineColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha), + lineColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha), hover: { backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], 120), } diff --git a/scripts/client/gui/localechooser.js b/scripts/client/gui/localechooser.js index e0bdf063..0365939d 100644 --- a/scripts/client/gui/localechooser.js +++ b/scripts/client/gui/localechooser.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: localechooser.js // DESC: Provides locale chooser GUI @@ -19,8 +20,8 @@ let flagImageGap = toVector2(5, 5); // =========================================================================== function initLocaleChooserGUI() { - logToConsole(LOG_DEBUG, `[VRR.GUI] Creating locale chooser GUI ...`); - localeChooser.window = mexui.window(game.width/2-200, game.height-150, 60, 60, 'Choose a language', { + logToConsole(LOG_DEBUG, `[VRR.GUI] Creating locale chooser GUI ...`); + localeChooser.window = mexui.window(game.width / 2 - 200, game.height - 150, 60, 60, 'Choose a language', { main: { backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], 0), }, @@ -53,10 +54,10 @@ function closeLocaleChooserGUI() { // =========================================================================== function showLocaleChooserGUI(position = toVector2(0.0, 0.0)) { - if(position.x != 0.0 && position.y != 0.0) { + if (position.x != 0.0 && position.y != 0.0) { localeChooser.window.position = position; } else { - localeChooser.window.position = toVector2((getScreenWidth()/2)-(localeChooser.window.size.x/2), getScreenHeight()-100); + localeChooser.window.position = toVector2((getScreenWidth() / 2) - (localeChooser.window.size.x / 2), getScreenHeight() - 100); } //closeAllWindows(); @@ -68,7 +69,7 @@ function showLocaleChooserGUI(position = toVector2(0.0, 0.0)) { // =========================================================================== function toggleLocaleChooserGUI() { - if(localeChooser.window.shown) { + if (localeChooser.window.shown) { closeLocaleChooserGUI(); } else { showLocaleChooserGUI(); @@ -78,36 +79,36 @@ function toggleLocaleChooserGUI() { // =========================================================================== function localeChooserSetLocale(localeId) { - logToConsole(LOG_DEBUG|LOG_WARN, `[VRR.GUI] Asking server to change locale to ${localeId}`); + logToConsole(LOG_DEBUG | LOG_WARN, `[VRR.GUI] Asking server to change locale to ${localeId}`); sendLocaleSelectToServer(localeId); } // =========================================================================== function resetLocaleChooserOptions() { - logToConsole(LOG_DEBUG|LOG_WARN, `[VRR.GUI] Resetting locale chooser options`); + logToConsole(LOG_DEBUG | LOG_WARN, `[VRR.GUI] Resetting locale chooser options`); // let tempLocaleOptions = getServerData().localeOptions; // getAvailableLocaleOptions(); let tempLocaleOptions = getAvailableLocaleOptions(); - localeChooser.window.size = toVector2((tempLocaleOptions.length*(flagImageSize.x+flagImageGap.x))+flagImageGap.x, flagImageSize.y+flagImageGap.y*2); - localeChooser.window.position = toVector2((getScreenWidth()/2)-(localeChooser.window.size.x/2), getScreenHeight()-100); + localeChooser.window.size = toVector2((tempLocaleOptions.length * (flagImageSize.x + flagImageGap.x)) + flagImageGap.x, flagImageSize.y + flagImageGap.y * 2); + localeChooser.window.position = toVector2((getScreenWidth() / 2) - (localeChooser.window.size.x / 2), getScreenHeight() - 100); - for(let i in localeChooser.flagImages) { + for (let i in localeChooser.flagImages) { localeChooser.flagImages[i].remove(); } - for(let i in tempLocaleOptions) { + for (let i in tempLocaleOptions) { let imagePath = `files/images/flags/${tempLocaleOptions[i].flagImageFile}`; - localeChooser.flagImages[i] = localeChooser.window.image((i*(flagImageSize.x+flagImageGap.x))+flagImageGap.x, flagImageGap.y, flagImageSize.x, flagImageSize.y, imagePath, { + localeChooser.flagImages[i] = localeChooser.window.image((i * (flagImageSize.x + flagImageGap.x)) + flagImageGap.x, flagImageGap.y, flagImageSize.x, flagImageSize.y, imagePath, { focused: { borderColour: toColour(0, 0, 0, 0), }, - }, function() { + }, function () { localeChooserSetLocale(tempLocaleOptions[i].id); }); - logToConsole(LOG_DEBUG|LOG_WARN, `[VRR.GUI] Created locale chooser option ${tempLocaleOptions[i].englishName} with image ${imagePath}`); + logToConsole(LOG_DEBUG | LOG_WARN, `[VRR.GUI] Created locale chooser option ${tempLocaleOptions[i].englishName} with image ${imagePath}`); //localeChooser.activeRingImages.push(activeRingImage); } diff --git a/scripts/client/gui/login.js b/scripts/client/gui/login.js index 58b9e870..e739f5af 100644 --- a/scripts/client/gui/login.js +++ b/scripts/client/gui/login.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: login.js // DESC: Provides login GUI diff --git a/scripts/client/gui/newchar.js b/scripts/client/gui/newchar.js index bb7871c0..6fbc75ed 100644 --- a/scripts/client/gui/newchar.js +++ b/scripts/client/gui/newchar.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: newchar.js // DESC: Provides new character creation GUI diff --git a/scripts/client/gui/register.js b/scripts/client/gui/register.js index b320528f..7208bdc2 100644 --- a/scripts/client/gui/register.js +++ b/scripts/client/gui/register.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: register.js // DESC: Provides account registration GUI diff --git a/scripts/client/gui/resetpass.js b/scripts/client/gui/resetpass.js index f3aed86c..148f1b30 100644 --- a/scripts/client/gui/resetpass.js +++ b/scripts/client/gui/resetpass.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: resetpass.js // DESC: Provides password reset GUI diff --git a/scripts/client/gui/yesno.js b/scripts/client/gui/yesno.js index fe03350e..554fb094 100644 --- a/scripts/client/gui/yesno.js +++ b/scripts/client/gui/yesno.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: yesno.js // DESC: Provides yes/no prompt dialog GUI diff --git a/scripts/client/house.js b/scripts/client/house.js index 0702b385..26a7df8c 100644 --- a/scripts/client/house.js +++ b/scripts/client/house.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: house.js // DESC: Provides house functions and usage diff --git a/scripts/client/item.js b/scripts/client/item.js index 783426eb..750f2fca 100644 --- a/scripts/client/item.js +++ b/scripts/client/item.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: item.js // DESC: Provides item action and hotbar functions @@ -10,7 +11,7 @@ let itemActionDelayDuration = 0; let itemActionDelayStart = 0; let itemActionDelayEnabled = false; -let itemActionDelayPosition = toVector2(game.width/2-100, game.height-10); +let itemActionDelayPosition = toVector2(game.width / 2 - 100, game.height - 10); let itemActionDelaySize = toVector2(200, 5); // =========================================================================== @@ -23,22 +24,22 @@ function initItemScript() { // =========================================================================== function processItemActionRendering() { - if(renderItemActionDelay) { - if(itemActionDelayEnabled) { - let finishTime = itemActionDelayStart+itemActionDelayDuration; - if(sdl.ticks >= finishTime) { + if (renderItemActionDelay) { + if (itemActionDelayEnabled) { + let finishTime = itemActionDelayStart + itemActionDelayDuration; + if (sdl.ticks >= finishTime) { itemActionDelayEnabled = false; itemActionDelayDuration = 0; itemActionDelayStart = 0; tellServerItemActionDelayComplete(); } else { - let currentTick = sdl.ticks-itemActionDelayStart; - let progressPercent = Math.ceil(currentTick*100/itemActionDelayDuration); + let currentTick = sdl.ticks - itemActionDelayStart; + let progressPercent = Math.ceil(currentTick * 100 / itemActionDelayDuration); let width = Math.ceil(getPercentage(itemActionDelaySize.x, progressPercent)); let backgroundColour = toColour(0, 0, 0, 255); - graphics.drawRectangle(null, [itemActionDelayPosition.x-(itemActionDelaySize.x/2)-1, itemActionDelayPosition.y-(itemActionDelaySize.y/2)-1], [itemActionDelaySize.x+2, itemActionDelaySize.y+2], backgroundColour, backgroundColour, backgroundColour, backgroundColour); - graphics.drawRectangle(null, [itemActionDelayPosition.x-(itemActionDelaySize.x/2), itemActionDelayPosition.y-(itemActionDelaySize.y/2)-2], [width, itemActionDelaySize.y], COLOUR_LIME, COLOUR_LIME, COLOUR_LIME, COLOUR_LIME); + graphics.drawRectangle(null, [itemActionDelayPosition.x - (itemActionDelaySize.x / 2) - 1, itemActionDelayPosition.y - (itemActionDelaySize.y / 2) - 1], [itemActionDelaySize.x + 2, itemActionDelaySize.y + 2], backgroundColour, backgroundColour, backgroundColour, backgroundColour); + graphics.drawRectangle(null, [itemActionDelayPosition.x - (itemActionDelaySize.x / 2), itemActionDelayPosition.y - (itemActionDelaySize.y / 2) - 2], [width, itemActionDelaySize.y], COLOUR_LIME, COLOUR_LIME, COLOUR_LIME, COLOUR_LIME); } } } diff --git a/scripts/client/job.js b/scripts/client/job.js index 9e5f0bae..62f8ddab 100644 --- a/scripts/client/job.js +++ b/scripts/client/job.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: job.js // DESC: Provides job functions and usage diff --git a/scripts/client/keybind.js b/scripts/client/keybind.js index ecc4bcb8..751759b8 100644 --- a/scripts/client/keybind.js +++ b/scripts/client/keybind.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: keybind.js // DESC: Provides keybind features @@ -25,13 +26,13 @@ function initKeyBindScript() { function bindAccountKey(key, keyState) { logToConsole(LOG_DEBUG, `[VRR.KeyBind]: Binded key ${toUpperCase(getKeyNameFromId(key))} (${key})`); keyBinds.push(toInteger(key)); - bindKey(toInteger(key), keyState, function(event) { - if(isAnyGUIActive()) { + bindKey(toInteger(key), keyState, function (event) { + if (isAnyGUIActive()) { return false; } - if(hasKeyBindDelayElapsed()) { - if(canLocalPlayerUseKeyBinds()) { + if (hasKeyBindDelayElapsed()) { + if (canLocalPlayerUseKeyBinds()) { logToConsole(LOG_DEBUG, `[VRR.KeyBind]: Using keybind for key ${toUpperCase(getKeyNameFromId(key))} (${key})`); lastKeyBindUse = sdl.ticks; tellServerPlayerUsedKeyBind(key); @@ -56,7 +57,7 @@ function unBindAccountKey(key) { // =========================================================================== function hasKeyBindDelayElapsed() { - if(sdl.ticks-lastKeyBindUse >= keyBindDelayTime) { + if (sdl.ticks - lastKeyBindUse >= keyBindDelayTime) { return true; } @@ -66,15 +67,15 @@ function hasKeyBindDelayElapsed() { // =========================================================================== function canLocalPlayerUseKeyBinds() { - if(isAnyGUIActive()) { + if (isAnyGUIActive()) { return false; } - if(!isSpawned) { + if (!isSpawned) { return false; } - if(itemActionDelayEnabled) { + if (itemActionDelayEnabled) { return false; } @@ -84,7 +85,7 @@ function canLocalPlayerUseKeyBinds() { // =========================================================================== function clearKeyBinds() { - for(let i in keyBinds) { + for (let i in keyBinds) { unbindKey(keyBinds[i]); } keyBinds = []; diff --git a/scripts/client/label.js b/scripts/client/label.js index 9259bca6..0bcf32bb 100644 --- a/scripts/client/label.js +++ b/scripts/client/label.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: labels.js // DESC: Provides functionality for world labels (3D labels) diff --git a/scripts/client/locale.js b/scripts/client/locale.js index f8218340..c2677556 100644 --- a/scripts/client/locale.js +++ b/scripts/client/locale.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: locale.js // DESC: Provides locale functions and usage @@ -8,18 +9,18 @@ // =========================================================================== function getLocaleString(stringName, ...args) { - if(typeof getServerData().localeStrings[localLocaleId][stringName] == undefined) { + if (typeof getServerData().localeStrings[localLocaleId][stringName] == undefined) { return ""; } let tempString = getServerData().localeStrings[localLocaleId][stringName]; - if(tempString == "" || tempString == null || tempString == undefined) { + if (tempString == "" || tempString == null || tempString == undefined) { return ""; } - for(let i = 1; i <= args.length; i++) { - tempString = tempString.replace(`{${i}}`, args[i-1]); + for (let i = 1; i <= args.length; i++) { + tempString = tempString.replace(`{${i}}`, args[i - 1]); } return tempString; @@ -42,7 +43,7 @@ function loadLocaleConfig() { function loadAllLocaleStrings() { let localeOptions = getServerData().localeOptions; - for(let i in localeOptions) { + for (let i in localeOptions) { logToConsole(LOG_INFO, `[VRR.Locale] Loading locale strings for ${localeOptions[i].englishName} (${i})`); let localeFile = loadTextFile(`locale/${localeOptions[i].stringsFile}`); let localeData = JSON.parse(localeFile); diff --git a/scripts/client/logo.js b/scripts/client/logo.js index 9a23f20b..33eb812e 100644 --- a/scripts/client/logo.js +++ b/scripts/client/logo.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: logo.js // DESC: Provides logo rendering functions @@ -8,7 +9,7 @@ // =========================================================================== let logoImage = null; -let logoPos = toVector2(game.width-132, game.height-132); +let logoPos = toVector2(game.width - 132, game.height - 132); let logoSize = toVector2(128, 128); // =========================================================================== @@ -24,7 +25,7 @@ function initLogoScript() { function loadLogoImage() { let logoStream = openFile(mainLogoPath); let tempLogoImage = null; - if(logoStream != null) { + if (logoStream != null) { tempLogoImage = graphics.loadPNG(logoStream); logoStream.close(); } @@ -35,8 +36,8 @@ function loadLogoImage() { // =========================================================================== function processLogoRendering() { - if(renderLogo) { - if(logoImage != null) { + if (renderLogo) { + if (logoImage != null) { graphics.drawRectangle(logoImage, logoPos, logoSize); } } diff --git a/scripts/client/main.js b/scripts/client/main.js index 26752255..7daab5b8 100644 --- a/scripts/client/main.js +++ b/scripts/client/main.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: main.js // DESC: Main client script (will be reorganized into individual files later) diff --git a/scripts/client/messaging.js b/scripts/client/messaging.js index 1bd288c3..56bcc7c6 100644 --- a/scripts/client/messaging.js +++ b/scripts/client/messaging.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: messaging.js // DESC: Provides messaging/textdraw functions and usage @@ -33,7 +34,7 @@ function initMessagingScript() { function loadSmallGameMessageFonts() { let tempSmallGameMessageFonts = {}; let fontStream = openFile("files/fonts/pricedown.ttf"); - if(fontStream != null) { + if (fontStream != null) { tempSmallGameMessageFonts["Pricedown"] = lucasFont.createFont(fontStream, 20.0); fontStream.close(); } @@ -49,7 +50,7 @@ function loadSmallGameMessageFonts() { function loadBigGameMessageFont() { let tempBigGameMessageFonts = {}; let fontStream = openFile("files/fonts/pricedown.ttf"); - if(fontStream != null) { + if (fontStream != null) { tempBigGameMessageFonts["Pricedown"] = lucasFont.createFont(fontStream, 28.0); fontStream.close(); } @@ -63,10 +64,10 @@ function loadBigGameMessageFont() { // =========================================================================== function processSmallGameMessageRendering() { - if(renderSmallGameMessage) { - if(smallGameMessageText != "") { - if(smallGameMessageFonts[smallGameMessageFontName] != null) { - smallGameMessageFonts[smallGameMessageFontName].render(smallGameMessageText, [0, game.height-90], game.width, 0.5, 0.0, smallGameMessageFonts[smallGameMessageFontName].size, smallGameMessageColour, true, true, false, true); + if (renderSmallGameMessage) { + if (smallGameMessageText != "") { + if (smallGameMessageFonts[smallGameMessageFontName] != null) { + smallGameMessageFonts[smallGameMessageFontName].render(smallGameMessageText, [0, game.height - 90], game.width, 0.5, 0.0, smallGameMessageFonts[smallGameMessageFontName].size, smallGameMessageColour, true, true, false, true); } } } @@ -76,7 +77,7 @@ function processSmallGameMessageRendering() { function showSmallGameMessage(text, colour, duration, fontName) { logToConsole(LOG_DEBUG, `[VRR.Messaging] Showing small game message '${text}' using font ${fontName} for ${duration}ms`); - if(smallGameMessageText != "") { + if (smallGameMessageText != "") { clearTimeout(smallGameMessageTimer); } @@ -84,7 +85,7 @@ function showSmallGameMessage(text, colour, duration, fontName) { smallGameMessageColour = colour; smallGameMessageText = text; - smallGameMessageTimer = setTimeout(function() { + smallGameMessageTimer = setTimeout(function () { smallGameMessageText = ""; smallGameMessageColour = COLOUR_WHITE; smallGameMessageTimer = null; diff --git a/scripts/client/nametag.js b/scripts/client/nametag.js index 205abc60..4dcf53ba 100644 --- a/scripts/client/nametag.js +++ b/scripts/client/nametag.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: nametags.js // DESC: Provides nametag rendering diff --git a/scripts/client/native/connected.js b/scripts/client/native/connected.js index 60bd2dc6..aa352e94 100644 --- a/scripts/client/native/connected.js +++ b/scripts/client/native/connected.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: connected.js // DESC: Provides wrapped natives for GTA Connected and Mafia Connected mods diff --git a/scripts/client/netevents.js b/scripts/client/netevents.js index b1011fc1..ffd38bf4 100644 --- a/scripts/client/netevents.js +++ b/scripts/client/netevents.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: netevents.js // DESC: Provides server communication and cross-endpoint network events diff --git a/scripts/client/npc.js b/scripts/client/npc.js index 28c8e5a2..f56f051c 100644 --- a/scripts/client/npc.js +++ b/scripts/client/npc.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: npc.js // DESC: Provides NPC functions and processing diff --git a/scripts/client/radio.js b/scripts/client/radio.js index 7cb04ae5..0c0325a1 100644 --- a/scripts/client/radio.js +++ b/scripts/client/radio.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: radio.js // DESC: Provides internet streaming radio functions and usage @@ -8,21 +9,21 @@ // =========================================================================== function playStreamingRadio(url, loop, volume, element = false) { - if(streamingRadio != null) { + if (streamingRadio != null) { streamingRadio.stop(); } streamingRadioVolume = volume; streamingRadio = audio.createSoundFromURL(url, loop); - streamingRadio.volume = volume/100; + streamingRadio.volume = volume / 100; streamingRadio.play(); } // =========================================================================== function stopStreamingRadio() { - if(streamingRadio != null) { + if (streamingRadio != null) { streamingRadio.stop(); } streamingRadio = null; @@ -31,16 +32,16 @@ function stopStreamingRadio() { // =========================================================================== function setStreamingRadioVolume(volume) { - if(streamingRadio != null) { + if (streamingRadio != null) { streamingRadioVolume = volume; - streamingRadio.volume = volume/100; + streamingRadio.volume = volume / 100; } } // =========================================================================== function playAudioFile(audioName, loop, volume) { - findResourceByName("connectedrp-extra").exports.playCustomAudio(audioName, volume/100, loop); + findResourceByName("connectedrp-extra").exports.playCustomAudio(audioName, volume / 100, loop); } // =========================================================================== \ No newline at end of file diff --git a/scripts/client/scoreboard.js b/scripts/client/scoreboard.js index 04dd9630..4f332c65 100644 --- a/scripts/client/scoreboard.js +++ b/scripts/client/scoreboard.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: scoreboard.js // DESC: Provides scoreboard features and rendering @@ -38,63 +39,63 @@ function initScoreBoardListFont() { // =========================================================================== function processScoreBoardRendering() { - if(isAnyGUIActive()) { + if (isAnyGUIActive()) { return false; } - if(renderScoreBoard) { - if(isKeyDown(SDLK_TAB)) { - if(scoreBoardListFont != null && scoreBoardTitleFont != null) { - let scoreboardStart = (game.height/2)-(Math.floor(getClients().length/2)*20); + if (renderScoreBoard) { + if (isKeyDown(SDLK_TAB)) { + if (scoreBoardListFont != null && scoreBoardTitleFont != null) { + let scoreboardStart = (game.height / 2) - (Math.floor(getClients().length / 2) * 20); let titleSize = scoreBoardTitleFont.measure("PLAYERS", game.width, 0.0, 1.0, 10, false, false); - scoreBoardTitleFont.render("PLAYERS", [game.width/2, scoreboardStart-50], 0, 0.5, 0.0, scoreBoardTitleFont.size, COLOUR_WHITE, false, false, false, true); + scoreBoardTitleFont.render("PLAYERS", [game.width / 2, scoreboardStart - 50], 0, 0.5, 0.0, scoreBoardTitleFont.size, COLOUR_WHITE, false, false, false, true); titleSize = scoreBoardTitleFont.measure("____________________________", game.width, 0.0, 1.0, 10, false, false); - scoreBoardTitleFont.render("____________________________", [game.width/2, scoreboardStart-35], 0, 0.5, 0.0, scoreBoardTitleFont.size, COLOUR_WHITE, false, false, false, true); + scoreBoardTitleFont.render("____________________________", [game.width / 2, scoreboardStart - 35], 0, 0.5, 0.0, scoreBoardTitleFont.size, COLOUR_WHITE, false, false, false, true); let clients = getClients(); - for(let i in clients) { - if(!clients[i].console) { + for (let i in clients) { + if (!clients[i].console) { let name = clients[i].name; let colour = COLOUR_WHITE; let paused = false; let ping = "-1"; - if(typeof playerNames[clients[i].name] != "undefined") { + if (typeof playerNames[clients[i].name] != "undefined") { name = playerNames[clients[i].name]; } - if(typeof playerPaused[clients[i].name] != "undefined") { + if (typeof playerPaused[clients[i].name] != "undefined") { paused = playerPaused[clients[i].name]; } - if(typeof playerColours[clients[i].name] != "undefined") { + if (typeof playerColours[clients[i].name] != "undefined") { colour = playerColours[clients[i].name]; } - if(typeof playerPing[clients[i].name] != "undefined") { + if (typeof playerPing[clients[i].name] != "undefined") { ping = toString(playerPing[clients[i].name]); } // Player ID let text = String(clients[i].index); let size = scoreBoardListFont.measure(text, 75, 0.0, 1.0, 10, false, false); - scoreBoardListFont.render(text, [game.width/2-100, scoreboardStart + (i*20)], 0, 0.5, 0.0, scoreBoardListFont.size, COLOUR_WHITE, false, false, false, true); + scoreBoardListFont.render(text, [game.width / 2 - 100, scoreboardStart + (i * 20)], 0, 0.5, 0.0, scoreBoardListFont.size, COLOUR_WHITE, false, false, false, true); // Player Name text = name; size = scoreBoardListFont.measure(text, 100, 0.0, 1.0, 10, false, false); - scoreBoardListFont.render(text, [game.width/2, scoreboardStart + (i*20)], 0, 0.5, 0.0, scoreBoardListFont.size, colour, false, false, false, true); + scoreBoardListFont.render(text, [game.width / 2, scoreboardStart + (i * 20)], 0, 0.5, 0.0, scoreBoardListFont.size, colour, false, false, false, true); // Ping text = ping; size = scoreBoardListFont.measure(ping, 75, 0.0, 1.0, 10, false, false); - scoreBoardListFont.render(ping, [game.width/2+100, scoreboardStart + (i*20)], 0, 0.5, 0.0, scoreBoardListFont.size, COLOUR_WHITE, false, false, false, true); + scoreBoardListFont.render(ping, [game.width / 2 + 100, scoreboardStart + (i * 20)], 0, 0.5, 0.0, scoreBoardListFont.size, COLOUR_WHITE, false, false, false, true); // PAUSED Status (depends on resource "afk") - if(paused == true) { + if (paused == true) { size = scoreBoardListFont.measure("PAUSED", 100, 0.0, 1.0, 10, false, false); - scoreBoardListFont.render("PAUSED", [game.width/2+200, scoreboardStart + (i*20)], 0, 0.5, 0.0, scoreBoardListFont.size, pausedColour, false, false, false, true); + scoreBoardListFont.render("PAUSED", [game.width / 2 + 200, scoreboardStart + (i * 20)], 0, 0.5, 0.0, scoreBoardListFont.size, pausedColour, false, false, false, true); } } } diff --git a/scripts/client/skin-select.js b/scripts/client/skin-select.js index 3ddb9923..e79fc29c 100644 --- a/scripts/client/skin-select.js +++ b/scripts/client/skin-select.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: skin-select.js // DESC: Provides skin-selector functions and usage diff --git a/scripts/client/startup.js b/scripts/client/startup.js index a5868717..a8d30d48 100644 --- a/scripts/client/startup.js +++ b/scripts/client/startup.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: startup.js // DESC: Provides startup/shutdown procedures diff --git a/scripts/client/sync.js b/scripts/client/sync.js index 9c7dd501..643f9233 100644 --- a/scripts/client/sync.js +++ b/scripts/client/sync.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: sync.js // DESC: Provides some elements and data sync diff --git a/scripts/client/utilities.js b/scripts/client/utilities.js index e73174a6..1e4e9a19 100644 --- a/scripts/client/utilities.js +++ b/scripts/client/utilities.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: utilities.js // DESC: Provides util functions and arrays with data diff --git a/scripts/client/vehicle.js b/scripts/client/vehicle.js index 60260eb2..dfcaf41d 100644 --- a/scripts/client/vehicle.js +++ b/scripts/client/vehicle.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: vehicle.js // DESC: Provides vehicle functions and arrays with data diff --git a/scripts/server/accent.js b/scripts/server/accent.js index f5709db0..eb934510 100644 --- a/scripts/server/accent.js +++ b/scripts/server/accent.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: accent.js // DESC: Provides accent functions and usage @@ -27,7 +28,7 @@ function doesPlayerHaveAccent(client) { function getPlayerAccentInlineOutput(client) { let outputText = ""; - if(doesPlayerHaveAccent(client)) { + if (doesPlayerHaveAccent(client)) { outputText = `[${getPlayerAccentText(client)}] `; } @@ -37,14 +38,14 @@ function getPlayerAccentInlineOutput(client) { // =========================================================================== function setAccentCommand(command, params, client) { - if(areParamsEmpty(params)) { + if (areParamsEmpty(params)) { messagePlayerSyntax(client, getCommandSyntaxText(command)); return false; } let accentId = getAccentFromParams(params); - if(!accentId) { + if (!accentId) { messagePlayerError(client, getLocaleString(client, "AccentNotFound")); return false; } @@ -64,7 +65,7 @@ function listAccentsCommand(command, params, client) { let chunkedList = splitArrayIntoChunks(accentList, 8); messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "AccentsListHeader"))); - for(let i in chunkedList) { + for (let i in chunkedList) { messagePlayerInfo(client, chunkedList[i].join(", ")); } } @@ -72,14 +73,14 @@ function listAccentsCommand(command, params, client) { // =========================================================================== function getAccentFromParams(params) { - if(isNaN(params)) { - for(let i in getGlobalConfig().accents) { - if(toLowerCase(getGlobalConfig().accents[i]).indexOf(toLowerCase(params)) != -1) { + if (isNaN(params)) { + for (let i in getGlobalConfig().accents) { + if (toLowerCase(getGlobalConfig().accents[i]).indexOf(toLowerCase(params)) != -1) { return i; } } } else { - if(typeof getGlobalConfig().accents[params] != "undefined") { + if (typeof getGlobalConfig().accents[params] != "undefined") { return toInteger(params); } } @@ -97,14 +98,14 @@ function reloadAccentConfigurationCommand(command, params, client) { // =========================================================================== function addAccentCommand(command, params, client) { - if(areParamsEmpty(params)) { + if (areParamsEmpty(params)) { messagePlayerSyntax(client, getCommandSyntaxText(command)); return false; } let newAccentName = params; - if(getAccentFromParams(newAccentName) != false) { + if (getAccentFromParams(newAccentName) != false) { messagePlayerError(client, `That accent already exists!`) return false; } @@ -117,14 +118,14 @@ function addAccentCommand(command, params, client) { // =========================================================================== function removeAccentCommand(command, params, client) { - if(areParamsEmpty(params)) { + if (areParamsEmpty(params)) { messagePlayerSyntax(client, getCommandSyntaxText(command)); return false; } let newAccentName = params; - if(!getAccentFromParams(newAccentName)) { + if (!getAccentFromParams(newAccentName)) { messagePlayerError(client, `That accent doesn't exist!`) return false; } diff --git a/scripts/server/account.js b/scripts/server/account.js index 2a2eeeca..ecf26991 100644 --- a/scripts/server/account.js +++ b/scripts/server/account.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: account.js // DESC: Provides account functions and usage diff --git a/scripts/server/animation.js b/scripts/server/animation.js index 399a7a6a..d92d493d 100644 --- a/scripts/server/animation.js +++ b/scripts/server/animation.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: animation.js // DESC: Provides animation functions and usage diff --git a/scripts/server/anticheat.js b/scripts/server/anticheat.js index 256bf227..fea0c43d 100644 --- a/scripts/server/anticheat.js +++ b/scripts/server/anticheat.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: anticheat.js // DESC: Provides anticheat functions and usage diff --git a/scripts/server/ban.js b/scripts/server/ban.js index 07e9b8b5..3650bdf9 100644 --- a/scripts/server/ban.js +++ b/scripts/server/ban.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: bans.js // DESC: Provides ban functions and usage diff --git a/scripts/server/bank.js b/scripts/server/bank.js index 6bb70bf0..481767f5 100644 --- a/scripts/server/bank.js +++ b/scripts/server/bank.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: bank.js // DESC: Provides banking functions and usage diff --git a/scripts/server/bitflag.js b/scripts/server/bitflag.js index c4839fa5..66c0cab8 100644 --- a/scripts/server/bitflag.js +++ b/scripts/server/bitflag.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: bitflags.js // DESC: Provides bitwise operations, functions and usage diff --git a/scripts/server/business.js b/scripts/server/business.js index 7155a2e9..194d4e27 100644 --- a/scripts/server/business.js +++ b/scripts/server/business.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: business.js // DESC: Provides business functions and usage diff --git a/scripts/server/chat.js b/scripts/server/chat.js index 2ba4fed0..1998c4bd 100644 --- a/scripts/server/chat.js +++ b/scripts/server/chat.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: chat.js // DESC: Provides chat functions and usage diff --git a/scripts/server/clan.js b/scripts/server/clan.js index 013173a1..eb963866 100644 --- a/scripts/server/clan.js +++ b/scripts/server/clan.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: clan.js // DESC: Provides clan functions and usage diff --git a/scripts/server/client.js b/scripts/server/client.js index 3d320921..ede88047 100644 --- a/scripts/server/client.js +++ b/scripts/server/client.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: client.js // DESC: Provides client communication and cross-endpoint operations diff --git a/scripts/server/command.js b/scripts/server/command.js index 1caa6346..b7f1bc48 100644 --- a/scripts/server/command.js +++ b/scripts/server/command.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: command.js // DESC: Provides command data, functions and usage diff --git a/scripts/server/config.js b/scripts/server/config.js index e74907ae..aa132138 100644 --- a/scripts/server/config.js +++ b/scripts/server/config.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: config.js // DESC: Provides server configuration diff --git a/scripts/server/core.js b/scripts/server/core.js index 18154fc9..256ca4be 100644 --- a/scripts/server/core.js +++ b/scripts/server/core.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: core.js // DESC: Provides core data structures, function, and operations diff --git a/scripts/server/crime.js b/scripts/server/crime.js index 1df467c3..0d05493d 100644 --- a/scripts/server/crime.js +++ b/scripts/server/crime.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: crime.js // DESC: Provides crime data structures, functions, and operations @@ -10,7 +11,7 @@ /** * @class Representing a crime's data. Loaded and saved in the database */ - class CrimeData { +class CrimeData { constructor(suspectId, crimeType, reporterId = 0) { this.crimeType = crimeType; this.suspectId = suspectId; diff --git a/scripts/server/database.js b/scripts/server/database.js index 311d9c61..b3f835f3 100644 --- a/scripts/server/database.js +++ b/scripts/server/database.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: database.js // DESC: Provides database handling, functions and usage @@ -24,13 +25,13 @@ function createDatabaseInsertQuery(tableName, data) { let fields = []; let values = []; - for(let i in data) { - if(data[i][1] != "undefined" && data[i][1] != NaN && data[i][0] != 'NaN') { - if(data[i][1] != "undefined" && data[i][1] != NaN && data[i][1] != 'NaN') { + for (let i in data) { + if (data[i][1] != "undefined" && data[i][1] != NaN && data[i][0] != 'NaN') { + if (data[i][1] != "undefined" && data[i][1] != NaN && data[i][1] != 'NaN') { fields.push(data[i][0]); - if(typeof data[i][1] == "string") { - if(data[i][1] == "{UNIXTIMESTAMP}") { + if (typeof data[i][1] == "string") { + if (data[i][1] == "{UNIXTIMESTAMP}") { values.push("UNIX_TIMESTAMP()"); } else { values.push(`'${data[i][1]}'`); @@ -51,11 +52,11 @@ function createDatabaseInsertQuery(tableName, data) { function createDatabaseUpdateQuery(tableName, data, whereClause) { let values = []; - for(let i in data) { - if(data[i][0] != "undefined" && data[i][0] != NaN && data[i][0] != 'NaN') { - if(data[i][1] != "undefined" && data[i][1] != NaN && data[i][1] != 'NaN') { - if(typeof data[i][1] == "string") { - if(data[i][1] == "{UNIXTIMESTAMP}") { + for (let i in data) { + if (data[i][0] != "undefined" && data[i][0] != NaN && data[i][0] != 'NaN') { + if (data[i][1] != "undefined" && data[i][1] != NaN && data[i][1] != 'NaN') { + if (typeof data[i][1] == "string") { + if (data[i][1] == "{UNIXTIMESTAMP}") { values.push(`${data[i][0]}=UNIX_TIMESTAMP()`); } else { values.push(`${data[i][0]}='${data[i][1]}'`); diff --git a/scripts/server/developer.js b/scripts/server/developer.js index 8c6c5bb7..dc000581 100644 --- a/scripts/server/developer.js +++ b/scripts/server/developer.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: developer.js // DESC: Provides developer operation, commands, functions and usage diff --git a/scripts/server/discord.js b/scripts/server/discord.js index 85d57abb..266e3a70 100644 --- a/scripts/server/discord.js +++ b/scripts/server/discord.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: discord.js // DESC: Provides discord bridging and connection functions and usage diff --git a/scripts/server/economy.js b/scripts/server/economy.js index c975bfe9..68b08a59 100644 --- a/scripts/server/economy.js +++ b/scripts/server/economy.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: economy.js // DESC: Provides economy/financial utils, functions and usage diff --git a/scripts/server/email.js b/scripts/server/email.js index 689c546e..95d8a7c9 100644 --- a/scripts/server/email.js +++ b/scripts/server/email.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: email.js // DESC: Provides email handling, functions and usage diff --git a/scripts/server/event.js b/scripts/server/event.js index ec43f80e..d1b5bdc4 100644 --- a/scripts/server/event.js +++ b/scripts/server/event.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: event.js // DESC: Provides handlers for built in GTAC and Asshat-Gaming created events diff --git a/scripts/server/fishing.js b/scripts/server/fishing.js index cd67c601..978dcfb1 100644 --- a/scripts/server/fishing.js +++ b/scripts/server/fishing.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: fishing.js // DESC: Provides fishing functions and commands diff --git a/scripts/server/forensics.js b/scripts/server/forensics.js index e46da43c..264f1c10 100644 --- a/scripts/server/forensics.js +++ b/scripts/server/forensics.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: forensics.js // DESC: Provides forensics functions and commands (bullet casings, blood, etc) diff --git a/scripts/server/gate.js b/scripts/server/gate.js index 17051d59..720133ab 100644 --- a/scripts/server/gate.js +++ b/scripts/server/gate.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: gate.js // DESC: Provides gate functions and commands diff --git a/scripts/server/gps.js b/scripts/server/gps.js index 42e54977..815d836d 100644 --- a/scripts/server/gps.js +++ b/scripts/server/gps.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: gps.js // DESC: Provides GPS functions and commands diff --git a/scripts/server/gui.js b/scripts/server/gui.js index d463b2d7..403ca3a4 100644 --- a/scripts/server/gui.js +++ b/scripts/server/gui.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: gui.js // DESC: Provides GUI functions and usage diff --git a/scripts/server/help.js b/scripts/server/help.js index 38cc1cb7..d35b1e01 100644 --- a/scripts/server/help.js +++ b/scripts/server/help.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: help.js // DESC: Provides update info, help commands, and documentation diff --git a/scripts/server/house.js b/scripts/server/house.js index ca1d990a..474787a1 100644 --- a/scripts/server/house.js +++ b/scripts/server/house.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: house.js // DESC: Provides house commands, functions, and usage diff --git a/scripts/server/insurance.js b/scripts/server/insurance.js index 7471795e..3bb7162c 100644 --- a/scripts/server/insurance.js +++ b/scripts/server/insurance.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: insurance.js // DESC: Provides insurance commands, functions, and usage diff --git a/scripts/server/item.js b/scripts/server/item.js index 7b0e453b..a074135d 100644 --- a/scripts/server/item.js +++ b/scripts/server/item.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: item.js // DESC: Provides item functions and usage diff --git a/scripts/server/item/drink.js b/scripts/server/item/drink.js index 5a05031c..0dc61521 100644 --- a/scripts/server/item/drink.js +++ b/scripts/server/item/drink.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: drink.js // DESC: Provides features and usage for the drink item type diff --git a/scripts/server/item/food.js b/scripts/server/item/food.js index c986b228..f0c85a4d 100644 --- a/scripts/server/item/food.js +++ b/scripts/server/item/food.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: food.js // DESC: Provides features and usage for the food item type diff --git a/scripts/server/item/handcuff.js b/scripts/server/item/handcuff.js index fd1220c5..6cdbff2d 100644 --- a/scripts/server/item/handcuff.js +++ b/scripts/server/item/handcuff.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: handcuff.js // DESC: Provides features and usage for the handcuff item type diff --git a/scripts/server/item/phone.js b/scripts/server/item/phone.js index 89eddb9b..9e3d510b 100644 --- a/scripts/server/item/phone.js +++ b/scripts/server/item/phone.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: phone.js // DESC: Provides features and usage for the phone item type diff --git a/scripts/server/item/rope.js b/scripts/server/item/rope.js index 546bdeb7..88c724e5 100644 --- a/scripts/server/item/rope.js +++ b/scripts/server/item/rope.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: handcuff.js // DESC: Provides features and usage for the handcuff item type diff --git a/scripts/server/item/tazer.js b/scripts/server/item/tazer.js index 24e384bd..e2be72ad 100644 --- a/scripts/server/item/tazer.js +++ b/scripts/server/item/tazer.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: tazer.js // DESC: Provides features and usage for the tazer item type diff --git a/scripts/server/item/walkie-talkie.js b/scripts/server/item/walkie-talkie.js index ee9dd527..9514f3c2 100644 --- a/scripts/server/item/walkie-talkie.js +++ b/scripts/server/item/walkie-talkie.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: walkie-talkie.js // DESC: Provides features and usage for the walkie-talkie item type diff --git a/scripts/server/job.js b/scripts/server/job.js index a00562ce..2ebaf297 100644 --- a/scripts/server/job.js +++ b/scripts/server/job.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: job.js // DESC: Provides job functions and usage diff --git a/scripts/server/job/bus.js b/scripts/server/job/bus.js index 44803788..2861bea3 100644 --- a/scripts/server/job/bus.js +++ b/scripts/server/job/bus.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: bus.js // DESC: Provides bus driver job functions and usage diff --git a/scripts/server/job/drug.js b/scripts/server/job/drug.js index 90f9f93e..f314b648 100644 --- a/scripts/server/job/drug.js +++ b/scripts/server/job/drug.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: drug.js // DESC: Provides drug runner/dealer job functions and usage diff --git a/scripts/server/job/fire.js b/scripts/server/job/fire.js index 3b6cdb51..2c82d6ef 100644 --- a/scripts/server/job/fire.js +++ b/scripts/server/job/fire.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: fire.js // DESC: Provides firefighter job functions and usage diff --git a/scripts/server/job/garbage.js b/scripts/server/job/garbage.js index 4971e7aa..1b5fd3ea 100644 --- a/scripts/server/job/garbage.js +++ b/scripts/server/job/garbage.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: garbage.js // DESC: Provides garbage collector job functions and usage diff --git a/scripts/server/job/medic.js b/scripts/server/job/medic.js index 6b7cbcd9..22c79174 100644 --- a/scripts/server/job/medic.js +++ b/scripts/server/job/medic.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: medic.js // DESC: Provides paramedic job functions and usage diff --git a/scripts/server/job/pizza-delivery.js b/scripts/server/job/pizza-delivery.js index 20297b62..2c96f315 100644 --- a/scripts/server/job/pizza-delivery.js +++ b/scripts/server/job/pizza-delivery.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: pizza-delivery.js // DESC: Provides pizza delivery driver job functions and usage diff --git a/scripts/server/job/police.js b/scripts/server/job/police.js index 0f94c5a7..2ace530a 100644 --- a/scripts/server/job/police.js +++ b/scripts/server/job/police.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: police.js // DESC: Provides police officer job functions and usage diff --git a/scripts/server/job/taxi.js b/scripts/server/job/taxi.js index 55f28099..0380091c 100644 --- a/scripts/server/job/taxi.js +++ b/scripts/server/job/taxi.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: taxi.js // DESC: Provides taxi driver job functions and usage diff --git a/scripts/server/job/weapon.js b/scripts/server/job/weapon.js index 64faab1e..ec0fd497 100644 --- a/scripts/server/job/weapon.js +++ b/scripts/server/job/weapon.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: weapon.js // DESC: Provides weapons dealer job functions and usage diff --git a/scripts/server/keybind.js b/scripts/server/keybind.js index dfc3529f..cd1f6879 100644 --- a/scripts/server/keybind.js +++ b/scripts/server/keybind.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: keybind.js // DESC: Provides keybind handlers and functions diff --git a/scripts/server/locale.js b/scripts/server/locale.js index 2e8a2a96..2e4e47e0 100644 --- a/scripts/server/locale.js +++ b/scripts/server/locale.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: locale.js // DESC: Provides locale structures, functions and usage diff --git a/scripts/server/messaging.js b/scripts/server/messaging.js index 7a74fa27..b5a01800 100644 --- a/scripts/server/messaging.js +++ b/scripts/server/messaging.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: messaging.js // DESC: Provides messaging functions and usage diff --git a/scripts/server/misc.js b/scripts/server/misc.js index 3ecb886b..ea723cd5 100644 --- a/scripts/server/misc.js +++ b/scripts/server/misc.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: misc.js // DESC: Provides any uncategorized functions and usage diff --git a/scripts/server/native/connected.js b/scripts/server/native/connected.js index 05b7ad83..f7160357 100644 --- a/scripts/server/native/connected.js +++ b/scripts/server/native/connected.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: connected.js // DESC: Provides wrapped natives for GTA Connected and Mafia Connected mods diff --git a/scripts/server/native/ragemp.js b/scripts/server/native/ragemp.js index a4a7c5aa..0a396b19 100644 --- a/scripts/server/native/ragemp.js +++ b/scripts/server/native/ragemp.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: connected.js // DESC: Provides wrapped natives for GTA Connected and Mafia Connected mods diff --git a/scripts/server/netevents.js b/scripts/server/netevents.js index fcf32c89..02858f61 100644 --- a/scripts/server/netevents.js +++ b/scripts/server/netevents.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: netevents.js // DESC: Provides client communication and cross-endpoint network events diff --git a/scripts/server/npc.js b/scripts/server/npc.js index 36f38c5a..0257a7dc 100644 --- a/scripts/server/npc.js +++ b/scripts/server/npc.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: npc.js // DESC: Provides NPC usage and functions diff --git a/scripts/server/paintball.js b/scripts/server/paintball.js index cc47740f..fa154214 100644 --- a/scripts/server/paintball.js +++ b/scripts/server/paintball.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: paintball.js // DESC: Provides paintball/airsoft arena functions and commands diff --git a/scripts/server/race.js b/scripts/server/race.js index 7862d66f..aeb3886f 100644 --- a/scripts/server/race.js +++ b/scripts/server/race.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: race.js // DESC: Provides racing usage and functions @@ -19,7 +20,7 @@ function initRaceScript() { * @return {RaceData} The race's data (class instance) */ function getRaceData(raceId) { - if(typeof getServerData().races[raceId] != "undefined") { + if (typeof getServerData().races[raceId] != "undefined") { return getServerData().races[raceId]; } return false; @@ -28,7 +29,7 @@ function getRaceData(raceId) { // =========================================================================== function setAllRaceDataIndexes() { - for(let i in getServerData().races) { + for (let i in getServerData().races) { getServerData().races[i].index = i; } } @@ -43,11 +44,11 @@ function loadRacesFromDatabase() { // =========================================================================== function saveRacesToDatabase() { - if(getServerConfig().devServer) { + if (getServerConfig().devServer) { return false; } - for(let i in getServerData().races) { + for (let i in getServerData().races) { saveRaceToDatabase(getServerData().races[i]); } } @@ -61,14 +62,14 @@ function saveRaceToDatabase(raceData) { // =========================================================================== function createRaceCommand(command, params, client) { - if(areParamsEmpty(params)) { + if (areParamsEmpty(params)) { messagePlayerSyntax(client, getCommandSyntaxText(command)); return false; } let raceId = getRaceFromParams(params); - if(raceId == false) { + if (raceId == false) { messagePlayerError(client, "A race with that name already exists!"); return false; } @@ -80,7 +81,7 @@ function createRaceCommand(command, params, client) { // =========================================================================== function createRaceCommand(command, params, client) { - if(areParamsEmpty(params)) { + if (areParamsEmpty(params)) { messagePlayerSyntax(client, getCommandSyntaxText(command)); return false; } @@ -95,13 +96,13 @@ function createRaceCommand(command, params, client) { // =========================================================================== function createRaceLocationCommand(command, params, client) { - if(areParamsEmpty(params)) { + if (areParamsEmpty(params)) { messagePlayerSyntax(client, getCommandSyntaxText(command)); return false; } let raceId = getPlayerRace(client); - if(raceId == false) { + if (raceId == false) { messagePlayerError(client, "You are not in a race!"); return false; } @@ -115,13 +116,13 @@ function createRaceLocationCommand(command, params, client) { // =========================================================================== function createRaceLocationCommand(command, params, client) { - if(areParamsEmpty(params)) { + if (areParamsEmpty(params)) { messagePlayerSyntax(client, getCommandSyntaxText(command)); return false; } let raceId = getPlayerRace(client); - if(raceId == false) { + if (raceId == false) { messagePlayerError(client, "You are not in a race!"); return false; } @@ -135,7 +136,7 @@ function createRaceLocationCommand(command, params, client) { // =========================================================================== function stopRacingCommand(command, params, client) { - if(!isPlayerInARace(client)) { + if (!isPlayerInARace(client)) { messagePlayerError(client, "You aren't in a race!"); return false; } diff --git a/scripts/server/radio.js b/scripts/server/radio.js index 09a98b0a..b40c327b 100644 --- a/scripts/server/radio.js +++ b/scripts/server/radio.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: radio.js // DESC: Provides radio station streaming diff --git a/scripts/server/security.js b/scripts/server/security.js index f6aef35f..a0e607a3 100644 --- a/scripts/server/security.js +++ b/scripts/server/security.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: security.js // DESC: Provides security functions and usage diff --git a/scripts/server/staff.js b/scripts/server/staff.js index 0e9d1df6..b96f2336 100644 --- a/scripts/server/staff.js +++ b/scripts/server/staff.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: staff.js // DESC: Provides staff commands, functions and usage diff --git a/scripts/server/startup.js b/scripts/server/startup.js index 2bb14c22..d5827678 100644 --- a/scripts/server/startup.js +++ b/scripts/server/startup.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: startup.js // DESC: Provides startup/shutdown procedures diff --git a/scripts/server/subaccount.js b/scripts/server/subaccount.js index ef397eaa..52fb5102 100644 --- a/scripts/server/subaccount.js +++ b/scripts/server/subaccount.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: subaccount.js // DESC: Provides subaccount (character) functions and usage diff --git a/scripts/server/theme.js b/scripts/server/theme.js index c14ec001..d4d9a448 100644 --- a/scripts/server/theme.js +++ b/scripts/server/theme.js @@ -1,9 +1,9 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: theme.js // DESC: Provides server theme content // TYPE: Server (JavaScript) // =========================================================================== - diff --git a/scripts/server/timers.js b/scripts/server/timers.js index 4afe2645..635dd933 100644 --- a/scripts/server/timers.js +++ b/scripts/server/timers.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: timers.js // DESC: Provides timer functions and features diff --git a/scripts/server/trigger.js b/scripts/server/trigger.js index 5b455192..b0d6dd9f 100644 --- a/scripts/server/trigger.js +++ b/scripts/server/trigger.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: trigger.js // DESC: Provides trigger system functions and usage diff --git a/scripts/server/tutorial.js b/scripts/server/tutorial.js index 8fa238ab..0a2e9a9c 100644 --- a/scripts/server/tutorial.js +++ b/scripts/server/tutorial.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: tutorial.js // DESC: Provides tutorial functions and features diff --git a/scripts/server/utilities.js b/scripts/server/utilities.js index fa92fa33..b4188538 100644 --- a/scripts/server/utilities.js +++ b/scripts/server/utilities.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: utilities.js // DESC: Provides util functions and arrays with data diff --git a/scripts/server/vehicle.js b/scripts/server/vehicle.js index 19a0c888..c192bc59 100644 --- a/scripts/server/vehicle.js +++ b/scripts/server/vehicle.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: vehicle.js // DESC: Provides vehicle functions and usage diff --git a/scripts/shared/const.js b/scripts/shared/const.js index 2875f0a9..f79bf67b 100644 --- a/scripts/shared/const.js +++ b/scripts/shared/const.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: const.js // DESC: Provides shared constants diff --git a/scripts/shared/gamedata.js b/scripts/shared/gamedata.js index ce51faea..8fadce4b 100644 --- a/scripts/shared/gamedata.js +++ b/scripts/shared/gamedata.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: gamedata.js // DESC: Provides arrays of game data diff --git a/scripts/shared/utilities.js b/scripts/shared/utilities.js index cde433d3..97c7af6b 100644 --- a/scripts/shared/utilities.js +++ b/scripts/shared/utilities.js @@ -1,6 +1,7 @@ // =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay +// Asshat Gaming Roleplay +// https://github.com/VortrexFTW/agrp_main +// (c) 2022 Asshat Gaming // =========================================================================== // FILE: utilities.js // DESC: Provides shared utilities