From 95a5f65921eadfc60cad7c7c2ec57ba4b2ec9ab1 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sat, 26 Feb 2022 21:29:57 -0600 Subject: [PATCH 01/44] Offload colour replace to client --- scripts/server/colour.js | 367 ----------- scripts/shared/utilities.js | 1228 +++++++++++++++++++++++++++++++++++ 2 files changed, 1228 insertions(+), 367 deletions(-) delete mode 100644 scripts/server/colour.js diff --git a/scripts/server/colour.js b/scripts/server/colour.js deleted file mode 100644 index 3ffe0889..00000000 --- a/scripts/server/colour.js +++ /dev/null @@ -1,367 +0,0 @@ -// =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay -// =========================================================================== -// FILE: colour.js -// DESC: Provides colours, functions and usage -// TYPE: Server (JavaScript) -// =========================================================================== - -let serverColours = { - hex: { - byType: { - talkMessage: "C8C8C8", - shoutMessage: "FFFFC8", - whisperMessage: "828282", - doActionMessage: "B19CD9", - meActionMessage: "B19CD9", - errorMessage: "ED4337", - syntaxMessage: "C8C8C8", - normalMessage: "FFFFFF", - alertMessage: "FFFF00", - successMessage: "00B400", - clanChatMessage: "00BE00", - businessBlue: "0099FF", - houseGreen: "11CC11", - clanOrange: "FF9900", - vehiclePurple: "960096", - jobYellow: "FFFF00", - }, - byName: { - white: "FFFFFF", - black: "000000", - red: "FF0000", - yellow: "FFFF00", - royalBlue: "0000FF", - teal: "00FFFF", - orange: "FF8000", - softRed: "ED4337", - softGreen: "32CD32", - lightPurple: "960096", - lightGrey: "C8C8C8", - mediumGrey: "969696", - darkGrey: "404040", - policeBlue: "3250C8", - medicPink: "DB7093", - firefighterRed: "CD3C3C", - busDriverGreen: "32A032", - taxiDriverYellow: "F0E664", - deliveryPurple: "B19CD9", - civilianWhite: "C8C8C8", - burntYellow: "D2D200", - burntOrange: "D27800", - bankGreen: "00B400", - softYellow: "EAC67E", - businessBlue: "0099FF", - houseGreen: "11CC11", - clanOrange: "FF9900", - vehiclePurple: "960096", - jobYellow: "FFFF00", - }, - }, - - byType: { - talkMessage: toColour(200, 200, 200), - shoutMessage: toColour(255, 255, 200), - whisperMessage: toColour(130, 130, 130), - doActionMessage: toColour(177, 156, 217, 255), - meActionMessage: toColour(177, 156, 217, 255), - errorMessage: toColour(237, 67, 55, 255), - syntaxMessage: toColour(200, 200, 200, 255), - normalMessage: toColour(255, 255, 255, 255), - alertMessage: toColour(255, 255, 0, 255), - successMessage: toColour(0, 180, 0, 255), - clanChatMessage: toColour(0, 190, 0, 255), - }, - byName: { - white: toColour(255, 255, 255, 255), - black: toColour(0, 0, 0, 255), - red: toColour(255, 0, 0, 255), - yellow: toColour(255, 255, 0, 255), - royalBlue: toColour(0, 0, 255, 255), - teal: toColour(0, 255, 255, 255), - orange: toColour(255, 128, 0, 255), - softRed: toColour(205, 60, 60, 255), - softGreen: toColour(50, 205, 50, 255), - lightPurple: toColour(150, 0, 150, 255), - lightGrey: toColour(200, 200, 200, 255), - mediumGrey: toColour(150, 150, 150, 255), - darkGrey: toColour(64, 64, 64, 255), - policeBlue: toColour(50, 80, 200, 255), - medicPink: toColour(219, 112, 147, 255), - firefighterRed: toColour(205, 60, 60, 255), - busDriverGreen: toColour(50, 160, 50, 255), - taxiDriverYellow: toColour(240, 230, 100, 255), - deliveryPurple: toColour(177, 156, 217, 255), - civilianWhite: toColour(200, 200, 200, 255), - burntYellow: toColour(210, 210, 0, 255), - burntOrange: toColour(210, 120, 0, 255), - bankGreen: toColour(0, 150, 0, 255), - softYellow: toColour(234, 198, 126, 255), - businessBlue: toColour(0, 153, 255, 255), - houseGreen: toColour(17, 204, 17, 255), - clanOrange: toColour(255, 153, 0, 255), - }, -}; - -// =========================================================================== - -function getServerColours() { - return serverColours; -} - -// =========================================================================== - -function getColourByType(typeName) { - return getServerColours().byType[typeName]; -} - -// =========================================================================== - -function getColourByName(colourName) { - return getServerColours().byName[colourName]; -} - -// =========================================================================== - -function getHexColourByName(colourName) { - //let rgbaColour = getServerColours().byName[colourName]; - //let rgbaArray = rgbaArrayFromToColour(rgbaColour); - //return rgbToHex(rgbaArray[0], rgbaArray[1], rgbaArray[2]); - - return `#${getServerColours().hex.byName[colourName]}`; -} - -// =========================================================================== - -function getHexColourByType(colourName) { - //let rgbaColour = getServerColours().byType[colourName]; - //let rgbaArray = rgbaArrayFromToColour(rgbaColour); - //return rgbToHex(rgbaArray[0], rgbaArray[1], rgbaArray[2]); - - return `#${getServerColours().hex.byType[colourName]}`; -} - -// =========================================================================== - -function getPlayerColour(client) { - if(getPlayerData(client) != false) { - if(!isPlayerLoggedIn(client)) { - return getColourByName("darkGrey"); - } else { - if(isPlayerWorking(client)) { - return getJobData(getJobIndexFromDatabaseId(getPlayerCurrentSubAccount(client).job)).colour; - } - } - } - - return getColourByName("civilianWhite"); -} - -// =========================================================================== - -/** - * Gets the red/green colour depending on bool (red = false, green = true) for inline use in chatbox messages - * - * @param {Boolean} boolValue The boolean value - * @return {String} Red or green inline HEX colour string - * - */ -function getBoolRedGreenInlineColour(boolValue) { - return (!boolValue) ? "{softRed}" : "{softGreen}"; -} - -// =========================================================================== - -/** - * Gets an array of RGB colour values from a HEX colour string - * - * @param {String} hexColour Hex colour string - * @return {Array} 3-slot array where each slot is an RGB colour value - * - */ -function hexToRgb(h) { - return [ - '0x'+h[1]+h[2]|0, - '0x'+h[3]+h[4]|0, - '0x'+h[5]+h[6]|0 - ]; -} - -// =========================================================================== - -/** - * Gets a HEX colour string from RGB values, without brackets (example: #FFFFFF) - * - * @param {Number} red Red RGB value - * @param {Number} green Green RGB value - * @param {Number} blue Blue RGB value - * @return {String} HEX colour string - * - */ -function rgbToHex(r, g, b) { - return "#"+((1<<24)+(r<<16)+(g<<8)+ b).toString(16).slice(1); -} - -// =========================================================================== - -/** - * Gets the current colour for a player (affected by job and status) - * - * @param {Client} client Player client - * @return {Number} Colour integer - * - */ -function getClientChatColour(client) { - let tempJob = getPlayerCurrentSubAccount(client).job; - if(tempJob != -1) { - if(getPlayerData(client).isWorking) { - return getJobData(tempJob).jobColour; - } - } - return getColourByName("white"); -} - -// =========================================================================== - -/** - * Gets a toColour-created colour integer with random RGB values (alpha is always 255) - * - * @return {Number} Colour integer - * - */ -function getRandomRGB() { - return toColour.apply(null, [ - getRandom(0, 255), - getRandom(0, 255), - getRandom(0, 255), - 255 - ]); -} - -// =========================================================================== - -/** - * Gets a hex formatting colour by name for use inline in chatbox messages (example: [#FFFFFF]). - * - * @param {String} colourName - Colour name - * @return {String} HEX-formatted colour string with brackets - * - */ -function getInlineChatColourByName(colourName) { - return `{${colourName}}`; -} - -// =========================================================================== - -/** - * Gets a hex formatting colour by type for use inline in chatbox messages (example: [#FFFFFF]). - * - * @param {String} colourName - Colour type - * @return {String} HEX-formatted colour string with brackets - * - */ -function getInlineChatColourByType(colourName) { - return `{${colourName}}`; -} - -// =========================================================================== - -/** - * Gets an array of RGBA colour values from a toColour integer. - * - * @param {Number} colour - Colour integer created by toColour - * @return {Array} 4-slot array where each slot is an RGBA colour value - * - */ -function rgbaArrayFromToColour(colour) { - //return [ - // (colour >> 24) & 0xFF, // red - // (colour >> 16) & 0xFF, - // (colour >> 8) & 0xFF, - // colour & 0xFF // alpha - //]; - return [ - (colour >> 16) & 0xFF, // red - (colour >> 8) & 0xFF, - colour & 0xFF, - (colour >> 24) & 0xFF// alpha - ]; -} - -// =========================================================================== - -function hexFromToColour(colour) { - let rgba = rgbaArrayFromToColour(colour); - return rgbToHex(rgba[0], rgba[1], rgba[2]); -} - -// =========================================================================== - -function replaceColoursInMessage(messageText) { - if(messageText == null) { - return ""; - } - - let tempFind = `{RESETCOLOUR}`; - let tempRegex = new RegExp(tempFind, 'g'); - messageText = messageText.replace(tempRegex, "[/#]"); - - tempFind = `{ALTCOLOUR}`; - tempRegex = new RegExp(tempFind, 'g'); - messageText = messageText.replace(tempRegex, "[#C8C8C8]"); - - tempFind = `{MAINCOLOUR}`; - tempRegex = new RegExp(tempFind, 'g'); - messageText = messageText.replace(tempRegex, "[#FFFFFF]"); - - for(let i in getServerColours().hex.byName) { - let find = `{${i}}`; - let re = new RegExp(find, 'g'); - messageText = messageText.replace(re, `[#${getServerColours().hex.byName[i]}]`); - } - - for(let i in getServerColours().hex.byType) { - let find = `{${i}}`; - let re = new RegExp(find, 'g'); - messageText = messageText.replace(re, `[#${getServerColours().hex.byType[i]}]`); - } - - return messageText; -} - -// =========================================================================== - -function removeColoursInMessage(messageText) { - if(messageText == null) { - return ""; - } - - let tempFind = `{RESETCOLOUR}`; - let tempRegex = new RegExp(tempFind, 'g'); - messageText = messageText.replace(tempRegex, ""); - - tempFind = `{ALTCOLOUR}`; - tempRegex = new RegExp(tempFind, 'g'); - messageText = messageText.replace(tempRegex, ""); - - tempFind = `{MAINCOLOUR}`; - tempRegex = new RegExp(tempFind, 'g'); - messageText = messageText.replace(tempRegex, ""); - - for(let i in getServerColours().hex.byName) { - let find = `{${i}}`; - let re = new RegExp(find, 'g'); - messageText = messageText.replace(re, ""); - } - - for(let i in getServerColours().hex.byType) { - let find = `{${i}}`; - let re = new RegExp(find, 'g'); - messageText = messageText.replace(re, ""); - } - - return messageText; -} - -// =========================================================================== \ No newline at end of file diff --git a/scripts/shared/utilities.js b/scripts/shared/utilities.js index 808ccb91..1cd8fd4a 100644 --- a/scripts/shared/utilities.js +++ b/scripts/shared/utilities.js @@ -170,6 +170,963 @@ let cardinalDirections = [ // =========================================================================== +let serverColours = { + hex: { + byType: { + talkMessage: "C8C8C8", + shoutMessage: "FFFFC8", + whisperMessage: "828282", + doActionMessage: "B19CD9", + meActionMessage: "B19CD9", + errorMessage: "ED4337", + syntaxMessage: "C8C8C8", + normalMessage: "FFFFFF", + alertMessage: "FFFF00", + successMessage: "00B400", + clanChatMessage: "00BE00", + businessBlue: "0099FF", + houseGreen: "11CC11", + clanOrange: "FF9900", + vehiclePurple: "960096", + jobYellow: "FFFF00", + }, + byName: { + white: "FFFFFF", + black: "000000", + red: "FF0000", + yellow: "FFFF00", + royalBlue: "0000FF", + teal: "00FFFF", + orange: "FF8000", + softRed: "ED4337", + softGreen: "32CD32", + lightPurple: "960096", + lightGrey: "C8C8C8", + mediumGrey: "969696", + darkGrey: "404040", + policeBlue: "3250C8", + medicPink: "DB7093", + firefighterRed: "CD3C3C", + busDriverGreen: "32A032", + taxiDriverYellow: "F0E664", + deliveryPurple: "B19CD9", + civilianWhite: "C8C8C8", + burntYellow: "D2D200", + burntOrange: "D27800", + bankGreen: "00B400", + softYellow: "EAC67E", + businessBlue: "0099FF", + houseGreen: "11CC11", + clanOrange: "FF9900", + vehiclePurple: "960096", + jobYellow: "FFFF00", + }, + }, + + byType: { + talkMessage: toColour(200, 200, 200), + shoutMessage: toColour(255, 255, 200), + whisperMessage: toColour(130, 130, 130), + doActionMessage: toColour(177, 156, 217, 255), + meActionMessage: toColour(177, 156, 217, 255), + errorMessage: toColour(237, 67, 55, 255), + syntaxMessage: toColour(200, 200, 200, 255), + normalMessage: toColour(255, 255, 255, 255), + alertMessage: toColour(255, 255, 0, 255), + successMessage: toColour(0, 180, 0, 255), + clanChatMessage: toColour(0, 190, 0, 255), + }, + byName: { + white: toColour(255, 255, 255, 255), + black: toColour(0, 0, 0, 255), + red: toColour(255, 0, 0, 255), + yellow: toColour(255, 255, 0, 255), + royalBlue: toColour(0, 0, 255, 255), + teal: toColour(0, 255, 255, 255), + orange: toColour(255, 128, 0, 255), + softRed: toColour(205, 60, 60, 255), + softGreen: toColour(50, 205, 50, 255), + lightPurple: toColour(150, 0, 150, 255), + lightGrey: toColour(200, 200, 200, 255), + mediumGrey: toColour(150, 150, 150, 255), + darkGrey: toColour(64, 64, 64, 255), + policeBlue: toColour(50, 80, 200, 255), + medicPink: toColour(219, 112, 147, 255), + firefighterRed: toColour(205, 60, 60, 255), + busDriverGreen: toColour(50, 160, 50, 255), + taxiDriverYellow: toColour(240, 230, 100, 255), + deliveryPurple: toColour(177, 156, 217, 255), + civilianWhite: toColour(200, 200, 200, 255), + burntYellow: toColour(210, 210, 0, 255), + burntOrange: toColour(210, 120, 0, 255), + bankGreen: toColour(0, 150, 0, 255), + softYellow: toColour(234, 198, 126, 255), + businessBlue: toColour(0, 153, 255, 255), + houseGreen: toColour(17, 204, 17, 255), + clanOrange: toColour(255, 153, 0, 255), + }, +}; + +let serverEmoji = [ + [":hash:", "#"], + [":zero:", "0"], + [":one:", "1"], + [":two:", "2"], + [":three:", "3"], + [":four:", "4"], + [":five:", "5"], + [":six:", "6"], + [":seven:", "7"], + [":eight:", "8"], + [":nine:", "9"], + [":copyright:", "©"], + [":registered:", "®"], + [":bangbang:", "‼"], + [":interrobang:", "⁉"], + [":tm:", "™"], + [":information_source:", "ℹ"], + [":left_right_arrow:", "↔"], + [":arrow_up_down:", "↕"], + [":arrow_upper_left:", "↖"], + [":arrow_upper_right:", "↗"], + [":arrow_lower_right:", "↘"], + [":arrow_lower_left:", "↙"], + [":leftwards_arrow_with_hook:", "↩"], + [":arrow_right_hook:", "↪"], + [":watch:", "⌚"], + [":hourglass:", "⌛"], + [":fast_forward:", "⏩"], + [":rewind:", "⏪"], + [":arrow_double_up:", "⏫"], + [":arrow_double_down:", "⏬"], + [":alarm_clock:", "⏰"], + [":hourglass_flowing_sand:", "⏳"], + [":m:", "ⓜ"], + [":black_small_square:", "▪"], + [":white_small_square:", "▫"], + [":arrow_forward:", "▶"], + [":arrow_backward:", "◀"], + [":white_medium_square:", "◻"], + [":black_medium_square:", "◼"], + [":white_medium_small_square:", "◽"], + [":black_medium_small_square:", "◾"], + [":sunny:", "☀"], + [":cloud:", "☁"], + [":telephone:", "☎"], + [":ballot_box_with_check:", "☑"], + [":umbrella:", "☔"], + [":coffee:", "☕"], + [":point_up:", "☝"], + [":relaxed:", "☺"], + [":aries:", "♈"], + [":taurus:", "♉"], + [":gemini:", "♊"], + [":cancer:", "♋"], + [":leo:", "♌"], + [":virgo:", "♍"], + [":libra:", "♎"], + [":scorpius:", "♏"], + [":sagittarius:", "♐"], + [":capricorn:", "♑"], + [":aquarius:", "♒"], + [":pisces:", "♓"], + [":spades:", "♠"], + [":clubs:", "♣"], + [":hearts:", "♥"], + [":diamonds:", "♦"], + [":hotsprings:", "♨"], + [":recycle:", "♻"], + [":wheelchair:", "♿"], + [":anchor:", "⚓"], + [":warning:", "⚠"], + [":zap:", "⚡"], + [":white_circle:", "⚪"], + [":black_circle:", "⚫"], + [":soccer:", "⚽"], + [":baseball:", "⚾"], + [":snowman:", "⛄"], + [":partly_sunny:", "⛅"], + [":ophiuchus:", "⛎"], + [":no_entry:", "⛔"], + [":church:", "⛪"], + [":fountain:", "⛲"], + [":golf:", "⛳"], + [":sailboat:", "⛵"], + [":tent:", "⛺"], + [":fuelpump:", "⛽"], + [":scissors:", "✂"], + [":white_check_mark:", "✅"], + [":airplane:", "✈"], + [":envelope:", "✉"], + [":fist:", "✊"], + [":raised_hand:", "✋"], + [":v:", "✌"], + [":pencil2:", "✏"], + [":black_nib:", "✒"], + [":heavy_check_mark:", "✔"], + [":heavy_multiplication_x:", "✖"], + [":sparkles:", "✨"], + [":eight_spoked_asterisk:", "✳"], + [":eight_pointed_black_star:", "✴"], + [":snowflake:", "❄"], + [":sparkle:", "❇"], + [":x:", "❌"], + [":negative_squared_cross_mark:", "❎"], + [":question:", "❓"], + [":grey_question:", "❔"], + [":grey_exclamation:", "❕"], + [":exclamation:", "❗"], + [":heart:", "❤"], + [":heavy_plus_sign:", "➕"], + [":heavy_minus_sign:", "➖"], + [":heavy_division_sign:", "➗"], + [":arrow_right:", "➡"], + [":curly_loop:", "➰"], + [":arrow_heading_up:", "⤴"], + [":arrow_heading_down:", "⤵"], + [":arrow_left:", "⬅"], + [":arrow_up:", "⬆"], + [":arrow_down:", "⬇"], + [":black_large_square:", "⬛"], + [":white_large_square:", "⬜"], + [":star:", "⭐"], + [":o:", "⭕"], + [":wavy_dash:", "〰"], + [":part_alternation_mark:", "〽"], + [":congratulations:", "㊗"], + [":secret:", "㊙"], + [":mahjong:", "🀄"], + [":black_joker:", "🃏"], + [":a:", "🅰"], + [":b:", "🅱"], + [":o2:", "🅾"], + [":parking:", "🅿"], + [":ab:", "🆎"], + [":cl:", "🆑"], + [":cool:", "🆒"], + [":free:", "🆓"], + [":id:", "🆔"], + [":new:", "🆕"], + [":ng:", "🆖"], + [":ok:", "🆗"], + [":sos:", "🆘"], + [":up:", "🆙"], + [":vs:", "🆚"], + [":cn:", "🇨 🇳"], + [":de:", "🇩 🇪"], + [":es:", "🇪 🇸"], + [":fr:", "🇫 🇷"], + [":uk:", "🇬 🇧"], + [":it:", "🇮 🇹"], + [":jp:", "🇯 🇵"], + [":kr:", "🇰 🇷"], + [":ru:", "🇷 🇺"], + [":us:", "🇺 🇸"], + [":koko:", "🈁"], + [":sa:", "🈂"], + [":u7121:", "🈚"], + [":u6307:", "🈯"], + [":u7981:", "🈲"], + [":u7a7a:", "🈳"], + [":u5408:", "🈴"], + [":u6e80:", "🈵"], + [":u6709:", "🈶"], + [":u6708:", "🈷"], + [":u7533:", "🈸"], + [":u5272:", "🈹"], + [":u55b6:", "🈺"], + [":ideograph_advantage:", "🉐"], + [":accept:", "🉑"], + [":cyclone:", "🌀"], + [":foggy:", "🌁"], + [":closed_umbrella:", "🌂"], + [":night_with_stars:", "🌃"], + [":sunrise_over_mountains:", "🌄"], + [":sunrise:", "🌅"], + [":city_sunset:", "🌆"], + [":city_sunrise:", "🌇"], + [":rainbow:", "🌈"], + [":bridge_at_night:", "🌉"], + [":ocean:", "🌊"], + [":volcano:", "🌋"], + [":milky_way:", "🌌"], + [":earth_asia:", "🌏"], + [":new_moon:", "🌑"], + [":first_quarter_moon:", "🌓"], + [":waxing_gibbous_moon:", "🌔"], + [":full_moon:", "🌕"], + [":crescent_moon:", "🌙"], + [":first_quarter_moon_with_face:", "🌛"], + [":star2:", "🌟"], + [":stars:", "🌠"], + [":chestnut:", "🌰"], + [":seedling:", "🌱"], + [":palm_tree:", "🌴"], + [":cactus:", "🌵"], + [":tulip:", "🌷"], + [":cherry_blossom:", "🌸"], + [":rose:", "🌹"], + [":hibiscus:", "🌺"], + [":sunflower:", "🌻"], + [":blossom:", "🌼"], + [":corn:", "🌽"], + [":ear_of_rice:", "🌾"], + [":herb:", "🌿"], + [":four_leaf_clover:", "🍀"], + [":maple_leaf:", "🍁"], + [":fallen_leaf:", "🍂"], + [":leaves:", "🍃"], + [":mushroom:", "🍄"], + [":tomato:", "🍅"], + [":eggplant:", "🍆"], + [":grapes:", "🍇"], + [":melon:", "🍈"], + [":watermelon:", "🍉"], + [":tangerine:", "🍊"], + [":banana:", "🍌"], + [":pineapple:", "🍍"], + [":apple:", "🍎"], + [":green_apple:", "🍏"], + [":peach:", "🍑"], + [":cherries:", "🍒"], + [":strawberry:", "🍓"], + [":hamburger:", "🍔"], + [":pizza:", "🍕"], + [":meat_on_bone:", "🍖"], + [":poultry_leg:", "🍗"], + [":rice_cracker:", "🍘"], + [":rice_ball:", "🍙"], + [":rice:", "🍚"], + [":curry:", "🍛"], + [":ramen:", "🍜"], + [":spaghetti:", "🍝"], + [":bread:", "🍞"], + [":fries:", "🍟"], + [":sweet_potato:", "🍠"], + [":dango:", "🍡"], + [":oden:", "🍢"], + [":sushi:", "🍣"], + [":fried_shrimp:", "🍤"], + [":fish_cake:", "🍥"], + [":icecream:", "🍦"], + [":shaved_ice:", "🍧"], + [":ice_cream:", "🍨"], + [":doughnut:", "🍩"], + [":cookie:", "🍪"], + [":chocolate_bar:", "🍫"], + [":candy:", "🍬"], + [":lollipop:", "🍭"], + [":custard:", "🍮"], + [":honey_pot:", "🍯"], + [":cake:", "🍰"], + [":bento:", "🍱"], + [":stew:", "🍲"], + [":egg:", "🍳"], + [":fork_and_knife:", "🍴"], + [":tea:", "🍵"], + [":sake:", "🍶"], + [":wine_glass:", "🍷"], + [":cocktail:", "🍸"], + [":tropical_drink:", "🍹"], + [":beer:", "🍺"], + [":beers:", "🍻"], + [":ribbon:", "🎀"], + [":gift:", "🎁"], + [":birthday:", "🎂"], + [":jack_o_lantern:", "🎃"], + [":christmas_tree:", "🎄"], + [":santa:", "🎅"], + [":fireworks:", "🎆"], + [":sparkler:", "🎇"], + [":balloon:", "🎈"], + [":tada:", "🎉"], + [":confetti_ball:", "🎊"], + [":tanabata_tree:", "🎋"], + [":crossed_flags:", "🎌"], + [":bamboo:", "🎍"], + [":dolls:", "🎎"], + [":flags:", "🎏"], + [":wind_chime:", "🎐"], + [":rice_scene:", "🎑"], + [":school_satchel:", "🎒"], + [":mortar_board:", "🎓"], + [":carousel_horse:", "🎠"], + [":ferris_wheel:", "🎡"], + [":roller_coaster:", "🎢"], + [":fishing_pole_and_fish:", "🎣"], + [":microphone:", "🎤"], + [":movie_camera:", "🎥"], + [":cinema:", "🎦"], + [":headphones:", "🎧"], + [":art:", "🎨"], + [":tophat:", "🎩"], + [":circus_tent:", "🎪"], + [":ticket:", "🎫"], + [":clapper:", "🎬"], + [":performing_arts:", "🎭"], + [":video_game:", "🎮"], + [":dart:", "🎯"], + [":slot_machine:", "🎰"], + [":_8ball:", "🎱"], + [":game_die:", "🎲"], + [":bowling:", "🎳"], + [":flower_playing_cards:", "🎴"], + [":musical_note:", "🎵"], + [":notes:", "🎶"], + [":saxophone:", "🎷"], + [":guitar:", "🎸"], + [":musical_keyboard:", "🎹"], + [":trumpet:", "🎺"], + [":violin:", "🎻"], + [":musical_score:", "🎼"], + [":running_shirt_with_sash:", "🎽"], + [":tennis:", "🎾"], + [":ski:", "🎿"], + [":basketball:", "🏀"], + [":checkered_flag:", "🏁"], + [":snowboarder:", "🏂"], + [":runner:", "🏃"], + [":surfer:", "🏄"], + [":trophy:", "🏆"], + [":football:", "🏈"], + [":swimmer:", "🏊"], + [":house:", "🏠"], + [":house_with_garden:", "🏡"], + [":office:", "🏢"], + [":post_office:", "🏣"], + [":hospital:", "🏥"], + [":bank:", "🏦"], + [":atm:", "🏧"], + [":hotel:", "🏨"], + [":love_hotel:", "🏩"], + [":convenience_store:", "🏪"], + [":school:", "🏫"], + [":department_store:", "🏬"], + [":factory:", "🏭"], + [":izakaya_lantern:", "🏮"], + [":japanese_castle:", "🏯"], + [":european_castle:", "🏰"], + [":snail:", "🐌"], + [":snake:", "🐍"], + [":racehorse:", "🐎"], + [":sheep:", "🐑"], + [":monkey:", "🐒"], + [":chicken:", "🐔"], + [":boar:", "🐗"], + [":elephant:", "🐘"], + [":octopus:", "🐙"], + [":shell:", "🐚"], + [":bug:", "🐛"], + [":ant:", "🐜"], + [":bee:", "🐝"], + [":beetle:", "🐞"], + [":fish:", "🐟"], + [":tropical_fish:", "🐠"], + [":blowfish:", "🐡"], + [":turtle:", "🐢"], + [":hatching_chick:", "🐣"], + [":baby_chick:", "🐤"], + [":hatched_chick:", "🐥"], + [":bird:", "🐦"], + [":penguin:", "🐧"], + [":koala:", "🐨"], + [":poodle:", "🐩"], + [":camel:", "🐫"], + [":dolphin:", "🐬"], + [":mouse:", "🐭"], + [":cow:", "🐮"], + [":tiger:", "🐯"], + [":rabbit:", "🐰"], + [":cat:", "🐱"], + [":dragon_face:", "🐲"], + [":whale:", "🐳"], + [":horse:", "🐴"], + [":monkey_face:", "🐵"], + [":dog:", "🐶"], + [":pig:", "🐷"], + [":frog:", "🐸"], + [":hamster:", "🐹"], + [":wolf:", "🐺"], + [":bear:", "🐻"], + [":panda_face:", "🐼"], + [":pig_nose:", "🐽"], + [":feet:", "🐾"], + [":eyes:", "👀"], + [":ear:", "👂"], + [":nose:", "👃"], + [":lips:", "👄"], + [":tongue:", "👅"], + [":point_up_2:", "👆"], + [":point_down:", "👇"], + [":point_left:", "👈"], + [":point_right:", "👉"], + [":punch:", "👊"], + [":wave:", "👋"], + [":ok_hand:", "👌"], + [":thumbsup:", "👍"], + [":thumbsdown:", "👎"], + [":clap:", "👏"], + [":open_hands:", "👐"], + [":crown:", "👑"], + [":womans_hat:", "👒"], + [":eyeglasses:", "👓"], + [":necktie:", "👔"], + [":shirt:", "👕"], + [":jeans:", "👖"], + [":dress:", "👗"], + [":kimono:", "👘"], + [":bikini:", "👙"], + [":womans_clothes:", "👚"], + [":purse:", "👛"], + [":handbag:", "👜"], + [":pouch:", "👝"], + [":mans_shoe:", "👞"], + [":athletic_shoe:", "👟"], + [":high_heel:", "👠"], + [":sandal:", "👡"], + [":boot:", "👢"], + [":footprints:", "👣"], + [":bust_in_silhouette:", "👤"], + [":boy:", "👦"], + [":girl:", "👧"], + [":man:", "👨"], + [":woman:", "👩"], + [":family:", "👪"], + [":couple:", "👫"], + [":cop:", "👮"], + [":dancers:", "👯"], + [":bride_with_veil:", "👰"], + [":person_with_blond_hair:", "👱"], + [":man_with_gua_pi_mao:", "👲"], + [":man_with_turban:", "👳"], + [":older_man:", "👴"], + [":older_woman:", "👵"], + [":baby:", "👶"], + [":construction_worker:", "👷"], + [":princess:", "👸"], + [":japanese_ogre:", "👹"], + [":japanese_goblin:", "👺"], + [":ghost:", "👻"], + [":angel:", "👼"], + [":alien:", "👽"], + [":space_invader:", "👾"], + [":robot_face:", "🤖"], + [":imp:", "👿"], + [":skull:", "💀"], + [":information_desk_person:", "💁"], + [":guardsman:", "💂"], + [":dancer:", "💃"], + [":lipstick:", "💄"], + [":nail_care:", "💅"], + [":massage:", "💆"], + [":haircut:", "💇"], + [":barber:", "💈"], + [":syringe:", "💉"], + [":pill:", "💊"], + [":kiss:", "💋"], + [":love_letter:", "💌"], + [":ring:", "💍"], + [":gem:", "💎"], + [":couplekiss:", "💏"], + [":bouquet:", "💐"], + [":couple_with_heart:", "💑"], + [":wedding:", "💒"], + [":heartbeat:", "💓"], + [":broken_heart:", "💔"], + [":two_hearts:", "💕"], + [":sparkling_heart:", "💖"], + [":heartpulse:", "💗"], + [":cupid:", "💘"], + [":blue_heart:", "💙"], + [":green_heart:", "💚"], + [":yellow_heart:", "💛"], + [":purple_heart:", "💜"], + [":gift_heart:", "💝"], + [":revolving_hearts:", "💞"], + [":heart_decoration:", "💟"], + [":diamond_shape_with_a_dot_inside:", "💠"], + [":bulb:", "💡"], + [":anger:", "💢"], + [":bomb:", "💣"], + [":zzz:", "💤"], + [":boom:", "💥"], + [":sweat_drops:", "💦"], + [":droplet:", "💧"], + [":dash:", "💨"], + [":poop:", "💩"], + [":muscle:", "💪"], + [":dizzy:", "💫"], + [":speech_balloon:", "💬"], + [":white_flower:", "💮"], + [":_100:", "💯"], + [":moneybag:", "💰"], + [":currency_exchange:", "💱"], + [":heavy_dollar_sign:", "💲"], + [":credit_card:", "💳"], + [":yen:", "💴"], + [":dollar:", "💵"], + [":money_with_wings:", "💸"], + [":chart:", "💹"], + [":seat:", "💺"], + [":computer:", "💻"], + [":briefcase:", "💼"], + [":minidisc:", "💽"], + [":floppy_disk:", "💾"], + [":cd:", "💿"], + [":dvd:", "📀"], + [":file_folder:", "📁"], + [":open_file_folder:", "📂"], + [":page_with_curl:", "📃"], + [":page_facing_up:", "📄"], + [":date:", "📅"], + [":calendar:", "📆"], + [":card_index:", "📇"], + [":chart_with_upwards_trend:", "📈"], + [":chart_with_downwards_trend:", "📉"], + [":bar_chart:", "📊"], + [":clipboard:", "📋"], + [":pushpin:", "📌"], + [":round_pushpin:", "📍"], + [":paperclip:", "📎"], + [":straight_ruler:", "📏"], + [":triangular_ruler:", "📐"], + [":bookmark_tabs:", "📑"], + [":ledger:", "📒"], + [":notebook:", "📓"], + [":notebook_with_decorative_cover:", "📔"], + [":closed_book:", "📕"], + [":book:", "📖"], + [":green_book:", "📗"], + [":blue_book:", "📘"], + [":orange_book:", "📙"], + [":books:", "📚"], + [":name_badge:", "📛"], + [":scroll:", "📜"], + [":pencil:", "📝"], + [":telephone_receiver:", "📞"], + [":pager:", "📟"], + [":fax:", "📠"], + [":satellite:", "📡"], + [":loudspeaker:", "📢"], + [":mega:", "📣"], + [":outbox_tray:", "📤"], + [":inbox_tray:", "📥"], + [":package:", "📦"], + [":e_mail:", "📧"], + [":incoming_envelope:", "📨"], + [":envelope_with_arrow:", "📩"], + [":mailbox_closed:", "📪"], + [":mailbox:", "📫"], + [":postbox:", "📮"], + [":newspaper:", "📰"], + [":iphone:", "📱"], + [":calling:", "📲"], + [":vibration_mode:", "📳"], + [":mobile_phone_off:", "📴"], + [":signal_strength:", "📶"], + [":camera:", "📷"], + [":video_camera:", "📹"], + [":tv:", "📺"], + [":radio:", "📻"], + [":vhs:", "📼"], + [":arrows_clockwise:", "🔃"], + [":loud_sound:", "🔊"], + [":battery:", "🔋"], + [":electric_plug:", "🔌"], + [":mag:", "🔍"], + [":mag_right:", "🔎"], + [":lock_with_ink_pen:", "🔏"], + [":closed_lock_with_key:", "🔐"], + [":key:", "🔑"], + [":lock:", "🔒"], + [":unlock:", "🔓"], + [":bell:", "🔔"], + [":bookmark:", "🔖"], + [":link:", "🔗"], + [":radio_button:", "🔘"], + [":back:", "🔙"], + [":end:", "🔚"], + [":on:", "🔛"], + [":soon:", "🔜"], + [":top:", "🔝"], + [":underage:", "🔞"], + [":keycap_ten:", "🔟"], + [":capital_abcd:", "🔠"], + [":abcd:", "🔡"], + [":_1234:", "🔢"], + [":symbols:", "🔣"], + [":abc:", "🔤"], + [":fire:", "🔥"], + [":flashlight:", "🔦"], + [":wrench:", "🔧"], + [":hammer:", "🔨"], + [":nut_and_bolt:", "🔩"], + [":knife:", "🔪"], + [":gun:", "🔫"], + [":crystal_ball:", "🔮"], + [":six_pointed_star:", "🔯"], + [":beginner:", "🔰"], + [":trident:", "🔱"], + [":black_square_button:", "🔲"], + [":white_square_button:", "🔳"], + [":red_circle:", "🔴"], + [":large_blue_circle:", "🔵"], + [":large_orange_diamond:", "🔶"], + [":large_blue_diamond:", "🔷"], + [":small_orange_diamond:", "🔸"], + [":small_blue_diamond:", "🔹"], + [":small_red_triangle:", "🔺"], + [":small_red_triangle_down:", "🔻"], + [":arrow_up_small:", "🔼"], + [":arrow_down_small:", "🔽"], + [":clock1:", "🕐"], + [":clock2:", "🕑"], + [":clock3:", "🕒"], + [":clock4:", "🕓"], + [":clock5:", "🕔"], + [":clock6:", "🕕"], + [":clock7:", "🕖"], + [":clock8:", "🕗"], + [":clock9:", "🕘"], + [":clock10:", "🕙"], + [":clock11:", "🕚"], + [":clock12:", "🕛"], + [":mount_fuji:", "🗻"], + [":tokyo_tower:", "🗼"], + [":statue_of_liberty:", "🗽"], + [":japan:", "🗾"], + [":moyai:", "🗿"], + [":grin:", "😁"], + [":joy:", "😂"], + [":smiley:", "😃"], + [":smile:", "😄"], + [":sweat_smile:", "😅"], + [":laughing:", "😆"], + [":wink:", "😉"], + [":blush:", "😊"], + [":yum:", "😋"], + [":relieved:", "😌"], + [":heart_eyes:", "😍"], + [":smirk:", "😏"], + [":unamused:", "😒"], + [":sweat:", "😓"], + [":pensive:", "😔"], + [":confounded:", "😖"], + [":kissing_heart:", "😘"], + [":kissing_closed_eyes:", "😚"], + [":stuck_out_tongue_winking_eye:", "😜"], + [":stuck_out_tongue_closed_eyes:", "😝"], + [":disappointed:", "😞"], + [":angry:", "😠"], + [":rage:", "😡"], + [":cry:", "😢"], + [":persevere:", "😣"], + [":triumph:", "😤"], + [":disappointed_relieved:", "😥"], + [":fearful:", "😨"], + [":weary:", "😩"], + [":sleepy:", "😪"], + [":tired_face:", "😫"], + [":sob:", "😭"], + [":cold_sweat:", "😰"], + [":scream:", "😱"], + [":astonished:", "😲"], + [":flushed:", "😳"], + [":dizzy_face:", "😵"], + [":mask:", "😷"], + [":smile_cat:", "😸"], + [":joy_cat:", "😹"], + [":smiley_cat:", "😺"], + [":heart_eyes_cat:", "😻"], + [":smirk_cat:", "😼"], + [":kissing_cat:", "😽"], + [":pouting_cat:", "😾"], + [":crying_cat_face:", "😿"], + [":scream_cat:", "🙀"], + [":no_good:", "🙅"], + [":ok_woman:", "🙆"], + [":bow:", "🙇"], + [":see_no_evil:", "🙈"], + [":hear_no_evil:", "🙉"], + [":speak_no_evil:", "🙊"], + [":raising_hand:", "🙋"], + [":raised_hands:", "🙌"], + [":person_frowning:", "🙍"], + [":person_with_pouting_face:", "🙎"], + [":pray:", "🙏"], + [":rocket:", "🚀"], + [":railway_car:", "🚃"], + [":bullettrain_side:", "🚄"], + [":bullettrain_front:", "🚅"], + [":metro:", "🚇"], + [":station:", "🚉"], + [":bus:", "🚌"], + [":busstop:", "🚏"], + [":ambulance:", "🚑"], + [":fire_engine:", "🚒"], + [":police_car:", "🚓"], + [":taxi:", "🚕"], + [":red_car:", "🚗"], + [":blue_car:", "🚙"], + [":truck:", "🚚"], + [":ship:", "🚢"], + [":speedboat:", "🚤"], + [":traffic_light:", "🚥"], + [":construction:", "🚧"], + [":rotating_light:", "🚨"], + [":triangular_flag_on_post:", "🚩"], + [":door:", "🚪"], + [":no_entry_sign:", "🚫"], + [":smoking:", "🚬"], + [":no_smoking:", "🚭"], + [":bike:", "🚲"], + [":walking:", "🚶"], + [":mens:", "🚹"], + [":womens:", "🚺"], + [":restroom:", "🚻"], + [":baby_symbol:", "🚼"], + [":toilet:", "🚽"], + [":wc:", "🚾"], + [":bath:", "🛀"], + [":articulated_lorry:", "🚛"], + [":kissing_smiling_eyes:", "😙"], + [":pear:", "🍐"], + [":bicyclist:", "🚴"], + [":rabbit2:", "🐇"], + [":clock830:", "🕣"], + [":train:", "🚋"], + [":oncoming_automobile:", "🚘"], + [":expressionless:", "😑"], + [":smiling_imp:", "😈"], + [":frowning:", "😦"], + [":no_mouth:", "😶"], + [":baby_bottle:", "🍼"], + [":non_potable_water:", "🚱"], + [":open_mouth:", "😮"], + [":last_quarter_moon_with_face:", "🌜"], + [":do_not_litter:", "🚯"], + [":sunglasses:", "😎"], + [":loop:", "➿"], + [":last_quarter_moon:", "🌗"], + [":grinning:", "😀"], + [":euro:", "💶"], + [":clock330:", "🕞"], + [":telescope:", "🔭"], + [":globe_with_meridians:", "🌐"], + [":postal_horn:", "📯"], + [":stuck_out_tongue:", "😛"], + [":clock1030:", "🕥"], + [":pound:", "💷"], + [":two_men_holding_hands:", "👬"], + [":tiger2:", "🐅"], + [":anguished:", "😧"], + [":vertical_traffic_light:", "🚦"], + [":confused:", "😕"], + [":repeat:", "🔁"], + [":oncoming_police_car:", "🚔"], + [":tram:", "🚊"], + [":dragon:", "🐉"], + [":earth_americas:", "🌎"], + [":rugby_football:", "🏉"], + [":left_luggage:", "🛅"], + [":sound:", "🔉"], + [":clock630:", "🕡"], + [":dromedary_camel:", "🐪"], + [":oncoming_bus:", "🚍"], + [":horse_racing:", "🏇"], + [":rooster:", "🐓"], + [":rowboat:", "🚣"], + [":customs:", "🛃"], + [":repeat_one:", "🔂"], + [":waxing_crescent_moon:", "🌒"], + [":mountain_railway:", "🚞"], + [":clock930:", "🕤"], + [":put_litter_in_its_place:", "🚮"], + [":arrows_counterclockwise:", "🔄"], + [":clock130:", "🕜"], + [":goat:", "🐐"], + [":pig2:", "🐖"], + [":innocent:", "😇"], + [":no_bicycles:", "🚳"], + [":light_rail:", "🚈"], + [":whale2:", "🐋"], + [":train2:", "🚆"], + [":earth_africa:", "🌍"], + [":shower:", "🚿"], + [":waning_gibbous_moon:", "🌖"], + [":steam_locomotive:", "🚂"], + [":cat2:", "🐈"], + [":tractor:", "🚜"], + [":thought_balloon:", "💭"], + [":two_women_holding_hands:", "👭"], + [":full_moon_with_face:", "🌝"], + [":mouse2:", "🐁"], + [":clock430:", "🕟"], + [":worried:", "😟"], + [":rat:", "🐀"], + [":ram:", "🐏"], + [":dog2:", "🐕"], + [":kissing:", "😗"], + [":helicopter:", "🚁"], + [":clock1130:", "🕦"], + [":no_mobile_phones:", "📵"], + [":european_post_office:", "🏤"], + [":ox:", "🐂"], + [":mountain_cableway:", "🚠"], + [":sleeping:", "😴"], + [":cow2:", "🐄"], + [":minibus:", "🚐"], + [":clock730:", "🕢"], + [":aerial_tramway:", "🚡"], + [":speaker:", "🔈"], + [":no_bell:", "🔕"], + [":mailbox_with_mail:", "📬"], + [":no_pedestrians:", "🚷"], + [":microscope:", "🔬"], + [":bathtub:", "🛁"], + [":suspension_railway:", "🚟"], + [":crocodile:", "🐊"], + [":mountain_bicyclist:", "🚵"], + [":waning_crescent_moon:", "🌘"], + [":monorail:", "🚝"], + [":children_crossing:", "🚸"], + [":clock230:", "🕝"], + [":busts_in_silhouette:", "👥"], + [":mailbox_with_no_mail:", "📭"], + [":leopard:", "🐆"], + [":deciduous_tree:", "🌳"], + [":oncoming_taxi:", "🚖"], + [":lemon:", "🍋"], + [":mute:", "🔇"], + [":baggage_claim:", "🛄"], + [":twisted_rightwards_arrows:", "🔀"], + [":sun_with_face:", "🌞"], + [":trolleybus:", "🚎"], + [":evergreen_tree:", "🌲"], + [":passport_control:", "🛂"], + [":new_moon_with_face:", "🌚"], + [":potable_water:", "🚰"], + [":high_brightness:", "🔆"], + [":low_brightness:", "🔅"], + [":clock530:", "🕠"], + [":hushed:", "😯"], + [":grimacing:", "😬"], + [":water_buffalo:", "🐃"], + [":neutral_face:", "😐"], + [":clock1230:", "🕧"], + [":P", "😛" ], + [":)", "🙂" ], + [":D", "😃" ], + [":o", "😮" ], + [":O", "😮" ], + [":(", "☹️" ], + [":|", "😐" ], +]; + +// =========================================================================== + +// =========================================================================== + function makeLargeNumberReadable(num) { return new Number(num).toLocaleString("en-US"); } @@ -1459,4 +2416,275 @@ function getConsoleClient() { } } +// =========================================================================== + +function getServerColours() { + return serverColours; +} + +// =========================================================================== + +function getColourByType(typeName) { + return getServerColours().byType[typeName]; +} + +// =========================================================================== + +function getColourByName(colourName) { + return getServerColours().byName[colourName]; +} + +// =========================================================================== + +function getHexColourByName(colourName) { + //let rgbaColour = getServerColours().byName[colourName]; + //let rgbaArray = rgbaArrayFromToColour(rgbaColour); + //return rgbToHex(rgbaArray[0], rgbaArray[1], rgbaArray[2]); + + return `#${getServerColours().hex.byName[colourName]}`; +} + +// =========================================================================== + +function getHexColourByType(colourName) { + //let rgbaColour = getServerColours().byType[colourName]; + //let rgbaArray = rgbaArrayFromToColour(rgbaColour); + //return rgbToHex(rgbaArray[0], rgbaArray[1], rgbaArray[2]); + + return `#${getServerColours().hex.byType[colourName]}`; +} + +// =========================================================================== + +function getPlayerColour(client) { + if(getPlayerData(client) != false) { + if(!isPlayerLoggedIn(client)) { + return getColourByName("darkGrey"); + } else { + if(isPlayerWorking(client)) { + return getJobData(getJobIndexFromDatabaseId(getPlayerCurrentSubAccount(client).job)).colour; + } + } + } + + return getColourByName("civilianWhite"); +} + +// =========================================================================== + +/** + * Gets the red/green colour depending on bool (red = false, green = true) for inline use in chatbox messages + * + * @param {Boolean} boolValue The boolean value + * @return {String} Red or green inline HEX colour string + * + */ +function getBoolRedGreenInlineColour(boolValue) { + return (!boolValue) ? "{softRed}" : "{softGreen}"; +} + +// =========================================================================== + +/** + * Gets an array of RGB colour values from a HEX colour string + * + * @param {String} hexColour Hex colour string + * @return {Array} 3-slot array where each slot is an RGB colour value + * + */ +function hexToRgb(h) { + return [ + '0x'+h[1]+h[2]|0, + '0x'+h[3]+h[4]|0, + '0x'+h[5]+h[6]|0 + ]; +} + +// =========================================================================== + +/** + * Gets a HEX colour string from RGB values, without brackets (example: #FFFFFF) + * + * @param {Number} red Red RGB value + * @param {Number} green Green RGB value + * @param {Number} blue Blue RGB value + * @return {String} HEX colour string + * + */ +function rgbToHex(r, g, b) { + return "#"+((1<<24)+(r<<16)+(g<<8)+ b).toString(16).slice(1); +} + +// =========================================================================== + +/** + * Gets the current colour for a player (affected by job and status) + * + * @param {Client} client Player client + * @return {Number} Colour integer + * + */ +function getClientChatColour(client) { + let tempJob = getPlayerCurrentSubAccount(client).job; + if(tempJob != -1) { + if(getPlayerData(client).isWorking) { + return getJobData(tempJob).jobColour; + } + } + return getColourByName("white"); +} + +// =========================================================================== + +/** + * Gets a toColour-created colour integer with random RGB values (alpha is always 255) + * + * @return {Number} Colour integer + * + */ +function getRandomRGB() { + return toColour.apply(null, [ + getRandom(0, 255), + getRandom(0, 255), + getRandom(0, 255), + 255 + ]); +} + +// =========================================================================== + +/** + * Gets a hex formatting colour by name for use inline in chatbox messages (example: [#FFFFFF]). + * + * @param {String} colourName - Colour name + * @return {String} HEX-formatted colour string with brackets + * + */ +function getInlineChatColourByName(colourName) { + return `{${colourName}}`; +} + +// =========================================================================== + +/** + * Gets a hex formatting colour by type for use inline in chatbox messages (example: [#FFFFFF]). + * + * @param {String} colourName - Colour type + * @return {String} HEX-formatted colour string with brackets + * + */ +function getInlineChatColourByType(colourName) { + return `{${colourName}}`; +} + +// =========================================================================== + +/** + * Gets an array of RGBA colour values from a toColour integer. + * + * @param {Number} colour - Colour integer created by toColour + * @return {Array} 4-slot array where each slot is an RGBA colour value + * + */ +function rgbaArrayFromToColour(colour) { + //return [ + // (colour >> 24) & 0xFF, // red + // (colour >> 16) & 0xFF, + // (colour >> 8) & 0xFF, + // colour & 0xFF // alpha + //]; + return [ + (colour >> 16) & 0xFF, // red + (colour >> 8) & 0xFF, + colour & 0xFF, + (colour >> 24) & 0xFF// alpha + ]; +} + +// =========================================================================== + +function hexFromToColour(colour) { + let rgba = rgbaArrayFromToColour(colour); + return rgbToHex(rgba[0], rgba[1], rgba[2]); +} + +// =========================================================================== + +function replaceColoursInMessage(messageText) { + if(messageText == null) { + return ""; + } + + let tempFind = `{RESETCOLOUR}`; + let tempRegex = new RegExp(tempFind, 'g'); + messageText = messageText.replace(tempRegex, "[/#]"); + + tempFind = `{ALTCOLOUR}`; + tempRegex = new RegExp(tempFind, 'g'); + messageText = messageText.replace(tempRegex, "[#C8C8C8]"); + + tempFind = `{MAINCOLOUR}`; + tempRegex = new RegExp(tempFind, 'g'); + messageText = messageText.replace(tempRegex, "[#FFFFFF]"); + + for(let i in getServerColours().hex.byName) { + let find = `{${i}}`; + let re = new RegExp(find, 'g'); + messageText = messageText.replace(re, `[#${getServerColours().hex.byName[i]}]`); + } + + for(let i in getServerColours().hex.byType) { + let find = `{${i}}`; + let re = new RegExp(find, 'g'); + messageText = messageText.replace(re, `[#${getServerColours().hex.byType[i]}]`); + } + + return messageText; +} + +// =========================================================================== + +function removeColoursInMessage(messageText) { + if(messageText == null) { + return ""; + } + + let tempFind = `{RESETCOLOUR}`; + let tempRegex = new RegExp(tempFind, 'g'); + messageText = messageText.replace(tempRegex, ""); + + tempFind = `{ALTCOLOUR}`; + tempRegex = new RegExp(tempFind, 'g'); + messageText = messageText.replace(tempRegex, ""); + + tempFind = `{MAINCOLOUR}`; + tempRegex = new RegExp(tempFind, 'g'); + messageText = messageText.replace(tempRegex, ""); + + for(let i in getServerColours().hex.byName) { + let find = `{${i}}`; + let re = new RegExp(find, 'g'); + messageText = messageText.replace(re, ""); + } + + for(let i in getServerColours().hex.byType) { + let find = `{${i}}`; + let re = new RegExp(find, 'g'); + messageText = messageText.replace(re, ""); + } + + return messageText; +} + +// =========================================================================== + +function replaceEmojiInString(messageString) { + for(let i in emojiReplaceString) { + while(messageString.indexOf(emojiReplaceString[i][0]) != -1) { + messageString = messageString.replace(emojiReplaceString[i][0], emojiReplaceString[i][1]); + } + } + return messageString; +} + // =========================================================================== \ No newline at end of file From 9b4d88d67a31209d20b3f8824ecb85ddbb575e9b Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sat, 26 Feb 2022 21:30:16 -0600 Subject: [PATCH 02/44] Woops shout and megaphone output is swapped --- scripts/server/messaging.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/server/messaging.js b/scripts/server/messaging.js index 91a5608f..29c7eb4d 100644 --- a/scripts/server/messaging.js +++ b/scripts/server/messaging.js @@ -163,13 +163,13 @@ function messagePlayerWhisper(client, whisperingClient, messageText) { // =========================================================================== -function messagePlayerShout(client, shoutingClient, messageText) { +function messagePlayerMegaPhone(client, shoutingClient, messageText) { messagePlayerNormal(client, `📢 ${getPlayerAccentInlineOutput(shoutingClient)}${getClientSubAccountName(shoutingClient)} (megaphone): ${messageText}!`, getColourByType("yellow")); } // =========================================================================== -function messagePlayerMegaPhone(client, shoutingClient, messageText) { +function messagePlayerShout(client, shoutingClient, messageText) { messagePlayerNormal(client, `🗣️ ${getPlayerAccentInlineOutput(shoutingClient)}${getClientSubAccountName(shoutingClient)} shouts: ${messageText}!`, getColourByType("shoutMessage")); } From 801f118a02f296108440d37c210e379de45fe5a1 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sat, 26 Feb 2022 21:30:27 -0600 Subject: [PATCH 03/44] Re-add old police commands (unfinished) --- scripts/server/job/police.js | 156 +++++++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+) diff --git a/scripts/server/job/police.js b/scripts/server/job/police.js index b842a8a2..a3aeeed9 100644 --- a/scripts/server/job/police.js +++ b/scripts/server/job/police.js @@ -6,3 +6,159 @@ // DESC: Provides police officer job functions and usage // TYPE: Job (JavaScript) // =========================================================================== + +function policeTazerCommand(command, params, client) { + if(!canPlayerUseJobs(client)) { + messagePlayerError(client, "You are not allowed to use jobs."); + return false; + } + + if(!canPlayerUsePoliceJob(client)) { + messagePlayerError(client, "You are not allowed to use the police job."); + return false; + } + + if(!isPlayerWorking(client)) { + messagePlayerError(client, "You are not working! Use /startwork first."); + return false; + } + + if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) { + messagePlayerError(client, "You don't have a police job."); + return false; + } + + return true; +} + +// =========================================================================== + +function policeCuffCommand(command, params, client) { + if(!canPlayerUseJobs(client)) { + messagePlayerError(client, "You are not allowed to use jobs."); + return false; + } + + if(!canPlayerUsePoliceJob(client)) { + messagePlayerError(client, "You are not allowed to use the police job."); + return false; + } + + if(!isPlayerWorking(client)) { + messagePlayerError(client, "You are not working! Use /startwork first."); + return false; + } + + if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) { + messagePlayerError(client, "You don't have a police job."); + return false; + } + + return true; +} + +// =========================================================================== + +function policeArrestCommand(command, params, client) { + if(!canPlayerUseJobs(client)) { + messagePlayerError(client, "You are not allowed to use jobs."); + return false; + } + + if(!canPlayerUsePoliceJob(client)) { + messagePlayerError(client, "You are not allowed to use the police job."); + return false; + } + + if(!isPlayerWorking(client)) { + messagePlayerError(client, "You are not working! Use /startwork first."); + return false; + } + + if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) { + messagePlayerError(client, "You don't have a police job."); + return false; + } + + return true; +} + +// =========================================================================== + +function policeSearchCommand(command, params, client) { + if(!canPlayerUseJobs(client)) { + messagePlayerError(client, "You are not allowed to use jobs."); + return false; + } + + if(!canPlayerUsePoliceJob(client)) { + messagePlayerError(client, "You are not allowed to use the police job."); + return false; + } + + if(!isPlayerWorking(client)) { + messagePlayerError(client, "You are not working! Use /startwork first."); + return false; + } + + if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) { + messagePlayerError(client, "You don't have a police job."); + return false; + } + + return true; +} + +// =========================================================================== + +function policeDragCommand(command, params, client) { + if(!canPlayerUseJobs(client)) { + messagePlayerError(client, "You are not allowed to use jobs."); + return false; + } + + if(!canPlayerUsePoliceJob(client)) { + messagePlayerError(client, "You are not allowed to use the police job."); + return false; + } + + if(!isPlayerWorking(client)) { + messagePlayerError(client, "You are not working! Use /startwork first."); + return false; + } + + if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) { + messagePlayerError(client, "You don't have a police job."); + return false; + } + + return true; +} + +// =========================================================================== + +function policeDetainCommand(command, params, client) { + if(!canPlayerUseJobs(client)) { + messagePlayerError(client, "You are not allowed to use jobs."); + return false; + } + + if(!canPlayerUsePoliceJob(client)) { + messagePlayerError(client, "You are not allowed to use the police job."); + return false; + } + + if(!isPlayerWorking(client)) { + messagePlayerError(client, "You are not working! Use /startwork first."); + return false; + } + + if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) { + messagePlayerError(client, "You don't have a police job."); + return false; + } + + return true; +} + +// =========================================================================== \ No newline at end of file From caaad0ec2b992fb31f6d6aaf71215f40f1cdd2ed Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sat, 26 Feb 2022 21:30:37 -0600 Subject: [PATCH 04/44] Fix for invalid skin --- scripts/server/staff.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/server/staff.js b/scripts/server/staff.js index d9adbf42..fa8e0247 100644 --- a/scripts/server/staff.js +++ b/scripts/server/staff.js @@ -1008,7 +1008,7 @@ function forcePlayerSkinCommand(command, params, client) { return false; } - if(!skinIndex) { + if(skinIndex == false) { messagePlayerError(client, "That skin is invalid!"); return false; } From b1a6e68a05728dc814db7b0aa4f7ce1816d9537d Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sat, 26 Feb 2022 21:31:00 -0600 Subject: [PATCH 05/44] Fix wrong data being sent to player hotbar update func --- scripts/server/item.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/server/item.js b/scripts/server/item.js index aca875e2..3c287de3 100644 --- a/scripts/server/item.js +++ b/scripts/server/item.js @@ -1264,9 +1264,9 @@ function deleteItem(itemId) { ownerTypeString = "Player"; owner = getPlayerFromCharacterId(getItemData(itemId).ownerId); if(getPlayerData(owner) != false) { - switchPlayerActiveHotBarSlot(getPlayerData(owner), -1); + switchPlayerActiveHotBarSlot(owner, -1); getPlayerData(owner).hotBarItems[getPlayerData(owner).hotBarItems.indexOf(itemId)] = -1; - updatePlayerHotBar(getPlayerData(owner)); + updatePlayerHotBar(owner); } break; From a5f5558bc92421b221b1f77f746bdd93ddd206be Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sat, 26 Feb 2022 21:31:15 -0600 Subject: [PATCH 06/44] Add set tester cmd --- scripts/server/developer.js | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/scripts/server/developer.js b/scripts/server/developer.js index c6be0bdc..7ee25bef 100644 --- a/scripts/server/developer.js +++ b/scripts/server/developer.js @@ -341,7 +341,7 @@ function executeClientCodeCommand(command, params, client) { let targetCode = splitParams.slice(1).join(" "); if(!targetClient) { - messagePlayerError(client, "That player was not found!"); + messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); return false; } @@ -359,6 +359,33 @@ function executeClientCodeCommand(command, params, client) { // =========================================================================== +function setPlayerTesterStatusCommand(command, params, client) { + if(areParamsEmpty(params)) { + messagePlayerSyntax(client, getCommandSyntaxText(command)); + return false; + } + + let targetClient = getPlayerFromParams(params); + + if(!targetClient) { + messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); + return false; + } + + if(!hasBitFlag(getPlayerData(targetClient).accountData.flags.moderation, getModerationFlagValue("IsTester"))) { + getPlayerData(targetClient).accountData.flags.moderation = addBitFlag(getPlayerData(targetClient).accountData.flags.moderation, getModerationFlagValue("IsTester")); + } else { + getPlayerData(targetClient).accountData.flags.moderation = removeBitFlag(getPlayerData(targetClient).accountData.flags.moderation, getModerationFlagValue("IsTester")); + } + + let enabled = hasBitFlag(getPlayerData(targetClient).accountData.flags.moderation, getModerationFlagValue("IsTester")); + + messageAdminAction(`{ALTCOLOUR}${client.name} ${getBoolRedGreenInlineColour(enabled)}${toUpperCase(getEnabledDisabledFromBool(enabled))} {ALTCOLOUR}${targetClient.name}'s {MAINCOLOUR}tester status`) + return true; +} + +// =========================================================================== + function saveAllServerDataCommand(command, params, client) { messageAdmins(`{clanOrange}Vortrex has forced a manual save of all data. Initiating ...`); saveAllServerDataToDatabase(); From f22c001c48a044fded5ca0db3dbdb6f859fa6afb Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sat, 26 Feb 2022 21:31:48 -0600 Subject: [PATCH 07/44] Move bool settings for server config to bitflags --- scripts/server/bitflag.js | 3 ++- scripts/server/class.js | 47 +++++++++++++++++---------------------- scripts/server/config.js | 28 +++++++++++------------ 3 files changed, 37 insertions(+), 41 deletions(-) diff --git a/scripts/server/bitflag.js b/scripts/server/bitflag.js index 50bbcc22..883f0aa7 100644 --- a/scripts/server/bitflag.js +++ b/scripts/server/bitflag.js @@ -62,7 +62,8 @@ let serverBitFlagKeys = { "TwoFactorAuthVerified", "NonRoleplayCharacterName", "CanHearEverything", - "DontSyncClientElements" + "DontSyncClientElements", + "IsTester" ], factionFlagKeys: [ "None", diff --git a/scripts/server/class.js b/scripts/server/class.js index 61038308..6219c2d1 100644 --- a/scripts/server/class.js +++ b/scripts/server/class.js @@ -22,8 +22,6 @@ function initClassScript() { class ServerData { constructor(dbAssoc = false) { this.databaseId = 0; - this.name = ""; - this.password = ""; this.needsSaved = false; this.newCharacter = { @@ -59,6 +57,8 @@ class ServerData { this.guiTextColourSecondary = [0, 0, 0]; this.showLogo = true; this.inflationMultiplier = 1; + this.testerOnly = false; + this.settings = 0; this.antiCheat = { enabled: false, @@ -104,52 +104,47 @@ class ServerData { bank: dbAssoc["svr_newchar_bank"], skin: dbAssoc["svr_newchar_skin"], }, + this.settings = toInteger(dbAssoc["svr_settings"]); + this.connectCameraPosition = toVector3(dbAssoc["svr_connectcam_pos_x"], dbAssoc["svr_connectcam_pos_y"], dbAssoc["svr_connectcam_pos_z"]); this.connectCameraLookAt = toVector3(dbAssoc["svr_connectcam_lookat_x"], dbAssoc["svr_connectcam_lookat_y"], dbAssoc["svr_connectcam_lookat_z"]); - //this.characterSelectCameraPosition = toVector3(dbAssoc["svr_charselect_cam_pos_x"], dbAssoc["svr_charselect_cam_pos_y"], dbAssoc["svr_charselect_cam_pos_z"]); - //this.characterSelectCameraLookAt = toVector3(dbAssoc["svr_charselect_cam_lookat_x"], dbAssoc["svr_charselect_cam_lookat_y"], dbAssoc["svr_charselect_cam_lookat_z"]); - - //this.characterSelectPedPosition = toVector3(dbAssoc["svr_charselect_ped_pos_x"], dbAssoc["svr_charselect_ped_pos_y"], dbAssoc["svr_charselect_ped_pos_z"]); - //this.characterSelectPedHeading = toFloat(dbAssoc["svr_charselect_ped_rot_z"]); - //this.characterSelectInterior = toInteger(dbAssoc["svr_charselect_int"]); - //this.characterSelectDimension = toInteger(dbAssoc["svr_charselect_int"]); - this.hour = toInteger(dbAssoc["svr_start_time_hour"]); this.minute = toInteger(dbAssoc["svr_start_time_min"]); this.minuteDuration = toInteger(dbAssoc["svr_time_min_duration"]); this.weather = toInteger(dbAssoc["svr_start_weather"]); - this.fallingSnow = intToBool(dbAssoc["svr_start_snow_falling"]); - this.groundSnow = intToBool(dbAssoc["svr_start_snow_ground"]); - this.useGUI = intToBool(dbAssoc["svr_gui"]); + this.fallingSnow = hasBitFlag(this.settings, getServerSettingsFlagValue("FallingSnow")); + this.groundSnow = hasBitFlag(this.settings, getServerSettingsFlagValue("GroundSnow")); + this.useGUI = hasBitFlag(this.settings, getServerSettingsFlagValue("GUI")); this.guiColourPrimary = [toInteger(dbAssoc["svr_gui_col1_r"]), toInteger(dbAssoc["svr_gui_col1_g"]), toInteger(dbAssoc["svr_gui_col1_b"])]; this.guiColourSecondary = [toInteger(dbAssoc["svr_gui_col2_r"]), toInteger(dbAssoc["svr_gui_col2_g"]), toInteger(dbAssoc["svr_gui_col2_b"])]; this.guiTextColourPrimary = [toInteger(dbAssoc["svr_gui_textcol1_r"]), toInteger(dbAssoc["svr_gui_textcol1_g"]), toInteger(dbAssoc["svr_gui_textcol1_b"])]; //this.guiTextColourSecondary = [toInteger(dbAssoc["svr_gui_textcol2_r"]), toInteger(dbAssoc["svr_gui_textcol2_g"]), toInteger(dbAssoc["svr_gui_textcol2_b"])]; - this.showLogo = intToBool(dbAssoc["svr_logo"]); + this.showLogo = hasBitFlag(this.settings, getServerSettingsFlagValue("Logo")); this.inflationMultiplier = toFloat(dbAssoc["svr_inflation_multiplier"]); + this.testerOnly = hasBitFlag(this.settings, getServerSettingsFlagValue("Testing")); this.antiCheat = { - enabled: intToBool(dbAssoc["svr_ac_enabled"]), - checkGameScripts: intToBool(dbAssoc["svr_ac_check_scripts"]), - gameScriptBlackListEnabled: intToBool(dbAssoc["svr_ac_script_bl"]), - gameScriptWhiteListEnabled: intToBool(dbAssoc["svr_ac_script_wl"]), + enabled: hasBitFlag(this.settings, getServerSettingsFlagValue("Anticheat")), + checkGameScripts: hasBitFlag(this.settings, getServerSettingsFlagValue("CheckGameScripts")), + gameScriptBlackListEnabled: hasBitFlag(this.settings, getServerSettingsFlagValue("GameScriptBlackList")), + gameScriptWhiteListEnabled: hasBitFlag(this.settings, getServerSettingsFlagValue("GameScriptWhiteList")), gameScriptWhiteList: [], gameScriptBlackList: [], }; this.discordBotToken = intToBool(dbAssoc["svr_discord_bot_token"]); - this.discordEnabled = intToBool(dbAssoc["svr_discord_bot_enabled"]); + this.discordEnabled = hasBitFlag(this.settings, getServerSettingsFlagValue("DiscordBot")); - this.createJobPickups = intToBool(dbAssoc["svr_job_pickups"]); - this.createBusinessPickups = intToBool(dbAssoc["svr_biz_pickups"]); - this.createHousePickups = intToBool(dbAssoc["svr_house_pickups"]); - this.createJobBlips = intToBool(dbAssoc["svr_job_blips"]); - this.createBusinessBlips = intToBool(dbAssoc["svr_biz_blips"]); - this.createHouseBlips = intToBool(dbAssoc["svr_house_blips"]); + this.createJobPickups = hasBitFlag(this.settings, getServerSettingsFlagValue("JobPickups")); + this.createBusinessPickups = hasBitFlag(this.settings, getServerSettingsFlagValue("BusinessPickups")); + this.createHousePickups = hasBitFlag(this.settings, getServerSettingsFlagValue("HousePickups")); + this.createJobBlips = hasBitFlag(this.settings, getServerSettingsFlagValue("JobBlips")); + this.createBusinessBlips = hasBitFlag(this.settings, getServerSettingsFlagValue("BusinessBlips")); + this.createHouseBlips = hasBitFlag(this.settings, getServerSettingsFlagValue("HouseBlips")); this.introMusicURL = dbAssoc["svr_intro_music"]; - this.useRealTime = intToBool(dbAssoc["svr_time_realtime_enabled"]); + this.useRealTime = hasBitFlag(this.settings, getServerSettingsFlagValue("RealTime")); this.realTimeZone = dbAssoc["svr_time_realtime_timezone"]; this.discordConfig = { diff --git a/scripts/server/config.js b/scripts/server/config.js index ff890b75..fb1bdf89 100644 --- a/scripts/server/config.js +++ b/scripts/server/config.js @@ -162,13 +162,13 @@ function saveServerConfigToDatabase() { let dbConnection = connectToDatabase(); if(dbConnection) { let data = [ - ["svr_logo", boolToInt(getServerConfig().showLogo)], - ["svr_gui", boolToInt(getServerConfig().useGUI)], + ["svr_logo", boolToInt(hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("ServerLogo")))], + ["svr_gui", boolToInt(hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("GUI")))], ["svr_start_time_hour", getServerConfig().hour], ["svr_start_time_min", getServerConfig().minute], ["svr_start_weather", getServerConfig().weather], - ["svr_start_snow_falling", boolToInt(getServerConfig().fallingSnow)], - ["svr_start_snow_ground", boolToInt(getServerConfig().groundSnow)], + ["svr_start_snow_falling", boolToInt(hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("FallingSnow")))], + ["svr_start_snow_ground", boolToInt(hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("GroundSnow")))], ["svr_newchar_pos_x", getServerConfig().newCharacter.spawnPosition.x], ["svr_newchar_pos_y", getServerConfig().newCharacter.spawnPosition.y], ["svr_newchar_pos_z", getServerConfig().newCharacter.spawnPosition.z], @@ -200,16 +200,16 @@ function saveServerConfigToDatabase() { ["svr_charselect_int", getServerConfig().characterSelectInterior], ["svr_charselect_vw", getServerConfig().characterSelectDimension], ["svr_inflation_multiplier", getServerConfig().inflationMultiplier], - ["svr_ac_enabled", boolToInt(getServerConfig().antiCheat.enabled)], - ["svr_ac_check_scripts", boolToInt(getServerConfig().antiCheat.checkGameScripts)], - ["svr_ac_script_wl", boolToInt(getServerConfig().antiCheat.gameScriptWhiteListEnabled)], - ["svr_ac_script_bl", boolToInt(getServerConfig().antiCheat.gameScriptBlackListEnabled)], - ["svr_job_pickups", boolToInt(getServerConfig().createJobPickups)], - ["svr_job_blips", boolToInt(getServerConfig().createJobBlips)], - ["svr_biz_pickups", boolToInt(getServerConfig().createBusinessPickups)], - ["svr_biz_blips", boolToInt(getServerConfig().createBusinessBlips)], - ["svr_house_pickups", boolToInt(getServerConfig().createHousePickups)], - ["svr_house_blips", boolToInt(getServerConfig().createHouseBlips)], + ["svr_ac_enabled", boolToInt(hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("Anticheat")))], + ["svr_ac_check_scripts", boolToInt(hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("CheckGameScripts")))], + ["svr_ac_script_wl", boolToInt(hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("GameScriptWhiteList")))], + ["svr_ac_script_bl", boolToInt(hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("GameScriptBlackList")))], + ["svr_job_pickups", boolToInt(hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("JobPickups")))], + ["svr_job_blips", boolToInt(hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("JobBlips")))], + ["svr_biz_pickups", boolToInt(hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("BusinessPickups")))], + ["svr_biz_blips", boolToInt(hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("BusinessBlips")))], + ["svr_house_pickups", boolToInt(hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("HousePickups")))], + ["svr_house_blips", boolToInt(hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("HouseBlips")))], ["svr_intro_music", getServerConfig().introMusicURL], ]; From c55dfd1a2c7ab4bf50f57450609f2f368cb6d727 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sat, 26 Feb 2022 21:32:00 -0600 Subject: [PATCH 08/44] Remove server colour script from meta.xml --- meta.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/meta.xml b/meta.xml index 33f8807f..a4c5301a 100644 --- a/meta.xml +++ b/meta.xml @@ -25,7 +25,6 @@