From d75dfe9e26da04b1f2b5c6b4ff8a81c7acec1dc6 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sat, 12 Mar 2022 09:40:59 -0600 Subject: [PATCH 001/177] Use new config cvars --- scripts/server/config.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/server/config.js b/scripts/server/config.js index 7e286638..caf569c8 100644 --- a/scripts/server/config.js +++ b/scripts/server/config.js @@ -84,20 +84,20 @@ function initConfigScript() { serverConfig = loadServerConfigFromGameAndPort(server.game, server.port, getMultiplayerMod()); logToConsole(LOG_INFO, "[VRR.Config]: Applying server config ..."); - getServerConfig().fallingSnow = intToBool(toInteger(server.getCVar("fallingsnow"))); - getServerConfig().groundSnow = intToBool(toInteger(server.getCVar("groundsnow"))); - getServerConfig().useGUI = intToBool(toInteger(server.getCVar("gui"))); + getServerConfig().fallingSnow = intToBool(toInteger(server.getCVar("vrr_fallingsnow"))); + getServerConfig().groundSnow = intToBool(toInteger(server.getCVar("vrr_groundsnow"))); + getServerConfig().useGUI = intToBool(toInteger(server.getCVar("vrr_gui"))); getServerConfig().showLogo = false; - getServerConfig().testerOnly = intToBool(toInteger(server.getCVar("testeronly"))); + getServerConfig().testerOnly = intToBool(toInteger(server.getCVar("vrr_testeronly"))); getServerConfig().discordEnabled = false; - getServerConfig().createJobPickups = intToBool(toInteger(server.getCVar("jobpickups"))); - getServerConfig().createBusinessPickups = intToBool(toInteger(server.getCVar("businesspickups"))); - getServerConfig().createHousePickups = intToBool(toInteger(server.getCVar("housepickups"))); - getServerConfig().createJobBlips = intToBool(toInteger(server.getCVar("jobblips"))); - getServerConfig().createBusinessBlips = intToBool(toInteger(server.getCVar("businessblips"))); - getServerConfig().createHouseBlips = intToBool(toInteger(server.getCVar("houseblips"))); - getServerConfig().useRealTime = intToBool(toInteger(server.getCVar("realtime"))); - getServerConfig().antiCheat.enabled = intToBool(toInteger(server.getCVar("anticheat"))); + getServerConfig().createJobPickups = intToBool(toInteger(server.getCVar("vrr_jobpickups"))); + getServerConfig().createBusinessPickups = intToBool(toInteger(server.getCVar("vrr_businesspickups"))); + getServerConfig().createHousePickups = intToBool(toInteger(server.getCVar("vrr_housepickups"))); + getServerConfig().createJobBlips = intToBool(toInteger(server.getCVar("vrr_jobblips"))); + getServerConfig().createBusinessBlips = intToBool(toInteger(server.getCVar("vrr_businessblips"))); + getServerConfig().createHouseBlips = intToBool(toInteger(server.getCVar("vrr_houseblips"))); + getServerConfig().useRealTime = intToBool(toInteger(server.getCVar("vrr_realtime"))); + getServerConfig().antiCheat.enabled = intToBool(toInteger(server.getCVar("vrr_anticheat"))); applyConfigToServer(serverConfig); logToConsole(LOG_DEBUG, "[VRR.Config]: Server config applied successfully!"); From 3c362e06a57b5345f23cd242a7bc093213bdecb3 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sun, 13 Mar 2022 05:28:53 -0500 Subject: [PATCH 002/177] Update locale strings --- locale/chinese.json | 3 ++- locale/english.json | 3 ++- locale/polish.json | 3 ++- locale/russian.json | 3 ++- locale/spanish.json | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/locale/chinese.json b/locale/chinese.json index 5286e7db..b3636ef5 100644 --- a/locale/chinese.json +++ b/locale/chinese.json @@ -393,5 +393,6 @@ "InvalidSkin": "That skin is invalid!", "HeaderInteriorTypes": "Interiors List", "ViewInventoryKeyPressTip": "Press {1} to see your items", - "ViewInventoryCommandTip": "Use {1} to see your items" + "ViewInventoryCommandTip": "Use {1} to see your items", + "GUIAccountSettingToggle": "You have turned {1} GUI" } diff --git a/locale/english.json b/locale/english.json index 5f68c88e..b7f6d5bd 100644 --- a/locale/english.json +++ b/locale/english.json @@ -393,5 +393,6 @@ "InvalidSkin": "That skin is invalid!", "HeaderInteriorTypes": "Interiors List", "ViewInventoryKeyPressTip": "Press {1} to see your items", - "ViewInventoryCommandTip": "Use {1} to see your items" + "ViewInventoryCommandTip": "Use {1} to see your items", + "GUIAccountSettingToggle": "You have turned {1} GUI" } diff --git a/locale/polish.json b/locale/polish.json index e38d5e1f..5057588a 100644 --- a/locale/polish.json +++ b/locale/polish.json @@ -393,5 +393,6 @@ "InvalidSkin": "That skin is invalid!", "HeaderInteriorTypes": "Interiors List", "ViewInventoryKeyPressTip": "Press {1} to see your items", - "ViewInventoryCommandTip": "Use {1} to see your items" + "ViewInventoryCommandTip": "Use {1} to see your items", + "GUIAccountSettingToggle": "You have turned {1} GUI" } diff --git a/locale/russian.json b/locale/russian.json index 82a535d2..c5e92804 100644 --- a/locale/russian.json +++ b/locale/russian.json @@ -392,5 +392,6 @@ "InvalidSkin": "That skin is invalid!", "HeaderInteriorTypes": "Interiors List", "ViewInventoryKeyPressTip": "Press {1} to see your items", - "ViewInventoryCommandTip": "Use {1} to see your items" + "ViewInventoryCommandTip": "Use {1} to see your items", + "GUIAccountSettingToggle": "You have turned {1} GUI" } diff --git a/locale/spanish.json b/locale/spanish.json index 7562b925..795432a1 100644 --- a/locale/spanish.json +++ b/locale/spanish.json @@ -397,5 +397,6 @@ "InvalidSkin": "That skin is invalid!", "HeaderInteriorTypes": "Interiors List", "ViewInventoryKeyPressTip": "Press {1} to see your items", - "ViewInventoryCommandTip": "Use {1} to see your items" + "ViewInventoryCommandTip": "Use {1} to see your items", + "GUIAccountSettingToggle": "You have turned {1} GUI" } From 7c466474f31db1faaf473fad17d4536bda06186b Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sun, 13 Mar 2022 05:29:11 -0500 Subject: [PATCH 003/177] IV stuff --- scripts/client/startup.js | 5 +++++ scripts/client/sync.js | 4 ++-- scripts/server/native/connected.js | 11 ++++++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/scripts/client/startup.js b/scripts/client/startup.js index bd38327f..76cd14a7 100644 --- a/scripts/client/startup.js +++ b/scripts/client/startup.js @@ -151,6 +151,11 @@ function setUpInitialGame() { natives.switchAmbientPlanes(true); natives.switchMadDrivers(false); + // Singleplayer Cellphone + natives.requestScript("spcellphone"); + natives.startNewScript("spcellphone", 0); + //natives.setMessagesWaiting(false); + natives.requestAnims("DANCING"); return true; } diff --git a/scripts/client/sync.js b/scripts/client/sync.js index 3a2a3704..34a5e7b3 100644 --- a/scripts/client/sync.js +++ b/scripts/client/sync.js @@ -10,8 +10,8 @@ function processSync(event, deltaTime) { if(localPlayer != null) { if(!areServerElementsSupported()) { - sendNetworkEventToServer("vrr.plr.pos", localPlayer.position); - sendNetworkEventToServer("vrr.plr.rot", localPlayer.heading); + sendNetworkEventToServer("vrr.plr.pos", (localPlayer.vehicle != null) ? localPlayer.vehicle.position : localPlayer.position); + sendNetworkEventToServer("vrr.plr.rot", (localPlayer.vehicle != null) ? localPlayer.vehicle.heading : localPlayer.heading); //if(localPlayer.vehicle != null) { // sendNetworkEventToServer("vrr.veh.pos", getVehicleForNetworkEvent(localPlayer.vehicle), localPlayer.vehicle.position); diff --git a/scripts/server/native/connected.js b/scripts/server/native/connected.js index 6c6a7393..2e5047bc 100644 --- a/scripts/server/native/connected.js +++ b/scripts/server/native/connected.js @@ -150,6 +150,9 @@ function getVehicleHeading(vehicle) { // =========================================================================== function setVehicleHeading(vehicle, heading) { + if(getGame() == VRR_GAME_GTA_IV) { + return sendNetworkEventToPlayer("vrr.vehPosition", null, getVehicleForNetworkEvent(vehicle), heading); + } return vehicle.heading = heading; } @@ -162,7 +165,13 @@ function getVehicleSyncer(vehicle) { // =========================================================================== function getVehicleForNetworkEvent(vehicle) { - return vehicle; + if(getGame() == VRR_GAME_GTA_IV) { + if(getVehicleData(vehicle).ivNetworkId != -1) { + return getVehicleData(vehicle).ivNetworkId; + } + return -1; + } + return vehicle.id; } // =========================================================================== From 94a8bf50ac374cf2e6b6c890461e4b291655b5ae Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sun, 13 Mar 2022 05:29:22 -0500 Subject: [PATCH 004/177] Fix locale string arg --- scripts/server/item.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/server/item.js b/scripts/server/item.js index 0b91ba6e..1ca6b59e 100644 --- a/scripts/server/item.js +++ b/scripts/server/item.js @@ -160,7 +160,7 @@ function createItemCommand(command, params, client) { let value = splitParams.slice(-1) || 1; if(!getItemTypeData(itemType)) { - messagePlayerError(client, getLocaleString("InvalidItemType")); + messagePlayerError(client, getLocaleString(client, "InvalidItemType")); return false; } From 352836d192c6130f2a15b5d392c882b0230e6000 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sun, 13 Mar 2022 05:33:30 -0500 Subject: [PATCH 005/177] Arabic locale file --- locale/arabic.json | 399 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 399 insertions(+) create mode 100644 locale/arabic.json diff --git a/locale/arabic.json b/locale/arabic.json new file mode 100644 index 00000000..461e9fcf --- /dev/null +++ b/locale/arabic.json @@ -0,0 +1,399 @@ +{ + "TranslationProvidedBy": "Name_Here", + "LocaleEnglishName": "Arabic", + + "LocaleNativeName": "Arabic (Translate this to Arabic)", + "LocaleOffer": "This server is available in English. Use {1} to use it.", + "LocaleChanged1": "Your language is now set to {1}", + "LocaleChanged2": "The server will now display messages in {1}", + "LocaleChangedNote": "This does not change messages from other players", + "AccentsListHeader": "Accents", + "HeaderHelpMainList": "Help Categories", + "AccentNotFound": "Accent not found", + "AccentSet": "You set your accent to {1}", + "AnimationNotFound": "That animation doesn't exist", + "AnimationCommandTip": "Use {1} to see a list of valid animations", + "AnimationInvalidDistance": "The distance must be between 0 and 3", + "AnimationStopCommandTip": "Use {1} to stop your animation", + "CantBanClient": "You cannot ban this person", + "PlayerAccountBanned": "{1} has been account banned", + "ClanNotFound": "Clan not found", + "ClanNameTaken": "A clan with that name already exists", + "PlayerNotFound": "Player not found", + "ClanCantRemoveRanks": "You can't remove clan ranks", + "ClanCantAddRanks": "You can't add clan ranks", + "ClanRankNotFound": "Clan rank not found", + "ClanCantChangeMemberTag": "You can not change clan member's tags", + "ClanPlayerNotInSameClan": "That player is not in your clan", + "ClanCantChangeRankLevel": "You can not change clan rank's level", + "ClanCantChangeRankTag": "You can not change clan rank's tags", + "NameNotRegistered": "Your name is not registered! Use {1} to make an account.", + "AutomaticLoginIPToggle": "Automatic login by IP is now {1}", + "CouldNotRegisterAccount": "There was a problem creating your account. Please contact an admin.", + "RandomTipsToggle": "Random tips are now {1}", + "ActionTipsToggle": "Action tips are now {1}", + "AutoSpawnLastCharToggle": "Automatic spawn as last used character is {1}", + "AccountGUISettingToggle": "GUI is now {1}", + "On": "On", + "Off": "Off", + "Yes": "Yes", + "No": "No", + "True": "True", + "False": "False", + "Locked": "Locked", + "Unlocked": "Unlocked", + "PasswordNotGoodEnough": "The new password must meet the requirements!", + "PasswordNeedsBase": "Passwords must have at least {1}", + "PasswordNeedsCapitals": "{1} capital letters", + "PasswordNeedsNumbers": "{1} numbers", + "PasswordNeedsSymbols": "{1} symbols", + "PasswordsDontMatch": "The new password and confirm new password aren't the same!", + "PasswordChanged": "Your password has been changed!", + "AutoLoggedInIP": "You have been automatically logged in by IP!", + "WelcomeBack": "Welcome back to {1}, {2}! Please {3} to continue.", + "WelcomeNewPlayer": "Welcome to {1}, {2}! Please {3} to play.", + "InvalidPlayer": "Player not found!", + "InvalidBusiness": "Business not found!", + "InvalidHouse": "House not found!", + "InvalidVehicle": "Vehicle not found!", + "InvalidClan": "Clan not found!", + "InvalidClanRank": "Clan rank not found!", + "InvalidJob": "Job not found!", + "InvalidItem": "Item not found!", + "InvalidItemType": "Item type not found!", + "InvalidRadioStation": "Radio station not found!", + "InvalidGate": "Gate not found!", + "EntersProperty": "opens the door and enters the {1}", + "ExitsProperty": "opens the door and exits the {1}", + "EnterExitPropertyDoorLocked": "tries to open the {1} door but fails because it's locked", + "PropertyNoInterior": "This {1} does not have an interior, but you can still use commands at the door icon.", + "NoBusinessWithItemType": "There is no business with that item available", + "HeaderKeyBinds": "Key Binds", + "HeaderAccountHelp": "Account Help", + "HeaderVehicleHelp": "Vehicle Help", + "HeaderVehicleDealershipHelp": "Vehicle Dealership Help", + "HeaderJobHelp": "Job Help", + "HeaderChatHelp": "Chat Help", + "HeaderServerRules": "Server Rules", + "HeaderWebsiteInfo": "Website", + "HeaderDiscordInfo": "Discord", + "HeaderAnimationsList": "Animation List", + "HeaderPayAndSprayHelp": "Pay and Spray Help", + "HeaderAmmunationHelp": "Ammunation Help", + "HeaderVehicleTuneupHelp": "Vehicle Tune Help", + "HeaderBindableKeysHelp": "Bindable Keys", + "HeaderSkinHelp": "Clothes/Skin Help", + "HeaderBusinessHelp": "Business Help", + "HeaderClanHelp": "Clan Help", + "HeaderPlayerVehiclesList": "Player Vehicles ({1})", + "HeaderPlayerBusinessesList": "Player Businesses ({1})", + "HeaderClansList": "Clan List", + "HeaderAdminsList": "Admin List", + "HeaderBadgeInfo": "Badge Information", + "HeaderAccentsList": "Accent List", + "HeaderPlayerInfo": "Player Information ({1})", + "HeaderWealthandTaxHelp": "Wealth and Tax Information", + "HeaderCommandInfo": "Command Information ({1})", + "HeaderRadioHelp": "Radio Help", + "HeaderRadioStationsList": "Radio Stations", + "HeaderKeyBindsList": "Key Binds List", + "RadioVolumeChanged": "{1} You changed your streaming radio volume to {2}%", + "VolumeLevelNotNumber": "The volume level must be a number", + "RadioStationLocationInvalid": "You must be in a vehicle, house, or business or have a personal device to change the station!", + "ActionBusinessRadioStationChange": "changes the business radio station to {1} ({2})", + "ActionHouseRadioStationChange": "changes the house radio station to {1} ({2})", + "ActionVehicleRadioStationChange": "changes the vehicle radio station to {1} ({2})", + "ActionItemRadioStationChange": "changes the {1}'s station to {2} ({3})", + "RandomVehicleCommandsDisabled": "This is a random traffic vehicle and commands can't be used for it.", + "HouseDoorLock": "House {1} {2}!", + "BusinessDoorLock": "Business {1} {2}!", + "ServerGameModeRestarting": "The server game mode is restarting!", + "HeaderSelfItemList": "Your Inventory", + "HeaderPlayerItemList": "Player Inventory ({1})", + "HeaderHouseItemList": "House Inventory", + "HeaderBusinessFloorItemList": "Business Inventory (For Sale)", + "HeaderBusinessStorageItemList": "Business Inventory (Storage)", + "HeaderItemItemList": "{1}'s Inventory", + "ItemSlotNotNumber": "The item slot must be a number", + "ItemSlotMustBeBetween": "The item slot must be between {1} and {2}!", + "UseItemBugged": "The item you're trying to use is bugged. A bug report has been sent to the server developers.", + "PickupItemBugged": "The item you're trying to pickup is bugged. A bug report has been sent to the server developers.", + "DropItemBugged": "The item you're trying to drop is bugged. A bug report has been sent to the server developers.", + "HandsBusy": "Your hands are busy", + "CantUseItemInSkinChange": "You can't use an item while customizing your appearance", + "CantDropItemInSkinChange": "You can't drop an item while customizing your appearance", + "CantPickupItemInSkinChange": "You can't pickup an item while customizing your appearance", + "CantSwitchItemInSkinChange": "You can't switch an item while customizing your appearance", + "CantGiveItemInSkinChange": "You can't give an item while customizing your appearance", + "CantTakeItemInSkinChange": "You can't take an item while customizing your appearance", + "ItemUnequippableNoAmmo": "The {1} in slot {2} has no ammo, and can't be equipped!", + "NoSpaceSelfInventory": "You don't have any more space in your inventory", + "Business": "business", + "House": "house", + "Clan": "clan", + "Vehicle": "vehicle", + "Item": "item", + "ItemType": "item type", + "Gate": "gate", + "Door": "door", + "ClanRank": "clan rank", + "JobRank": "job rank", + "RadioStation": "radio station", + "Months": [ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December" + ], + "WeekDays": [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday" + ], + "CardinalDirections": [ + "North", + "Northeast", + "East", + "Southeast", + "South", + "Southwest", + "West", + "Northwest" + ], + "NewPlayerReadyToPlay": [ + "You have been given some cash. Use {1} to find places to buy items.", + "If you need money, jobs are the yellow dots on the radar.", + "For a car, visit the car dealership. You can also use a rental vehicle near spawn or take the train", + "Be sure to read the {1} and use {2} for info." + ], + "YourCurrentVehicleDeleted": "The vehicle you were in was deleted.", + "Distance": "Distance", + "Meters": "Meters", + "Feet": "Feet", + "Kilometers": "Kilometers", + "Miles": "Miles", + "MustBeVehicleDriver": "You must be the driver of the vehicle!", + "PlayerJoinedServer": "{1} has joined the game from {1}!", + "PlayerLeftServer": "{1} has left the game! ({1})", + "DisconnectReasons": [ + "Lost Connection", + "Disconnected", + "Unsupported Client", + "Wrong Game", + "Incorrect Password", + "Unsupported Executable", + "Disconnected", + "Banned", + "Failed", + "Invalid Name", + "Crashed" + ], + "TakeItemFromHouse": "takes a {1} from the house", + "TakeItemFromBusinessStorage": "takes a {1} from the business storage", + "TakeItemFromBusiness": "takes a {1} from the business", + "TakeItemFromItem": "takes a {1} from the {2}", + "TakeItemFromVehicleTrunk": "takes a {1} from the trunk", + "TakeItemFromVehicleDash": "takes a {1} from the glove compartment", + "JobEquipmentInventoryKeyBindTip": "The job equipment is in your inventory. Press {1} to see them.", + "JobEquipmentInventoryCommandTip": "The job equipment is in your inventory. Use {1} to see them.", + "AccountHelp": [ + "Do NOT share your password with anybody else. {1} staff will never ask you for your password", + "Use {1} to change your password, and {2} if you forgot it", + "Some settings you can use: {1}" + ], + "VehicleHelp": [ + "Your personal vehicles will save wherever you or somebody else leaves them!", + "Visit dealerships to buy new vehicles (Use {1} for more information)", + "Some commands: {1}", + "Visit a mechanic garage to repair, colour, and tune up your car! {1} for info" + ], + "VehicleDealershipHelp": [ + "Visit a vehicle dealer to buy new vehicles. Use {1} to find one.", + "At the dealer, enter a car you want to buy, and the price will be shown to you", + "If you want to buy the vehicle, use {1} and you will be given keys to test drive it around the parking lot.", + "Drive away from the dealership with the new vehicle to confirm the purchase." + ], + "JobHelp": [ + "Visit job locations to get a job and earn money. Look for yellow spots on the map", + "At a job location, use {1} to get the job. Use {2} to quit your job", + "Use {1} to begin working. You can also get a job {2} and {3}", + "Most job vehicles are locked. Use {1} near one to enter it.", + "When entering a job vehicle, information on how to do the job will be shown to you." + ], + "ChatHelp": [ + "There are two main types of chat: out-of-character (OOC) and in-character (IC)", + "Mixing these two types is not proper roleplay. See {1} for info.", + "Some chat commands: {1}", + "Some have shorter names available ({1} to talk, {2} to shout, etc)" + ], + "ServerRulesHelp": [ + "Unrealistic actions (powergaming) are not allowed. You aren't superman.", + "No terrorist or terrorism roleplay is allowed.", + "Always follow instructions given by moderators and admins.", + "Do not mix the chats (metagaming). You can't use info in IC that was received OOC", + "Keep English in main chats. If you aren't good at English, use {1}" + ], + "AnimationHelp": [ + "Animations allow you to enhance roleplay with visual actions", + "Use {1} or {2} with a name to use an animation.", + "To see a list of animations, use {1}" + ], + "WeaponHelp": [ + "Visit an gun store to buy weapons. Use {1} to find one.", + "Buying a weapon requires a weapon license.", + "Weapon licenses are managed by the police department. Apply there to get one.", + "Weapons can also be purchased illegally from some businesses, weapon dealers, and clans." + ], + "SkinHelp": [ + "At a clothing store, use {1} to purchase clothes", + "When you have a clothing item, equip and use it like any other item to show the skin selection (check {1} to learn how to use items)", + "Some skins are restricted to jobs, clans, or for other reasons." + ], + "KeyBindHelp": [ + "You can set your own key binds. Use {1} to see your binded keys.", + "Use {1} to add a new keybind and {2} to remove one.", + "Default keys are: {1} for vehicle engine, {1} for lights, and {3} for lock/unlock", + "Press {1} to see your items and {2} to equip an item or {3} to unequip all.", + "Press {1} to use the item you're holding, press {2} to drop it, or press {3} to pickup an item from the ground." + ], + "BusinessHelp": [ + "Use {1} to purchase items or {2} to see a list of what's for sale at any business", + "Businesses are shown with blue names above the icon at their entrance.", + "Business owner commands: {1}", + "A new car for sale will appear when you drive away from the dealer." + ], + "ClanHelp": [ + "Ask an administrator to create a clan (Similar to factions/groups/families)", + "Clan owners have full control over their clan once it's created", + "Clan commands: {1}", + "More clan commands: {1}" + ], + "RadioStationHelp": [ + "Use {1} to set the station for your vehicle, house, or business", + "Use {2} to see a list of stations", + "You can change your radio streaming volume using {1} with 0-100 as the percent" + ], + "WealthAndTaxHelp": [ + "Your taxes on payday are {1} percent of your calculated wealth.", + "Your calculated wealth is a total sum based on how many vehicles, houses, and businesses you have.", + "Each vehicle is {1}, each house is {2}, and each business is {3}", + "Use {1} to see your current wealth, and {2} to see how much you'll pay in tax each payday" + ], + "MustBeInAVehicle": "You need to be in a vehicle!", + "MustBeInOrNearVehicle": "You need to be in or near a vehicle!", + "MustBeInVehicleFrontSeat": "You need to be in the vehicle front seats!", + "MustBeInVehicleDriverSeat": "You need to be the driver!", + "DontHaveVehicleKey": "You don't have a key for this vehicle!", + "NoGateAccess": "You don't have access to this gate!", + "GateBroken": "This gate is broken!", + "GateHacked": "The gate does not respond!", + "RadioJammed": "You hear only static from the radio.", + "VehicleNotForSale": "This vehicle is not for sale!", + "VehicleNotForRent": "This vehicle is not for rent!", + "BusinessNotForSale": "This business is not for sale!", + "BusinessNotForRent": "This business is not for rent!", + "HouseNotForSale": "This house is not for sale!", + "HouseNotForRent": "This house is not for rent!", + "DealershipPurchaseTestDrive": "Drive the vehicle away from the dealership to buy it, or get out to cancel.", + "DealershipPurchaseExitedVehicle": "You canceled the vehicle purchase by exiting the vehicle!", + "VehiclePurchaseComplete": "This vehicle is now yours! It will save wherever you leave it.", + "VehiclePurchaseNotEnoughMoney": "You don't have enough money to buy this vehicle!", + "HousePurchaseNotEnoughMoney": "You don't have enough money to buy this house!", + "BusinessPurchaseNotEnoughMoney": "You don't have enough money to buy this business!", + "Locales": { + "English": "English", + "Russian": "Russian", + "Spanish": "Spanish", + "German": "German", + "Dutch": "Dutch", + "Polish": "Polish" + }, + + "ADDED-21JAN2022": "DO NOT TRANSLATE. This string is just a comment to separate newly added translations.", + "HeaderPlayerHousesList": "Player Houses ({1})", + "HeaderPlayerStaffFlagsList": "Player Staff Flags ({1})", + "HeaderStaffFlagsList": "Staff Flags", + "NonRPName": "Non-RP name! Choose a new one:", + "InvalidStaffFlag": "Staff flag not found!", + "InvalidClanFlag": "Clan flag not found!", + "InvalidLocale": "Language not found!", + "HeaderJobUniformList": "Job Uniforms ({1})", + "HeaderJobEquipmentList": "Job Equipment ({1})", + "InvalidJobUniform": "Job uniform not found!", + "InvalidJobEquipment": "Job equipment not found!", + "HeaderVehiclesInRangeList": "Vehicles within {1}", + "NoVehiclesWithInRange": "There are no vehicles within {1}", + "AmountNotNumber": "The amount must be a number!", + "NeedToBeWorking": "You need to be working! Use {1} at a job location or near a job vehicle.", + "NeedToBeOnJobRoute": "You need to be doing a job route! Use {1} in a job vehicle", + "CurrentJobRouteDeleted": "The job route you were on has been deleted by an admin", + "CurrentJobRouteVehicleColoursChanged": "Your job route's vehicle colours were changed by an admin", + "NotYourJob": "This is not your job!", + "JobPoints": "You can get a job by going the yellow points on the map.", + "QuitJobToTakeAnother": "If you want this job, use {1} to quit your current job.", + "NotAJobVehicle": "This is not a job vehicle!", + "NotYourJobVehicle": "This is not your job's vehicle!", + "JobRouteDisabled": "The job route you were on has been disabled by an admin", + "HeaderPickupTypes": "Pickup Types", + "HeaderBlipTypes": "Map Icon Types", + "InvalidGPSLocation": "There are no locations with that name or type", + "HeaderBusinessList": "Businesses", + "VehicleForSale": "This {1} is buyable for {2}! Use {3} if you want to buy it", + "VehicleForRent": "This {1} is rentable for {2}! Use {3} if you want to rent it", + + "ADDED-31JAN2022": "DO NOT TRANSLATE. This string is just a comment to separate newly added translations.", + "LoginFailedInvalidPassword": "Invalid password! {1} attempts remaining", + "LoginFailedNoPassword": "You must enter a password! ! {1} attempts remaining", + "RegistrationFailedNoPassword": "You must enter a password!", + "RegistrationFailedNoPasswordConfirm": "You must confirm the password!", + "RegistrationFailedNoEmail": "You must enter an email!", + "AccountNameAlreadyRegistered": "Your name is already registered!", + "AlreadyLoggedIn": "You are already logged in!", + "RegistrationFailedInvalidEmail": "That email is invalid!", + "RegistrationFailedPasswordMismatch": "The passwords don't match!", + "RegistrationFailedCreateError": "Your account couldn't be created!", + "RegistrationSuccess": "Your account has been created!", + "RegistrationEmailVerifyReminder": "Don't forget to verify your email! A verification code has been sent to you.", + "RegistrationCreateCharReminder": "To play on the server, you will need to make a character.", + "NoCharactersGUIMessage": "You have no characters. Would you like to make one?", + "NoCharactersGUIWindowTitle": "No characters", + "NoCharactersChatMessage": "You have no characters. Use {1} to make one.", + "NeedEmailFor2FA": "You need to add your email to your account to use two-factor authentication.", + "NeedEmailVerifiedFor2FA": "You need to verify your email to use two-factor authentication.", + "SetEmailHelpTip": "Use {1} to set your email.", + "VerifyEmailHelpTip": "Use {1} to verify your email.", + + "ADDED-13FEB2022": "DO NOT TRANSLATE. This string is just a comment to separate newly added translations.", + "NearbyRadio": "Nearby radio", + "FromRadio": "From radio", + "ToRadio": "To radio", + "NeedToEnterPropertyCommand": "You need to enter the {1} first! Use {2} to enter and exit", + "NeedToEnterPropertyKeyPress": "You need to enter the {1} first! Press {2} to enter and exit", + "InventoryFullCantCarry": "You don't have any space to carry this (full inventory)!", + "NotEnoughCashNeedAmountMore": "You don't have enough money! You need {1} more!", + "AmountMustBeMoreThan": "The amount must be more than {1}!", + "WeaponBanned": "You are not allowed to buy or use weapons!", + "TimeNotNumber": "The time must be a number", + "HeaderDefaultBusinessItemTypes": "Business Item Templates", + "FixingStuck": "Fixing your position and virtual world ...", + "CantUseCommandYet": "You must wait before you can use this command again!", + "NotATester": "You are not a tester!", + "AccessDenied": "AccessDenied", + "InvalidSkin": "That skin is invalid!", + "HeaderInteriorTypes": "Interiors List", + "ViewInventoryKeyPressTip": "Press {1} to see your items", + "ViewInventoryCommandTip": "Use {1} to see your items", + "GUIAccountSettingToggle": "You have turned {1} GUI" +} From 11e76becc6e9c4027a233769bebfad298a81bf94 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sun, 13 Mar 2022 05:33:57 -0500 Subject: [PATCH 006/177] Fix spanish locale native name --- locale/spanish.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/locale/spanish.json b/locale/spanish.json index 795432a1..d87a0eb5 100644 --- a/locale/spanish.json +++ b/locale/spanish.json @@ -1,7 +1,8 @@ { "TranslationProvidedBy": "PerikiyoXD", - "LocaleEnglishName": "Español", - "LocaleNativeName": "Inglés", + "LocaleEnglishName": "Spanish", + + "LocaleNativeName": "Español", "LocaleOffer": "Este servidor se encuentra disponible en Español. Utilice {1} para usarlo", "LocaleChanged1": "El idioma se ha configurado a {1}", "LocaleChanged2": "El servidor mostrará los mensajes en {1}", From 96b6d58708a38ec42c8eba06570e4d27f33b3fdf Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sun, 13 Mar 2022 05:34:24 -0500 Subject: [PATCH 007/177] Separate first two lines (they're for information) --- locale/chinese.json | 1 + locale/english.json | 1 + locale/polish.json | 1 + locale/russian.json | 1 + 4 files changed, 4 insertions(+) diff --git a/locale/chinese.json b/locale/chinese.json index b3636ef5..2f7d82c4 100644 --- a/locale/chinese.json +++ b/locale/chinese.json @@ -1,6 +1,7 @@ { "TranslationProvidedBy": "Renzuka Ctone", "LocaleEnglishName": "Chinese", + "LocaleNativeName": "Chinese", "LocaleOffer": "This server is available in English. Use {1} to use it.", "LocaleChanged1": "Your language is now set to {1}", diff --git a/locale/english.json b/locale/english.json index b7f6d5bd..7046953c 100644 --- a/locale/english.json +++ b/locale/english.json @@ -1,6 +1,7 @@ { "TranslationProvidedBy": "Vortrex", "LocaleEnglishName": "English", + "LocaleNativeName": "English", "LocaleOffer": "This server is available in English. Use {1} to use it.", "LocaleChanged1": "Your language is now set to {1}", diff --git a/locale/polish.json b/locale/polish.json index 5057588a..714cf328 100644 --- a/locale/polish.json +++ b/locale/polish.json @@ -1,6 +1,7 @@ { "TranslationProvidedBy": "Suprise444", "LocaleEnglishName": "Polish", + "LocaleNativeName": "Polski", "LocaleOffer": "Ten serwer jest dostępny w języku Polskim. Użyj {1} aby go użyć.", "LocaleChanged1": "Twój język jest ustawiony na {1}", diff --git a/locale/russian.json b/locale/russian.json index c5e92804..bb26e69e 100644 --- a/locale/russian.json +++ b/locale/russian.json @@ -1,6 +1,7 @@ { "TranslationProvidedBy": "VNDTTS", "LocaleEnglishName": "Russian", + "LocaleNativeName": "Русский", "LocaleOffer": "Этот сервер доступен на русском. Используйте {1} чтобы его использовать.", "LocaleChanged1": "Ваш язык был установлен на {1}", From 5ce0ec2a111ae73063c7a17e92530b02fcf277af Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Mon, 14 Mar 2022 05:15:21 -0500 Subject: [PATCH 008/177] Display nametags in IV --- scripts/client/startup.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/client/startup.js b/scripts/client/startup.js index 76cd14a7..c0e59f71 100644 --- a/scripts/client/startup.js +++ b/scripts/client/startup.js @@ -126,11 +126,11 @@ function setUpInitialGame() { //natives.displayHud(false); //natives.displayRadar(false); //natives.displayAreaName(false); - //natives.displayPlayerNames(false); + natives.displayPlayerNames(true); natives.setPoliceRadarBlips(false); natives.removeTemporaryRadarBlipsForPickups(); natives.displayNonMinigameHelpMessages(false); - natives.setDisplayPlayerNameAndIcon(natives.getPlayerId(), false); + natives.setDisplayPlayerNameAndIcon(natives.getPlayerId(), true); // Item/Money Dropping natives.setMoneyCarriedByAllNewPeds(0); @@ -156,6 +156,7 @@ function setUpInitialGame() { natives.startNewScript("spcellphone", 0); //natives.setMessagesWaiting(false); + // Animation libraries natives.requestAnims("DANCING"); return true; } From a9ff7bd4d4376d9ecc664add8658a12c48b4833c Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Mon, 14 Mar 2022 05:15:40 -0500 Subject: [PATCH 009/177] Only set interior if different than main world --- scripts/client/utilities.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/client/utilities.js b/scripts/client/utilities.js index 1a120772..6bcd7048 100644 --- a/scripts/client/utilities.js +++ b/scripts/client/utilities.js @@ -357,8 +357,10 @@ function setLocalPlayerInterior(interior) { localPlayer.interior = interior; game.cameraInterior = interior; } else { - let interiorId = natives.getInteriorAtCoords(localPlayer.position); - natives.activateInterior(interiorId, true); + if(getGameConfig().mainWorldInterior != interior) { + let interiorId = natives.getInteriorAtCoords(localPlayer.position); + natives.activateInterior(interiorId, true); + } } } From e912a97d83210dcecbc52ebdcee0b1ac4e91ff1e Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Mon, 14 Mar 2022 05:15:48 -0500 Subject: [PATCH 010/177] Some testing stuff --- scripts/server/subaccount.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/server/subaccount.js b/scripts/server/subaccount.js index af332474..6f6ebfba 100644 --- a/scripts/server/subaccount.js +++ b/scripts/server/subaccount.js @@ -375,11 +375,13 @@ function selectCharacter(client, characterId = -1) { spawnPlayer(client, spawnPosition, spawnHeading, getGameConfig().skins[getGame()][skin][0], spawnInterior, spawnDimension); } else if(getGame() == VRR_GAME_GTA_IV) { spawnPlayer(client, spawnPosition, spawnHeading, getGameConfig().skins[getGame()][skin][0], spawnInterior, spawnDimension); + //clearPlayerWeapons(client); //setPlayerSkin(client, skin); //setPlayerPosition(client, spawnPosition); //setPlayerHeading(client, spawnHeading); //setPlayerInterior(client, spawnInterior); //setPlayerDimension(client, spawnDimension); + //restorePlayerCamera(client); } else if(getGame() >= VRR_GAME_MAFIA_ONE) { spawnPlayer(client, getGameConfig().skins[getGame()][skin][0], spawnPosition, spawnHeading); } From 0afc5856cf3b174d7c497412709d87bef6c99b76 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Mon, 14 Mar 2022 05:16:03 -0500 Subject: [PATCH 011/177] Woops had GUI check backward --- scripts/server/account.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/server/account.js b/scripts/server/account.js index 549fcdff..01a57bf0 100644 --- a/scripts/server/account.js +++ b/scripts/server/account.js @@ -94,13 +94,13 @@ function toggleAutoSelectLastCharacterCommand(command, params, client) { function toggleAccountGUICommand(command, params, client) { let flagValue = getAccountSettingsFlagValue("NoGUI"); - if(!doesPlayerHaveGUIEnabled(client)) { + if(doesPlayerHaveGUIEnabled(client)) { getPlayerData(client).accountData.settings = removeBitFlag(getPlayerData(client).accountData.settings, flagValue); - messagePlayerNormal(client, getLocaleString(client, "GUIAccountSettingToggle", `{softRed}${toUpperCase(getLocaleString(client, "Off"))}`)); + messagePlayerNormal(client, getLocaleString(client, "GUIAccountSettingToggle", `{softRed}${toUpperCase(getLocaleString(client, "Off"))}{MAINCOLOUR}`)); logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} has toggled GUI for their account ON.`); } else { getPlayerData(client).accountData.settings = addBitFlag(getPlayerData(client).accountData.settings, flagValue); - messagePlayerNormal(client, getLocaleString(client, "GUIAccountSettingToggle", `{softGreen}${toUpperCase(getLocaleString(client, "On"))}`)); + messagePlayerNormal(client, getLocaleString(client, "GUIAccountSettingToggle", `{softGreen}${toUpperCase(getLocaleString(client, "On"))}{MAINCOLOUR}`)); logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} has toggled GUI for their account ON.`); } From 10b4251ca696d0c2c55b70df22d599c333d72824 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Mon, 14 Mar 2022 05:16:14 -0500 Subject: [PATCH 012/177] Test skin stuff for IV --- scripts/client/server.js | 13 ++++++++++++- scripts/client/skin-select.js | 22 ++++++++++++++++------ 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/scripts/client/server.js b/scripts/client/server.js index 5410a2fb..a56df057 100644 --- a/scripts/client/server.js +++ b/scripts/client/server.js @@ -292,8 +292,19 @@ function setLocalPlayerInfiniteRun(state) { // =========================================================================== function setLocalPlayerSkin(skinId) { + logToConsole(LOG_INFO, skinId); if(getGame() == VRR_GAME_GTA_IV) { - natives.changePlayerModel(natives.getPlayerId(), skinId); + if(natives.isModelInCdimage(skinId)) { + natives.requestModel(skinId); + natives.loadAllObjectsNow(); + if(natives.hasModelLoaded(skinId)) { + natives.changePlayerModel(natives.getPlayerId(), skinId); + } + } + + //natives.requestModel(skinId); + //natives.changePlayerModel(natives.getPlayerId(), skinId); + //localPlayer.skin = allowedSkins[skinSelectorIndex][0]; //localPlayer.modelIndex = allowedSkins[skinSelectorIndex][0]; } else { diff --git a/scripts/client/skin-select.js b/scripts/client/skin-select.js index 2b361383..13af8975 100644 --- a/scripts/client/skin-select.js +++ b/scripts/client/skin-select.js @@ -54,9 +54,14 @@ function processSkinSelectKeyPress(keyCode) { logToConsole(LOG_DEBUG, `Switching to skin ${allowedSkins[skinSelectorIndex][1]} (Index: ${skinSelectorIndex}, Skin: ${allowedSkins[skinSelectorIndex][0]})`); skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1]; if(getGame() == VRR_GAME_GTA_IV) { - //natives.changePlayerModel(natives.getPlayerId(), allowedSkins[skinSelectorIndex][0]); - //localPlayer.skin = allowedSkins[skinSelectorIndex][0]; - //localPlayer.modelIndex = allowedSkins[skinSelectorIndex][0]; + let skinId = allowedSkins[skinSelectorIndex][1]; + if(natives.isModelInCdimage(skinId)) { + natives.requestModel(skinId); + natives.loadAllObjectsNow(); + if(natives.hasModelLoaded(skinId)) { + natives.changePlayerModel(natives.getPlayerId(), skinId); + } + } } else { localPlayer.skin = allowedSkins[skinSelectorIndex][0]; } @@ -69,9 +74,14 @@ function processSkinSelectKeyPress(keyCode) { logToConsole(LOG_DEBUG, `Switching to skin ${allowedSkins[skinSelectorIndex][1]} (Index: ${skinSelectorIndex}, Skin: ${allowedSkins[skinSelectorIndex][0]})`); skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1]; if(getGame() == VRR_GAME_GTA_IV) { - //natives.changePlayerModel(natives.getPlayerId(), allowedSkins[skinSelectorIndex][0]); - //localPlayer.skin = allowedSkins[skinSelectorIndex][0]; - //localPlayer.modelIndex = allowedSkins[skinSelectorIndex][0]; + let skinId = allowedSkins[skinSelectorIndex][1]; + if(natives.isModelInCdimage(skinId)) { + natives.requestModel(skinId); + natives.loadAllObjectsNow(); + if(natives.hasModelLoaded(skinId)) { + natives.changePlayerModel(natives.getPlayerId(), skinId); + } + } } else { localPlayer.skin = allowedSkins[skinSelectorIndex][0]; } From 5ce26de7c3107891872bdf0101e9b67eabcd7c1a Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Mon, 14 Mar 2022 05:16:23 -0500 Subject: [PATCH 013/177] Format --- scripts/server/event.js | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/server/event.js b/scripts/server/event.js index b7dea80a..4f4e1ccc 100644 --- a/scripts/server/event.js +++ b/scripts/server/event.js @@ -410,6 +410,7 @@ function onPlayerDeath(client, position) { if(isFadeCameraSupported()) { fadeCamera(client, true, 1.0); } + updatePlayerSpawnedState(client, true); makePlayerStopAnimation(client); setPlayerControlState(client, true); From b74deeca509043b88ccd088a0c214cbae8b5c775 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Mon, 14 Mar 2022 05:45:48 -0500 Subject: [PATCH 014/177] Fix for IV skin change --- scripts/client/skin-select.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/client/skin-select.js b/scripts/client/skin-select.js index 13af8975..abd8cc52 100644 --- a/scripts/client/skin-select.js +++ b/scripts/client/skin-select.js @@ -54,7 +54,7 @@ function processSkinSelectKeyPress(keyCode) { logToConsole(LOG_DEBUG, `Switching to skin ${allowedSkins[skinSelectorIndex][1]} (Index: ${skinSelectorIndex}, Skin: ${allowedSkins[skinSelectorIndex][0]})`); skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1]; if(getGame() == VRR_GAME_GTA_IV) { - let skinId = allowedSkins[skinSelectorIndex][1]; + let skinId = allowedSkins[skinSelectorIndex][0]; if(natives.isModelInCdimage(skinId)) { natives.requestModel(skinId); natives.loadAllObjectsNow(); @@ -74,7 +74,7 @@ function processSkinSelectKeyPress(keyCode) { logToConsole(LOG_DEBUG, `Switching to skin ${allowedSkins[skinSelectorIndex][1]} (Index: ${skinSelectorIndex}, Skin: ${allowedSkins[skinSelectorIndex][0]})`); skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1]; if(getGame() == VRR_GAME_GTA_IV) { - let skinId = allowedSkins[skinSelectorIndex][1]; + let skinId = allowedSkins[skinSelectorIndex][0]; if(natives.isModelInCdimage(skinId)) { natives.requestModel(skinId); natives.loadAllObjectsNow(); @@ -132,8 +132,14 @@ function toggleSkinSelect(state) { } if(getGame() == VRR_GAME_GTA_IV) { - //natives.changePlayerModel(natives.getPlayerId(), allowedSkins[skinSelectorIndex][0]); - localPlayer.skin = allowedSkins[skinSelectorIndex][0]; + let skinId = allowedSkins[skinSelectorIndex][0]; + if(natives.isModelInCdimage(skinId)) { + natives.requestModel(skinId); + natives.loadAllObjectsNow(); + if(natives.hasModelLoaded(skinId)) { + natives.changePlayerModel(natives.getPlayerId(), skinId); + } + } } else { localPlayer.skin = allowedSkins[skinSelectorIndex][0]; } From 0bacc0964c7e2b975655e6853753a06bb54ba030 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Tue, 15 Mar 2022 04:14:57 -0500 Subject: [PATCH 015/177] Draw house/job checkpoints --- scripts/client/label.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/client/label.js b/scripts/client/label.js index 4f20d67a..973bf20f 100644 --- a/scripts/client/label.js +++ b/scripts/client/label.js @@ -255,6 +255,18 @@ function processLabelRendering() { natives.drawColouredCylinder(getPosBelowPos(businesses[i].entrancePosition, 1.0), 0.0, 0.0, 0, 153, 255, 255); } } + + for(let i in houses) { + if(getDistance(localPlayer.position, houses[i].entrancePosition) <= 75.0) { + natives.drawColouredCylinder(getPosBelowPos(houses[i].entrancePosition, 1.0), 0.0, 0.0, 0, 200, 0, 255); + } + } + + for(let i in jobs) { + if(getDistance(localPlayer.position, jobs[i].position) <= 75.0) { + natives.drawColouredCylinder(getPosBelowPos(jobs[i].position, 1.0), 0.0, 0.0, 255, 255, 0, 255); + } + } } } From d56422bac64cfe21ef478c4a7741a3ea5c7f226d Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Tue, 15 Mar 2022 04:15:17 -0500 Subject: [PATCH 016/177] Client job script --- scripts/client/job.js | 104 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 102 insertions(+), 2 deletions(-) diff --git a/scripts/client/job.js b/scripts/client/job.js index c993aa16..022e9862 100644 --- a/scripts/client/job.js +++ b/scripts/client/job.js @@ -14,6 +14,20 @@ let jobRouteLocationSphere = null; // =========================================================================== +class JobData { + constructor(jobId, name, position, blipModel, pickupModel) { + this.index = -1; + this.jobId = jobId; + this.name = name; + this.position = position; + this.blipModel = blipModel; + this.pickupModel = pickupModel; + this.blipId = -1; + } +} + +// =========================================================================== + function initJobScript() { logToConsole(LOG_DEBUG, "[VRR.Job]: Initializing job script ..."); logToConsole(LOG_DEBUG, "[VRR.Job]: Job script initialized!"); @@ -22,14 +36,14 @@ function initJobScript() { // =========================================================================== function setLocalPlayerJobType(tempJobType) { - logToConsole(LOG_DEBUG, `[VRR.Main] Set local player job type to ${tempJobType}`); + logToConsole(LOG_DEBUG, `[VRR.Job] Set local player job type to ${tempJobType}`); localPlayerJobType = tempJobType; } // =========================================================================== function setLocalPlayerWorkingState(tempWorking) { - logToConsole(LOG_DEBUG, `[VRR.Main] Setting working state to ${tempWorking}`); + logToConsole(LOG_DEBUG, `[VRR.Job] Setting working state to ${tempWorking}`); localPlayerWorking = tempWorking; } @@ -92,4 +106,90 @@ function hideJobRouteLocation() { jobRouteLocationBlip = null; } +// =========================================================================== + +function receiveJobFromServer(jobId, name, position, blipModel, pickupModel) { + logToConsole(LOG_DEBUG, `[VRR.Job] Received job ${jobId} (${name}) from server`); + + if(getGame() == VRR_GAME_GTA_IV) { + if(getJobData(jobId) != false) { + let jobData = getJobData(jobId); + jobData.name = name; + jobData.position = position; + jobData.blipModel = blipModel; + jobData.pickupModel = pickupModel; + + logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId} already exists. Checking blip ...`); + if(blipModel == -1) { + if(jobData.blipId != -1) { + logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId}'s blip has been removed by the server`); + if(getGame() == VRR_GAME_GTA_IV) { + natives.removeBlipAndClearIndex(getJobData(jobId).blipId); + } else { + destroyElement(getElementFromId(blipId)); + } + jobData.blipId = -1; + } else { + logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId}'s blip is unchanged`); + } + } else { + if(jobData.blipId != -1) { + logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId}'s blip has been changed by the server`); + if(getGame() == VRR_GAME_GTA_IV) { + natives.setBlipCoordinates(jobData.blipId, jobData.position); + natives.changeBlipSprite(jobData.blipId, jobData.blipModel); + natives.setBlipMarkerLongDistance(jobData.blipId, false); + natives.setBlipAsShortRange(jobData.blipId, true); + natives.changeBlipNameFromAscii(jobData.blipId, `${jobData.name.substr(0, 24)}${(jobData.name.length > 24) ? " ...": ""}`); + } + } else { + let blipId = createGameBlip(jobData.blipModel, jobData.position, jobData.name); + if(blipId != -1) { + jobData.blipId = blipId; + } + logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`); + } + } + } else { + logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId} doesn't exist. Adding ...`); + let tempJobData = new JobData(jobId, name, position, blipModel, pickupModel); + if(blipModel != -1) { + let blipId = createGameBlip(tempJobData.blipModel, tempJobData.position, tempJobData.name); + if(blipId != -1) { + tempJobData.blipId = blipId; + } + logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`); + } else { + logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId} has no blip.`); + } + jobs.push(tempJobData); + setAllJobDataIndexes(); + } + } +} + +// =========================================================================== + +/** + * @param {number} job - The ID of the job (initially provided by server) + * @return {JobData} The job's data (class instance) + */ + function getJobData(jobId) { + for(let i in jobs) { + if(jobs[i].jobId == jobId) { + return jobs[i]; + } + } + + return false; +} + +// =========================================================================== + +function setAllJobDataIndexes() { + for(let i in jobs) { + jobs[i].index = i; + } +} + // =========================================================================== \ No newline at end of file From 7ad41f939a20f311a11dbf34a2b4f6e12c89b578 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Tue, 15 Mar 2022 04:15:28 -0500 Subject: [PATCH 017/177] Update client house script --- scripts/client/house.js | 74 ++++++++++++++++++++++++++++------------- 1 file changed, 50 insertions(+), 24 deletions(-) diff --git a/scripts/client/house.js b/scripts/client/house.js index 19631aad..47d4157e 100644 --- a/scripts/client/house.js +++ b/scripts/client/house.js @@ -22,37 +22,58 @@ class HouseData { // =========================================================================== function receiveHouseFromServer(houseId, entrancePosition, blipModel, pickupModel, hasInterior) { + logToConsole(LOG_DEBUG, `[VRR.House] Received house ${houseId} (${name}) from server`); + if(getGame() == VRR_GAME_GTA_IV) { if(getHouseData(houseId) != false) { + let houseData = getHouseData(houseId); + houseData.entrancePosition = entrancePosition; + houseData.blipModel = blipModel; + houseData.pickupModel = pickupModel; + houseData.hasInterior = hasInterior; + + logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId} already exists. Checking blip ...`); if(blipModel == -1) { - natives.removeBlipAndClearIndex(getHouseData(houseId).blipId); - getHouseData(houseId).blipId = -1; - //houses.splice(getHouseData(houseId).index, 1); - //setAllHouseDataIndexes(); - } else { - if(getHouseData(houseId).blipId != -1) { - natives.setBlipCoordinates(getHouseData(houseId).blipId, getHouseData(houseId).entrancePosition); - natives.changeBlipSprite(getHouseData(houseId).blipId, getHouseData(houseId).blipModel); - //natives.changeBlipNameFromAscii(getHouseData(houseId).blipId, `${name.substr(0, 24)}${(name.length > 24) ? " ...": ""}`); + if(houseData.blipId != -1) { + logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip has been removed by the server`); + if(getGame() == VRR_GAME_GTA_IV) { + natives.removeBlipAndClearIndex(getHouseData(houseId).blipId); + } else { + destroyElement(getElementFromId(blipId)); + } + houseData.blipId = -1; } else { - let blipId = natives.addBlipForCoord(entrancePosition); - if(blipId) { - getHouseData(houseId).blipId = blipId; - natives.changeBlipSprite(blipId, blipModel); - natives.setBlipMarkerLongDistance(blipId, false); - } + logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip is unchanged`); + } + } else { + if(houseData.blipId != -1) { + logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip has been changed by the server`); + if(getGame() == VRR_GAME_GTA_IV) { + natives.setBlipCoordinates(houseData.blipId, houseData.entrancePosition); + natives.changeBlipSprite(houseData.blipId, houseData.blipModel); + natives.setBlipMarkerLongDistance(houseData.blipId, false); + natives.setBlipAsShortRange(houseData.blipId, true); + natives.changeBlipNameFromAscii(houseData.blipId, `${houseData.name.substr(0, 24)}${(houseData.name.length > 24) ? " ...": ""}`); + } + } else { + let blipId = createGameBlip(houseData.blipModel, houseData.entrancePosition, houseData.name); + if(blipId != -1) { + houseData.blipId = blipId; + } + logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`); } } } else { - let tempHouseData = new HouseData(houseId, entrancePosition, blipModel, pickupModel, hasInterior, hasItems); + logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId} doesn't exist. Adding ...`); + let tempHouseData = new HouseData(houseId, entrancePosition, blipModel, pickupModel, hasInterior); if(blipModel != -1) { - let blipId = natives.addBlipForCoord(entrancePosition); - if(blipId) { + let blipId = createGameBlip(tempHouseData.blipModel, tempHouseData.entrancePosition, "House"); + if(blipId != -1) { tempHouseData.blipId = blipId; - natives.changeBlipSprite(blipId, blipModel); - natives.setBlipMarkerLongDistance(blipId, false); - //natives.changeBlipNameFromAscii(blipId, `${name.substr(0, 24)}${(name.length > 24) ? " ...": ""}`); } + logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`); + } else { + logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId} has no blip.`); } houses.push(tempHouseData); setAllHouseDataIndexes(); @@ -66,9 +87,14 @@ function receiveHouseFromServer(houseId, entrancePosition, blipModel, pickupMode * @param {number} houseId - The ID of the house (initially provided by server) * @return {HouseData} The house's data (class instance) */ -function getHouseData(houseId) { - let tempHouseData = houses.find((h) => h.houseId == houseId); - return (typeof tempHouseData != "undefined") ? tempHouseData : false; + function getHouseData(houseId) { + for(let i in houses) { + if(houses[i].houseId == houseId) { + return houses[i]; + } + } + + return false; } // =========================================================================== From eba1487ac4de131de54298dc9c2d2f540011be1a Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Tue, 15 Mar 2022 04:15:47 -0500 Subject: [PATCH 018/177] Fix some client business stuff --- scripts/client/business.js | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/scripts/client/business.js b/scripts/client/business.js index 69a73600..a2d15e04 100644 --- a/scripts/client/business.js +++ b/scripts/client/business.js @@ -40,7 +40,11 @@ function receiveBusinessFromServer(businessId, name, entrancePosition, blipModel if(blipModel == -1) { if(businessData.blipId != -1) { logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been removed by the server`); - natives.removeBlipAndClearIndex(getBusinessData(businessId).blipId); + if(getGame() == VRR_GAME_GTA_IV) { + natives.removeBlipAndClearIndex(getBusinessData(businessId).blipId); + } else { + destroyElement(getElementFromId(blipId)); + } businessData.blipId = -1; //businesses.splice(businessData.index, 1); //setAllBusinessDataIndexes(); @@ -50,20 +54,18 @@ function receiveBusinessFromServer(businessId, name, entrancePosition, blipModel } else { if(businessData.blipId != -1) { logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been changed by the server`); - natives.setBlipCoordinates(businessData.blipId, businessData.entrancePosition); - natives.changeBlipSprite(businessData.blipId, businessData.blipModel); - natives.setBlipMarkerLongDistance(businessData.blipId, false); - natives.setBlipAsShortRange(tempBusinessData.blipId, true); - natives.changeBlipNameFromAscii(businessData.blipId, `${businessData.name.substr(0, 24)}${(businessData.name.length > 24) ? " ...": ""}`); - } else { - let blipId = natives.addBlipForCoord(entrancePosition); - if(blipId) { - businessData.blipId = blipId; + if(getGame() == VRR_GAME_GTA_IV) { + natives.setBlipCoordinates(businessData.blipId, businessData.entrancePosition); natives.changeBlipSprite(businessData.blipId, businessData.blipModel); - natives.setBlipMarkerLongDistance(businessData.blipId, false); + natives.setBlipMarkerLongDistance(businessData.blipId, false); natives.setBlipAsShortRange(tempBusinessData.blipId, true); natives.changeBlipNameFromAscii(businessData.blipId, `${businessData.name.substr(0, 24)}${(businessData.name.length > 24) ? " ...": ""}`); } + } else { + let blipId = createGameBlip(tempBusinessData.blipModel, tempBusinessData.entrancePosition, tempBusinessData.name); + if(blipId != -1) { + tempBusinessData.blipId = blipId; + } logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`); } } @@ -71,13 +73,9 @@ function receiveBusinessFromServer(businessId, name, entrancePosition, blipModel logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId} doesn't exist. Adding ...`); let tempBusinessData = new BusinessData(businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems); if(blipModel != -1) { - let blipId = natives.addBlipForCoord(entrancePosition); - if(blipId) { + let blipId = createGameBlip(tempBusinessData.blipModel, tempBusinessData.entrancePosition, tempBusinessData.name); + if(blipId != -1) { tempBusinessData.blipId = blipId; - natives.changeBlipSprite(tempBusinessData.blipId, blipModel); - natives.setBlipMarkerLongDistance(tempBusinessData.blipId, false); - natives.setBlipAsShortRange(tempBusinessData.blipId, true); - natives.changeBlipNameFromAscii(tempBusinessData.blipId, `${name.substr(0, 24)}${(name.length > 24) ? " ...": ""}`); } logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`); } else { From 8e2c69c1b1b5a739713fdbbf920bab39cfd66b4a Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Tue, 15 Mar 2022 04:16:13 -0500 Subject: [PATCH 019/177] Wrap some native stuff --- scripts/client/native/connected.js | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/scripts/client/native/connected.js b/scripts/client/native/connected.js index f62b24bc..72054b5f 100644 --- a/scripts/client/native/connected.js +++ b/scripts/client/native/connected.js @@ -20,7 +20,11 @@ function getPlayerPosition() { // =========================================================================== function setPlayerPosition(position) { - localPlayer.position = position; + if(getGame() == VRR_GAME_GTA_IV) { + natives.setCharCoordinates(localPlayer, position); + } else { + localPlayer.position = position; + } } // =========================================================================== @@ -141,4 +145,21 @@ function getVehiclesInRange(position, range) { return inRangeVehicles; } +// =========================================================================== + +function createGameBlip(blipModel, position, name = "") { + if(getGame() == VRR_GAME_GTA_IV) { + let blipId = natives.addBlipForCoord(position); + if(blipId) { + natives.changeBlipSprite(blipId, blipModel); + natives.setBlipMarkerLongDistance(blipId, false); + natives.setBlipAsShortRange(blipId, true); + natives.changeBlipNameFromAscii(blipId, `${name.substr(0, 24)}${(name.length > 24) ? " ...": ""}`); + return blipId; + } + } + + return -1; +} + // =========================================================================== \ No newline at end of file From 50616b7c8aee65b25b11e47be32e7faf22007702 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Tue, 15 Mar 2022 04:16:28 -0500 Subject: [PATCH 020/177] Cutscene interior net events --- scripts/client/server.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/client/server.js b/scripts/client/server.js index a56df057..8ca4741d 100644 --- a/scripts/client/server.js +++ b/scripts/client/server.js @@ -87,6 +87,7 @@ function addAllNetworkHandlers() { addNetworkEventHandler("vrr.hideAllGUI", hideAllGUI); addNetworkEventHandler("vrr.clientInfo", serverRequestedClientInfo); addNetworkEventHandler("vrr.interiorLights", updateInteriorLightsState); + addNetworkEventHandler("vrr.cutsceneInterior", setCutsceneInterior); addNetworkEventHandler("vrr.syncElement", forceSyncElementProperties); addNetworkEventHandler("vrr.elementPosition", setElementPosition); @@ -326,4 +327,19 @@ function sendLocalPlayerNetworkIdToServer() { sendNetworkEventToServer("vrr.playerPedId", natives.getNetworkIdFromPed(localPlayer)); } +// =========================================================================== + +function setCutsceneInterior(cutsceneName) { + if(getGame() == VRR_GAME_GTA_IV) { + if(cutsceneName == "") { + natives.clearCutscene(); + } else { + if(natives.isInteriorScene()) { + natives.clearCutscene(); + } + natives.initCutscene(cutsceneName); + } + } +} + // =========================================================================== \ No newline at end of file From ef1ba1dd9985d3144cfd43800e746771ee9f3ffe Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Tue, 15 Mar 2022 04:16:51 -0500 Subject: [PATCH 021/177] Cutscene interior stuff --- scripts/server/business.js | 15 +++++++++++---- scripts/server/class.js | 13 +++++++++++++ scripts/server/client.js | 18 ++++++++++++++++++ scripts/server/house.js | 5 +++++ 4 files changed, 47 insertions(+), 4 deletions(-) diff --git a/scripts/server/business.js b/scripts/server/business.js index 3e9faaa2..cfaccd8e 100644 --- a/scripts/server/business.js +++ b/scripts/server/business.js @@ -11,8 +11,6 @@ function initBusinessScript() { logToConsole(LOG_INFO, "[VRR.Business]: Initializing business script ..."); getServerData().businesses = loadBusinessesFromDatabase(); - - createAllBusinessPickups(); createAllBusinessBlips(); @@ -139,7 +137,7 @@ function loadBusinessGameScriptsFromDatabase(businessId) { // =========================================================================== function createBusinessCommand(command, params, client) { - let tempBusinessData = createBusiness(params, getPlayerPosition(client), toVector3(0.0, 0.0, 0.0), getGameConfig().pickupModels[getServerGame()].Business, getGameConfig().blipSprites[getServerGame()].Business, getPlayerInterior(client), getPlayerDimension(client)); + let tempBusinessData = createBusiness(params, getPlayerPosition(client), toVector3(0.0, 0.0, 0.0), getGameConfig().pickupModels[getServerGame()].Business, getGameConfig().blipSprites[getServerGame()].Business, getPlayerInterior(client), getPlayerDimension(client), getPlayerData(client).interiorCutscene); tempBusinessData.needsSaved = true; let businessId = getServerData().businesses.push(tempBusinessData); setAllBusinessIndexes(); @@ -182,7 +180,7 @@ function createBusinessLocationCommand(command, params, client) { // =========================================================================== -function createBusiness(name, entrancePosition, exitPosition, entrancePickupModel = -1, entranceBlipModel = -1, entranceInteriorId = 0, entranceVirtualWorld = 0, exitInteriorId = -1, exitVirtualWorld = -1, exitPickupModel = -1, exitBlipModel = -1) { +function createBusiness(name, entrancePosition, exitPosition, entrancePickupModel = -1, entranceBlipModel = -1, entranceInteriorId = 0, entranceVirtualWorld = 0, exitInteriorId = -1, exitVirtualWorld = -1, exitPickupModel = -1, exitBlipModel = -1, entranceCutscene = "") { let tempBusinessData = new BusinessData(false); tempBusinessData.name = name; @@ -192,6 +190,7 @@ function createBusiness(name, entrancePosition, exitPosition, entrancePickupMode tempBusinessData.entranceBlipModel = entranceBlipModel; tempBusinessData.entranceInterior = entranceInteriorId; tempBusinessData.entranceDimension = entranceVirtualWorld; + tempBusinessData.entranceCutscene = entranceCutscene; tempBusinessData.exitPosition = exitPosition; tempBusinessData.exitRotation = 0.0; @@ -717,6 +716,7 @@ function setBusinessInteriorTypeCommand(command, params, client) { getBusinessData(businessId).exitDimension = 0; getBusinessData(businessId).exitInterior = -1; getBusinessData(businessId).hasInterior = false; + getBusinessData(businessId).interiorCutscene = ""; getBusinessData(businessId).exitPickupModel = -1; messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} {MAINCOLOUR}removed business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} interior`); return false; @@ -738,6 +738,9 @@ function setBusinessInteriorTypeCommand(command, params, client) { getBusinessData(businessId).exitInterior = getGameConfig().interiors[getServerGame()][typeParam][1]; getBusinessData(businessId).exitDimension = getBusinessData(businessId).databaseId+getGlobalConfig().businessDimensionStart; getBusinessData(businessId).exitPickupModel = getGameConfig().pickupModels[getServerGame()].Exit; + if(getGameConfig().interiors[getServerGame()][typeParam].length == 3) { + getBusinessData(businessId).interiorCutscene = getGameConfig().interiors[getServerGame()][typeParam][2]; + } getBusinessData(businessId).hasInterior = true; } @@ -1256,6 +1259,8 @@ function saveBusinessToDatabase(businessId) { let dbConnection = connectToDatabase(); if(dbConnection) { let safeBusinessName = escapeDatabaseString(dbConnection, tempBusinessData.name); + let safeExitCutscene = escapeDatabaseString(dbConnection, tempBusinessData.exitCustscene); + let safeEntranceCutscene = escapeDatabaseString(dbConnection, tempBusinessData.entranceCutscene); let data = [ ["biz_server", getServerId()], @@ -1273,6 +1278,7 @@ function saveBusinessToDatabase(businessId) { ["biz_entrance_vw", tempBusinessData.entranceDimension], ["biz_entrance_pickup", tempBusinessData.entrancePickupModel], ["biz_entrance_blip", tempBusinessData.entranceBlipModel], + ["biz_entrance_cutscene", safeEntranceCutscene], ["biz_exit_pos_x", tempBusinessData.exitPosition.x], ["biz_exit_pos_y", tempBusinessData.exitPosition.y], ["biz_exit_pos_z", tempBusinessData.exitPosition.z], @@ -1281,6 +1287,7 @@ function saveBusinessToDatabase(businessId) { ["biz_exit_vw", tempBusinessData.exitDimension], ["biz_exit_pickup", tempBusinessData.exitPickupModel], ["biz_exit_blip", tempBusinessData.exitBlipModel], + ["biz_exit_cutscene", safeExitCutscene], ["biz_has_interior", boolToInt(tempBusinessData.hasInterior)], ["biz_interior_lights", boolToInt(tempBusinessData.interiorLights)], ["biz_label_help_type", tempBusinessData.labelHelpType], diff --git a/scripts/server/class.js b/scripts/server/class.js index 5ece105d..011ceef4 100644 --- a/scripts/server/class.js +++ b/scripts/server/class.js @@ -239,6 +239,10 @@ class ClientData { this.locale = 0; this.enteringVehicle = null; + + this.customDisconnectReason = ""; + + this.interiorCutscene = ""; } }; @@ -524,6 +528,7 @@ class BusinessData { this.entranceBlipModel = -1; this.entrancePickup = null; this.entranceBlip = null; + this.entranceCutscene = ""; this.exitPosition = false; this.exitRotation = 0.0; @@ -533,6 +538,7 @@ class BusinessData { this.exitBlipModel = -1; this.exitPickup = null; this.exitBlip = null; + this.exitCutscene = ""; this.entranceFee = 0; this.till = 0; @@ -557,6 +563,7 @@ class BusinessData { this.entranceDimension = toInteger(dbAssoc["biz_entrance_vw"]); this.entrancePickupModel = toInteger(dbAssoc["biz_entrance_pickup"]); this.entranceBlipModel = toInteger(dbAssoc["biz_entrance_blip"]); + this.entranceCutscene = toString(dbAssoc["biz_entrance_cutscene"]); this.exitPosition = toVector3(dbAssoc["biz_exit_pos_x"], dbAssoc["biz_exit_pos_y"], dbAssoc["biz_exit_pos_z"]); this.exitRotation = toInteger(dbAssoc["biz_exit_rot_z"]); @@ -564,12 +571,14 @@ class BusinessData { this.exitDimension = toInteger(dbAssoc["biz_exit_vw"]); this.exitPickupModel = toInteger(dbAssoc["biz_exit_pickup"]); this.exitBlipModel = toInteger(dbAssoc["biz_exit_blip"]); + this.exitCutscene = toString(dbAssoc["biz_exit_cutscene"]); this.entranceFee = toInteger(dbAssoc["biz_entrance_fee"]); this.till = toInteger(dbAssoc["biz_till"]); this.labelHelpType = toInteger(dbAssoc["biz_label_help_type"]); this.streamingRadioStation = toInteger(dbAssoc["biz_radiostation"]); + } }; }; @@ -658,6 +667,7 @@ class HouseData { this.entranceBlipModel = -1; this.entrancePickup = null; this.entranceBlip = null; + this.entranceCutscene = ""; this.exitPosition = false; this.exitRotation = 0.0; @@ -667,6 +677,7 @@ class HouseData { this.exitBlipModel = -1; this.exitPickup = null; this.exitBlip = null; + this.exitCutscene = ""; this.streamingRadioStation = -1; @@ -688,6 +699,7 @@ class HouseData { this.entranceDimension = toInteger(dbAssoc["house_entrance_vw"]); this.entrancePickupModel = toInteger(dbAssoc["house_entrance_pickup"]); this.entranceBlipModel = toInteger(dbAssoc["house_entrance_blip"]); + this.entranceCutscene = toString(dbAssoc["house_entrance_cutscene"]); this.exitPosition = toVector3(toFloat(dbAssoc["house_exit_pos_x"]), toFloat(dbAssoc["house_exit_pos_y"]), toFloat(dbAssoc["house_exit_pos_z"])); this.exitRotation = toFloat(dbAssoc["house_exit_rot_z"]); @@ -695,6 +707,7 @@ class HouseData { this.exitDimension = toInteger(dbAssoc["house_exit_vw"]); this.exitPickupModel = toInteger(dbAssoc["house_exit_pickup"]); this.exitBlipModel = toInteger(dbAssoc["house_exit_blip"]); + this.exitCutscene = toString(dbAssoc["house_exit_cutscene"]); } } }; diff --git a/scripts/server/client.js b/scripts/server/client.js index 5bd79c7c..3ec3f077 100644 --- a/scripts/server/client.js +++ b/scripts/server/client.js @@ -1143,6 +1143,17 @@ function sendAllHousesToPlayer(client) { // ========================================================================== +function sendAllJobsToPlayer(client) { + //let jobs = getServerData().jobs; + //for(let i in jobs) { + // for(let j in jobs[i].locations) { + // sendJobToPlayer(client, jobs[i].index, jobs[i].name, jobs[i].locations[j].position, jobs[i].blipModel); + // } + //} +} + +// ========================================================================== + function makePlayerHoldObjectModel(client, modelIndex) { sendNetworkEventToPlayer("vrr.holdObject", client, getPlayerData(client).ped, modelIndex); } @@ -1159,4 +1170,11 @@ function requestPlayerPedNetworkId(client) { sendNetworkEventToPlayer("vrr.playerPedId", client); } +// ========================================================================== + +function setPlayerInCutsceneInterior(client, cutsceneName) { + getPlayerData(client).interiorCutscene = cutsceneName; + sendNetworkEventToPlayer("vrr.cutsceneInterior", client, cutsceneName); +} + // ========================================================================== \ No newline at end of file diff --git a/scripts/server/house.js b/scripts/server/house.js index b9dee72c..6fb30280 100644 --- a/scripts/server/house.js +++ b/scripts/server/house.js @@ -737,6 +737,8 @@ function saveHouseToDatabase(houseId) { let dbConnection = connectToDatabase(); if(dbConnection) { let safeHouseDescription = escapeDatabaseString(dbConnection, tempHouseData.description); + let safeExitCutscene = escapeDatabaseString(dbConnection, tempHouseData.exitCutscene); + let safeEntranceCutscene = escapeDatabaseString(dbConnection, tempHouseData.entranceCutscene); let data = [ ["house_server", getServerId()], @@ -753,6 +755,7 @@ function saveHouseToDatabase(houseId) { ["house_entrance_vw", tempHouseData.entranceDimension], ["house_entrance_pickup", tempHouseData.entrancePickupModel], ["house_entrance_blip", tempHouseData.entranceBlipModel], + ["house_entrance_cutscene", safeEntranceCutscene], ["house_exit_pos_x", tempHouseData.exitPosition.x], ["house_exit_pos_y", tempHouseData.exitPosition.y], ["house_exit_pos_z", tempHouseData.exitPosition.z], @@ -761,10 +764,12 @@ function saveHouseToDatabase(houseId) { ["house_exit_vw", tempHouseData.exitDimension], ["house_exit_pickup", tempHouseData.exitPickupModel], ["house_exit_blip", tempHouseData.exitBlipModel], + ["house_exit_cutscene", safeExitCutscene], ["house_buy_price", tempHouseData.buyPrice], ["house_rent_price", tempHouseData.rentPrice], ["house_has_interior", boolToInt(tempHouseData.hasInterior)], ["house_interior_lights", boolToInt(tempHouseData.interiorLights)], + ]; let dbQuery = null; From f12051bfb67ed253453593db613906cce082a2ae Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Tue, 15 Mar 2022 04:17:00 -0500 Subject: [PATCH 022/177] Fix for job blips --- scripts/server/job.js | 54 ++++++++++++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 19 deletions(-) diff --git a/scripts/server/job.js b/scripts/server/job.js index 3f6ee78e..748ef560 100644 --- a/scripts/server/job.js +++ b/scripts/server/job.js @@ -2291,24 +2291,33 @@ function createJobLocationPickup(jobId, locationId) { return false; } - if(getJobData(jobId).pickupModel != -1) { + let tempJobData = getJobData(jobId); + + if(tempJobData.pickupModel != -1) { let pickupModelId = getGameConfig().pickupModels[getServerGame()].Job; - if(getJobData(jobId).pickupModel != 0) { - pickupModelId = getJobData(jobId).pickupModel; + if(tempJobData.pickupModel != 0) { + pickupModelId = tempJobData.pickupModel; } - logToConsole(LOG_VERBOSE, `[VRR.Job]: Creating pickup for location ${locationId} of the ${getServerData().jobs[jobId].name} job`); + logToConsole(LOG_VERBOSE, `[VRR.Job]: Creating pickup for location ${locationId} of the ${tempJobData.name} job`); - getJobData(jobId).locations[locationId].pickup = createGamePickup(pickupModelId, getJobData(jobId).locations[locationId].position, getGameConfig().pickupTypes[getServerGame()].job); - setElementDimension(getJobData(jobId).locations[locationId].pickup, getJobData(jobId).locations[locationId].dimension); - setElementOnAllDimensions(getJobData(jobId).locations[locationId].pickup, false); - setEntityData(getServerData().jobs[jobId].locations[locationId].pickup, "vrr.owner.type", VRR_PICKUP_JOB, false); - setEntityData(getServerData().jobs[jobId].locations[locationId].pickup, "vrr.owner.id", locationId, false); - setEntityData(getServerData().jobs[jobId].locations[locationId].pickup, "vrr.label.type", VRR_LABEL_JOB, true); - setEntityData(getServerData().jobs[jobId].locations[locationId].pickup, "vrr.label.name", getJobData(jobId).name, true); - setEntityData(getServerData().jobs[jobId].locations[locationId].pickup, "vrr.label.jobType", getJobData(jobId).databaseId, true); - addToWorld(getJobData(jobId).locations[locationId].pickup); + if(areServerElementsSupported()) { + let pickup = createGamePickup(pickupModelId, tempJobData.locations[locationId].position, getGameConfig().pickupTypes[getServerGame()].job); + if(pickup != false) { + tempJobData.locations[locationId].pickup = pickup; + setElementDimension(pickup, tempJobData.locations[locationId].dimension); + setElementOnAllDimensions(pickup, false); + setEntityData(pickup, "vrr.owner.type", VRR_PICKUP_JOB, false); + setEntityData(pickup, "vrr.owner.id", locationId, false); + setEntityData(pickup, "vrr.label.type", VRR_LABEL_JOB, true); + setEntityData(pickup, "vrr.label.name", tempJobData.name, true); + setEntityData(pickup, "vrr.label.jobType", tempJobData.databaseId, true); + addToWorld(pickup); + } + } else { + // sendJobToPlayer(null, jobId, tempJobData.name, tempJobData.locations[locationId].position, pickupModel); + } } } @@ -2319,6 +2328,8 @@ function createJobLocationBlip(jobId, locationId) { return false; } + let tempJobData = getJobData(jobId); + if(getJobData(jobId).blipModel != -1) { let blipModelId = getGameConfig().blipSprites[getServerGame()].Job; @@ -2326,12 +2337,17 @@ function createJobLocationBlip(jobId, locationId) { blipModelId = getJobData(jobId).blipModel; } - getJobData(jobId).locations[locationId].blip = createGameBlip(getJobData(jobId).locations[locationId].position, blipModelId, getColourByType("job")); - //setElementStreamInDistance(getServerData().jobs[i].locations[j].blip, 30); - //setElementStreamOutDistance(getServerData().jobs[i].locations[j].blip, 40); - setElementOnAllDimensions(getJobData(jobId).locations[locationId].blip, false); - setElementDimension(getJobData(jobId).locations[locationId].blip, getJobData(jobId).locations[locationId].dimension); - addToWorld(getJobData(jobId).locations[locationId].blip); + if(areServerElementsSupported()) { + let blip = createGameBlip(tempJobData.locations[locationId].position, blipModelId, getColourByType("job")); + if(blip != false) { + tempJobData.locations[locationId].blip = blip; + } + setElementOnAllDimensions(blip, false); + setElementDimension(blip, tempJobData.locations[locationId].dimension); + addToWorld(blip); + } else { + sendJobToPlayer(null, jobId, tempJobData.name, tempJobData.locations[locationId].position, blipModelId); + } } } From c89cc5cd3e7b49d3f77cde6fbc7c9b4ab289a8c9 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Tue, 15 Mar 2022 04:17:19 -0500 Subject: [PATCH 023/177] Load objects when setting cutscene interior --- scripts/client/utilities.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/client/utilities.js b/scripts/client/utilities.js index 6bcd7048..82a1276c 100644 --- a/scripts/client/utilities.js +++ b/scripts/client/utilities.js @@ -282,7 +282,7 @@ function enterVehicleAsPassenger() { } else { for(let i = 0 ; i <= natives.getMaximumNumberOfPassengers(tempVehicle); i++) { if(natives.isCarPassengerSeatFree(tempVehicle, i)) { - natives.taskEnterCarAsPassenger(localPlayer, tempVehicle, i, 1); + natives.taskEnterCarAsPassenger(localPlayer, tempVehicle, i, 10000); } } } @@ -360,6 +360,7 @@ function setLocalPlayerInterior(interior) { if(getGameConfig().mainWorldInterior != interior) { let interiorId = natives.getInteriorAtCoords(localPlayer.position); natives.activateInterior(interiorId, true); + natives.loadAllObjectsNow(); } } } From e8fa5089bc68b59f4a13f589e50140eac609ccdc Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Tue, 15 Mar 2022 04:17:34 -0500 Subject: [PATCH 024/177] Change some IV gamedata interiors and skins --- scripts/shared/gamedata.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/shared/gamedata.js b/scripts/shared/gamedata.js index eb6c8d05..a39525ec 100644 --- a/scripts/shared/gamedata.js +++ b/scripts/shared/gamedata.js @@ -1338,7 +1338,7 @@ let gameData = { [-1902758612,"Male Gym Worker" , true], [-356904519 ,"Mechanic 2," , true], [-1056268969,"Male Modo Worker" , true], - [ 1201610759,"Helicopter Pilot" , false], + [ 1201610759,"Helicopter Pilot 2" , false], [-151000142 ,"Perseus" , true], [ 501136335 ,"Generic Male 1," , true], [ 186619473 ,"Generic Male 2," , true], @@ -4436,15 +4436,15 @@ let gameData = { { // GTA IV Office2: [toVector3(-1153.30, 417.37, 5.578), 0], - House1: [toVector3(-426.16, 1466.52, 38.971), 0], - House2: [toVector3(-969.77, 883.27, 18.817), 0], - House3: [toVector3(95.75, 851.68, 45.051), 0], - House4: [toVector3(603.04, 1404.06, 17.479), 0], - House5: [toVector3(892.56, -502.13, 19.407), 0], - House6: [toVector3(-524.09, 830.54, 23.627), 0], - House7: [toVector3(806.36, 146.68, 29.243), 0], - House8: [toVector3(356.91, 1511.28, 21.432), 0], - House9: [toVector3(1319.40, -847.02, 8.872), 0], + PlayBoyXHouse: [toVector3(-426.16, 1466.52, 38.971), 0, "playboyx"], + RaySafeHouse: [toVector3(-969.77, 883.27, 18.817), 0], + RomanHouse2: [toVector3(95.75, 851.68, 45.051), 0], + SouthBohanHouse: [toVector3(603.04, 1404.06, 17.479), 0], + HoveBeachHouse: [toVector3(892.56, -502.13, 19.407), 0, "bronxsave"], + House6: [toVector3(-524.09, 830.54, 23.627), 0, "shootapt"], + BrucieHouse: [toVector3(806.36, 146.68, 29.243), 0, "brucieloft"], + ElizabetaHouse: [toVector3(356.91, 1511.28, 21.432), 0, "shootapt"], + House9DontUse: [toVector3(1319.40, -847.02, 8.872), 0], House10: [toVector3(1331.40, 126.60, 36.558), 0], House11: [toVector3(1387.81, 622.66, 35.857), 0], House12: [toVector3(932.74, -189.29, 35.143), 0], @@ -4452,7 +4452,7 @@ let gameData = { House14: [toVector3(806.36, 146.68, 29.243), 0], House15: [toVector3(-526.49, 829.41, 23.627), 0], Gym: [toVector3(403.31, 1480.32, 11.834), 0], - PoliceStation: [toVector3(-406.52, 286.57, 13.682), 0], + PoliceStation: [toVector3(-406.52, 286.57, 13.682), 0, "copshop"], FancyRestaurant: [toVector3(-118.24, -259.06, 12.654), 0], Basement: [toVector3(1304.38, -856.66, 5.490), 0], Office1: [toVector3(-409.31, 285.49, 18.592), 0], From 47764b0a767bf2664f487013fc336efd3305ed2b Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Tue, 15 Mar 2022 04:17:46 -0500 Subject: [PATCH 025/177] Cutscene interior stuff --- scripts/server/misc.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/server/misc.js b/scripts/server/misc.js index 2b0b84ee..1f342c26 100644 --- a/scripts/server/misc.js +++ b/scripts/server/misc.js @@ -221,8 +221,10 @@ function enterExitPropertyCommand(command, params, client) { if(isFadeCameraSupported()) { fadeCamera(client, true, 1.0); } + setPlayerInCutsceneInterior(client, closestProperty.exitCutscene); updateInteriorLightsForPlayer(client, closestProperty.interiorLights); }, 1000); + //setPlayerInCutsceneInterior(client, closestProperty.exitCutscene); //updateAllInteriorVehiclesForPlayer(client, closestProperty.exitInterior, closestProperty.exitDimension); }, 1100); if(closestProperty.streamingRadioStation != -1) { @@ -257,11 +259,14 @@ function enterExitPropertyCommand(command, params, client) { if(isFadeCameraSupported()) { fadeCamera(client, true, 1.0); } + setPlayerInCutsceneInterior(client, closestProperty.entranceCutscene); updateInteriorLightsForPlayer(client, true); }, 1000); }, 1100); + //setPlayerInCutsceneInterior(client, closestProperty.entranceCutscene); stopRadioStreamForPlayer(client); getPlayerData(client).streamingRadioStation = -1; + //logToConsole(LOG_DEBUG, `[VRR.Misc] ${getPlayerDisplayForConsole(client)} exited business ${inBusiness.name}[${inBusiness.index}/${inBusiness.databaseId}]`); return true; } From 297ab6f8f807716a70153105a7c18668213b0dd2 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Tue, 15 Mar 2022 04:17:58 -0500 Subject: [PATCH 026/177] Custom disconnect reason --- scripts/server/account.js | 1 + scripts/server/event.js | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/server/account.js b/scripts/server/account.js index 01a57bf0..ebead70e 100644 --- a/scripts/server/account.js +++ b/scripts/server/account.js @@ -569,6 +569,7 @@ function loginSuccess(client) { if(doesServerHaveTesterOnlyEnabled()) { if(!hasBitFlag(getPlayerData(client).accountData.flags.moderation, getModerationFlagValue("IsTester"))) { setTimeout(function() { + getPlayerData(client).customDisconnectReason = "Kicked - Not a tester"; client.disconnect(); }, 3500); diff --git a/scripts/server/event.js b/scripts/server/event.js index 4f4e1ccc..b10b1780 100644 --- a/scripts/server/event.js +++ b/scripts/server/event.js @@ -60,7 +60,8 @@ function onPlayerJoin(event, client) { fadeCamera(client, true, 1.0); } - messageDiscordEventChannel(`👋 ${getPlayerDisplayForConsole(client)} has joined the server.`); + messageAdmins(`${client.name} is joining the server ...`); + //messageDiscordEventChannel(`👋 ${getPlayerDisplayForConsole(client)} has joined the server.`); } // =========================================================================== @@ -97,7 +98,11 @@ function onPlayerQuit(event, client, quitReasonId) { updateConnectionLogOnQuit(client, quitReasonId); if(isPlayerLoggedIn(client)) { - messagePlayerNormal(null, `👋 ${getPlayerName(client)} has left the server (${disconnectReasons[quitReasonId]})`, getColourByName("softYellow")); + let reasonText = disconnectReasons[quitReasonId]; + if(getPlayerData(client).customDisconnectReason != "") { + reasonText = getPlayerData(client).customDisconnectReason; + } + messagePlayerNormal(null, `👋 ${getPlayerName(client)} has left the server (${reasonText})`, getColourByName("softYellow")); savePlayerToDatabase(client); resetClientStuff(client); getServerData().clients[client.index] = null; @@ -587,8 +592,8 @@ function onPlayerSpawn(client) { if(!areServerElementsSupported()) { sendAllBusinessesToPlayer(client); - //sendAllHousesToPlayer(client); - //sendAllJobLocationsToPlayer(client); + sendAllHousesToPlayer(client); + sendAllJobsToPlayer(client); //sendAllVehiclesToPlayer(client); requestPlayerPedNetworkId(client); From efc72dffe19275d6db21d34171c1c36f96e09427 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Wed, 16 Mar 2022 17:02:33 -0500 Subject: [PATCH 027/177] Mass convert indentation + add ped speech cmd --- scripts/client/afk.js | 2 +- scripts/client/animation.js | 96 +- scripts/client/business.js | 164 +- scripts/client/chatbox.js | 74 +- scripts/client/content.js | 74 +- scripts/client/event.js | 214 +- scripts/client/gui.js | 6 +- scripts/client/house.js | 148 +- scripts/client/item.js | 46 +- scripts/client/job.js | 228 +- scripts/client/jsconfig.json | 16 +- scripts/client/keybind.js | 80 +- scripts/client/label.js | 380 +- scripts/client/logo.js | 30 +- scripts/client/messaging.js | 66 +- scripts/client/mousecam.js | 8 +- scripts/client/nametag.js | 50 +- scripts/client/native/connected.js | 28 +- scripts/client/radio.js | 32 +- scripts/client/scoreboard.js | 2 +- scripts/client/server.js | 385 +- scripts/client/skin-select.js | 182 +- scripts/client/startup.js | 283 +- scripts/client/sync.js | 634 +-- scripts/client/utilities.js | 994 ++--- scripts/server/accent.js | 16 +- scripts/server/account.js | 6 +- scripts/server/animation.js | 18 +- scripts/server/anticheat.js | 4 +- scripts/server/ban.js | 291 +- scripts/server/bitflag.js | 48 +- scripts/server/business.js | 26 +- scripts/server/business/casino.js | 106 +- scripts/server/chat.js | 12 +- scripts/server/clan.js | 64 +- scripts/server/class.js | 8 +- scripts/server/client.js | 878 ++-- scripts/server/command.js | 1182 +++--- scripts/server/config.js | 72 +- scripts/server/database.js | 1 - scripts/server/developer.js | 6 +- scripts/server/discord.js | 118 +- scripts/server/economy.js | 14 +- scripts/server/email.js | 42 +- scripts/server/event.js | 780 ++-- scripts/server/gate.js | 12 +- scripts/server/gui.js | 138 +- scripts/server/help.js | 414 +- scripts/server/house.js | 44 +- scripts/server/item.js | 46 +- scripts/server/job.js | 286 +- scripts/server/jsconfig.json | 20 +- scripts/server/keybind.js | 226 +- scripts/server/locale.js | 116 +- scripts/server/messaging.js | 198 +- scripts/server/misc.js | 187 +- scripts/server/npc.js | 4 +- scripts/server/npc/taxi.js | 24 +- scripts/server/radio.js | 2 +- scripts/server/staff.js | 258 +- scripts/server/subaccount.js | 2 +- scripts/server/timers.js | 24 +- scripts/server/trigger.js | 76 +- scripts/server/tutorial.js | 4 +- scripts/server/utilities.js | 10 +- scripts/server/vehicle.js | 160 +- scripts/shared/gamedata.js | 6138 ++++++++++++++-------------- scripts/shared/utilities.js | 410 +- 68 files changed, 8401 insertions(+), 8312 deletions(-) diff --git a/scripts/client/afk.js b/scripts/client/afk.js index 95cbd995..973b9cef 100644 --- a/scripts/client/afk.js +++ b/scripts/client/afk.js @@ -21,7 +21,7 @@ function processLostFocusAFK(event) { // =========================================================================== function processFocusAFK(event) { - sendServerNewAFKStatus(false); + sendServerNewAFKStatus(false); } // =========================================================================== \ No newline at end of file diff --git a/scripts/client/animation.js b/scripts/client/animation.js index 2d5760e5..1c9a2d2c 100644 --- a/scripts/client/animation.js +++ b/scripts/client/animation.js @@ -8,68 +8,68 @@ // =========================================================================== function makePedPlayAnimation(pedId, animGroup, animId, animType, animSpeed, loop, loopNoControl, freezeLastFrame, returnToOriginalPosition, freezePlayer) { - logToConsole(LOG_DEBUG, `[VRR.Animation] Playing animation ${animGroup}/${animId} for ped ${pedId}`); - if(getGame() < VRR_GAME_GTA_IV) { - if(animType == VRR_ANIMTYPE_NORMAL || animType == VRR_ANIMTYPE_SURRENDER) { - if(getGame() == VRR_GAME_GTA_VC || getGame() == VRR_GAME_GTA_SA) { - getElementFromId(pedId).clearAnimations(); - } else { - getElementFromId(pedId).clearObjective(); - } - getElementFromId(pedId).addAnimation(animGroup, animId); + logToConsole(LOG_DEBUG, `[VRR.Animation] Playing animation ${animGroup}/${animId} for ped ${pedId}`); + if(getGame() < VRR_GAME_GTA_IV) { + if(animType == VRR_ANIMTYPE_NORMAL || animType == VRR_ANIMTYPE_SURRENDER) { + if(getGame() == VRR_GAME_GTA_VC || getGame() == VRR_GAME_GTA_SA) { + getElementFromId(pedId).clearAnimations(); + } else { + getElementFromId(pedId).clearObjective(); + } + getElementFromId(pedId).addAnimation(animGroup, animId); - if(getElementFromId(pedId) == localPlayer && freezePlayer == true) { - inAnimation = true; - setLocalPlayerControlState(false, false); - localPlayer.collisionsEnabled = false; - } - } else if(animType == VRR_ANIMTYPE_BLEND) { - getElementFromId(pedId).position = getElementFromId(pedId).position; - getElementFromId(pedId).blendAnimation(animGroup, animId, animSpeed); - } - } else { - natives.requestAnims(animGroup); - natives.taskPlayAnimNonInterruptable(getElementFromId(pedId), animId, animGroup, animSpeed, loop, loopNoControl, freezeLastFrame, returnToOriginalPosition, -1); - } + if(getElementFromId(pedId) == localPlayer && freezePlayer == true) { + inAnimation = true; + setLocalPlayerControlState(false, false); + localPlayer.collisionsEnabled = false; + } + } else if(animType == VRR_ANIMTYPE_BLEND) { + getElementFromId(pedId).position = getElementFromId(pedId).position; + getElementFromId(pedId).blendAnimation(animGroup, animId, animSpeed); + } + } else { + natives.requestAnims(animGroup); + natives.taskPlayAnimNonInterruptable(getElementFromId(pedId), animId, animGroup, animSpeed, loop, loopNoControl, freezeLastFrame, returnToOriginalPosition, -1); + } } // =========================================================================== function forcePedAnimation(pedId, animGroup, animId, animType, animSpeed, loop, loopNoControl, freezeLastFrame, returnToOriginalPosition) { - if(getGame() < VRR_GAME_GTA_IV) { - forcedAnimation = [animGroup, animId]; - getElementFromId(pedId).position = getElementFromId(pedId).position; - getElementFromId(pedId).addAnimation(animGroup, animId); + if(getGame() < VRR_GAME_GTA_IV) { + forcedAnimation = [animGroup, animId]; + getElementFromId(pedId).position = getElementFromId(pedId).position; + getElementFromId(pedId).addAnimation(animGroup, animId); - if(getElementFromId(pedId) == localPlayer) { - inAnimation = true; - setLocalPlayerControlState(false, false); - localPlayer.collisionsEnabled = false; - } - } + if(getElementFromId(pedId) == localPlayer) { + inAnimation = true; + setLocalPlayerControlState(false, false); + localPlayer.collisionsEnabled = false; + } + } } // =========================================================================== function makePedStopAnimation(pedId) { - if(getElementFromId(pedId) == null) { - return false; - } + if(getElementFromId(pedId) == null) { + return false; + } - if(getGame() != VRR_GAME_GTA_IV) { - if(getGame() == VRR_GAME_GTA_VC || getGame() == VRR_GAME_GTA_SA) { - getElementFromId(pedId).clearAnimations(); - } else { - getElementFromId(pedId).clearObjective(); - } - } + if(getGame() != VRR_GAME_GTA_IV) { + if(getGame() == VRR_GAME_GTA_VC || getGame() == VRR_GAME_GTA_SA) { + getElementFromId(pedId).clearAnimations(); + } else { + getElementFromId(pedId).clearObjective(); + } + } - if(getElementFromId(pedId) == localPlayer) { - if(getGame() != VRR_GAME_GTA_IV) { - localPlayer.collisionsEnabled = true; - } - setLocalPlayerControlState(true, false); - } + if(getElementFromId(pedId) == localPlayer) { + if(getGame() != VRR_GAME_GTA_IV) { + localPlayer.collisionsEnabled = true; + } + setLocalPlayerControlState(true, false); + } } // =========================================================================== \ No newline at end of file diff --git a/scripts/client/business.js b/scripts/client/business.js index a2d15e04..29f712f7 100644 --- a/scripts/client/business.js +++ b/scripts/client/business.js @@ -8,83 +8,83 @@ // =========================================================================== class BusinessData { - constructor(businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems) { - this.index = -1; - this.businessId = businessId; - this.name = name; - this.entrancePosition = entrancePosition; - this.blipModel = blipModel; - this.pickupModel = pickupModel; - this.hasInterior = hasInterior; - this.hasItems = hasItems; - this.blipId = -1; - } + constructor(businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems) { + this.index = -1; + this.businessId = businessId; + this.name = name; + this.entrancePosition = entrancePosition; + this.blipModel = blipModel; + this.pickupModel = pickupModel; + this.hasInterior = hasInterior; + this.hasItems = hasItems; + this.blipId = -1; + } } // =========================================================================== function receiveBusinessFromServer(businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems) { - logToConsole(LOG_DEBUG, `[VRR.Business] Received business ${businessId} (${name}) from server`); - - if(getGame() == VRR_GAME_GTA_IV) { - if(getBusinessData(businessId) != false) { - let businessData = getBusinessData(businessId); - businessData.name = name; - businessData.entrancePosition = entrancePosition; - businessData.blipModel = blipModel; - businessData.pickupModel = pickupModel; - businessData.hasInterior = hasInterior; - businessData.hasItems = hasItems; + logToConsole(LOG_DEBUG, `[VRR.Business] Received business ${businessId} (${name}) from server`); - logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId} already exists. Checking blip ...`); - if(blipModel == -1) { - if(businessData.blipId != -1) { - logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been removed by the server`); - if(getGame() == VRR_GAME_GTA_IV) { - natives.removeBlipAndClearIndex(getBusinessData(businessId).blipId); - } else { - destroyElement(getElementFromId(blipId)); - } - businessData.blipId = -1; - //businesses.splice(businessData.index, 1); - //setAllBusinessDataIndexes(); - } else { - logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip is unchanged`); - } - } else { - if(businessData.blipId != -1) { - logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been changed by the server`); - if(getGame() == VRR_GAME_GTA_IV) { - natives.setBlipCoordinates(businessData.blipId, businessData.entrancePosition); - natives.changeBlipSprite(businessData.blipId, businessData.blipModel); - natives.setBlipMarkerLongDistance(businessData.blipId, false); - natives.setBlipAsShortRange(tempBusinessData.blipId, true); - natives.changeBlipNameFromAscii(businessData.blipId, `${businessData.name.substr(0, 24)}${(businessData.name.length > 24) ? " ...": ""}`); - } - } else { - let blipId = createGameBlip(tempBusinessData.blipModel, tempBusinessData.entrancePosition, tempBusinessData.name); - if(blipId != -1) { - tempBusinessData.blipId = blipId; - } - logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`); - } - } - } else { - logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId} doesn't exist. Adding ...`); - let tempBusinessData = new BusinessData(businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems); - if(blipModel != -1) { - let blipId = createGameBlip(tempBusinessData.blipModel, tempBusinessData.entrancePosition, tempBusinessData.name); - if(blipId != -1) { - tempBusinessData.blipId = blipId; - } - logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`); - } else { - logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId} has no blip.`); - } - businesses.push(tempBusinessData); - setAllBusinessDataIndexes(); - } - } + if(getGame() == VRR_GAME_GTA_IV) { + if(getBusinessData(businessId) != false) { + let businessData = getBusinessData(businessId); + businessData.name = name; + businessData.entrancePosition = entrancePosition; + businessData.blipModel = blipModel; + businessData.pickupModel = pickupModel; + businessData.hasInterior = hasInterior; + businessData.hasItems = hasItems; + + logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId} already exists. Checking blip ...`); + if(blipModel == -1) { + if(businessData.blipId != -1) { + logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been removed by the server`); + if(getGame() == VRR_GAME_GTA_IV) { + natives.removeBlipAndClearIndex(getBusinessData(businessId).blipId); + } else { + destroyElement(getElementFromId(blipId)); + } + businessData.blipId = -1; + //businesses.splice(businessData.index, 1); + //setAllBusinessDataIndexes(); + } else { + logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip is unchanged`); + } + } else { + if(businessData.blipId != -1) { + logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been changed by the server`); + if(getGame() == VRR_GAME_GTA_IV) { + natives.setBlipCoordinates(businessData.blipId, businessData.entrancePosition); + natives.changeBlipSprite(businessData.blipId, businessData.blipModel); + natives.setBlipMarkerLongDistance(businessData.blipId, false); + natives.setBlipAsShortRange(tempBusinessData.blipId, true); + natives.changeBlipNameFromAscii(businessData.blipId, `${businessData.name.substr(0, 24)}${(businessData.name.length > 24) ? " ...": ""}`); + } + } else { + let blipId = createGameBlip(tempBusinessData.blipModel, tempBusinessData.entrancePosition, tempBusinessData.name); + if(blipId != -1) { + tempBusinessData.blipId = blipId; + } + logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`); + } + } + } else { + logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId} doesn't exist. Adding ...`); + let tempBusinessData = new BusinessData(businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems); + if(blipModel != -1) { + let blipId = createGameBlip(tempBusinessData.blipModel, tempBusinessData.entrancePosition, tempBusinessData.name); + if(blipId != -1) { + tempBusinessData.blipId = blipId; + } + logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`); + } else { + logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId} has no blip.`); + } + businesses.push(tempBusinessData); + setAllBusinessDataIndexes(); + } + } } // =========================================================================== @@ -94,23 +94,23 @@ function receiveBusinessFromServer(businessId, name, entrancePosition, blipModel * @return {BusinessData} The business's data (class instance) */ function getBusinessData(businessId) { - //let tempBusinessData = businesses.find((b) => b.businessId == businessId); - //return (typeof tempBusinessData != "undefined") ? tempBusinessData[0] : false; - for(let i in businesses) { - if(businesses[i].businessId == businessId) { - return businesses[i]; - } - } + //let tempBusinessData = businesses.find((b) => b.businessId == businessId); + //return (typeof tempBusinessData != "undefined") ? tempBusinessData[0] : false; + for(let i in businesses) { + if(businesses[i].businessId == businessId) { + return businesses[i]; + } + } - return false; + return false; } // =========================================================================== function setAllBusinessDataIndexes() { - for(let i in businesses) { - businesses[i].index = i; - } + for(let i in businesses) { + businesses[i].index = i; + } } // =========================================================================== \ No newline at end of file diff --git a/scripts/client/chatbox.js b/scripts/client/chatbox.js index 64e454f6..28408a28 100644 --- a/scripts/client/chatbox.js +++ b/scripts/client/chatbox.js @@ -22,89 +22,89 @@ let scrollDownKey = false; // =========================================================================== function initChatBoxScript() { - logToConsole(LOG_DEBUG, "[VRR.ChatBox]: Initializing chatbox script ..."); - scrollUpKey = getKeyIdFromParams("pageup"); - scrollDownKey = getKeyIdFromParams("pagedown"); - bindChatBoxKeys(); - logToConsole(LOG_DEBUG, "[VRR.ChatBox]: Chatbox script initialized!"); + logToConsole(LOG_DEBUG, "[VRR.ChatBox]: Initializing chatbox script ..."); + scrollUpKey = getKeyIdFromParams("pageup"); + scrollDownKey = getKeyIdFromParams("pagedown"); + bindChatBoxKeys(); + logToConsole(LOG_DEBUG, "[VRR.ChatBox]: Chatbox script initialized!"); } // =========================================================================== function bindChatBoxKeys() { - bindKey(toInteger(scrollUpKey), KEYSTATE_DOWN, chatBoxScrollUp); - bindKey(toInteger(scrollDownKey), KEYSTATE_DOWN, chatBoxScrollDown); + bindKey(toInteger(scrollUpKey), KEYSTATE_DOWN, chatBoxScrollUp); + bindKey(toInteger(scrollDownKey), KEYSTATE_DOWN, chatBoxScrollDown); } // =========================================================================== function unBindChatBoxKeys() { - unbindKey(toInteger(scrollUpKey)); - unbindKey(toInteger(scrollDownKey)); + unbindKey(toInteger(scrollUpKey)); + unbindKey(toInteger(scrollDownKey)); } // =========================================================================== function receiveChatBoxMessageFromServer(messageString, colour) { - logToConsole(LOG_DEBUG, `[VRR.ChatBox]: Received chatbox message from server: ${messageString}`); - let colouredString = replaceColoursInMessage(messageString); + logToConsole(LOG_DEBUG, `[VRR.ChatBox]: Received chatbox message from server: ${messageString}`); + let colouredString = replaceColoursInMessage(messageString); - if(bottomMessageIndex >= chatBoxHistory.length-1) { - message(colouredString, colour); - bottomMessageIndex = chatBoxHistory.length-1; - } - addToChatBoxHistory(colouredString, colour); + if(bottomMessageIndex >= chatBoxHistory.length-1) { + message(colouredString, colour); + bottomMessageIndex = chatBoxHistory.length-1; + } + addToChatBoxHistory(colouredString, colour); } // =========================================================================== function setChatScrollLines(amount) { - scrollAmount = amount; + scrollAmount = amount; } // =========================================================================== function addToChatBoxHistory(messageString, colour) { - chatBoxHistory.push([messageString, colour]); + chatBoxHistory.push([messageString, colour]); } // =========================================================================== function chatBoxScrollUp() { - if(bottomMessageIndex > maxChatBoxLines) { - bottomMessageIndex = bottomMessageIndex-scrollAmount; - updateChatBox(); - } + if(bottomMessageIndex > maxChatBoxLines) { + bottomMessageIndex = bottomMessageIndex-scrollAmount; + updateChatBox(); + } } // =========================================================================== function chatBoxScrollDown() { - if(bottomMessageIndex < chatBoxHistory.length-1) { - bottomMessageIndex = bottomMessageIndex+scrollAmount; - updateChatBox(); - } + if(bottomMessageIndex < chatBoxHistory.length-1) { + bottomMessageIndex = bottomMessageIndex+scrollAmount; + updateChatBox(); + } } // =========================================================================== function clearChatBox() { - for(let i = 0 ; i <= maxChatBoxLines ; i++) { - message("", COLOUR_WHITE); - } + for(let i = 0 ; i <= maxChatBoxLines ; i++) { + message("", COLOUR_WHITE); + } } // =========================================================================== function updateChatBox() { - clearChatBox(); - for(let i = bottomMessageIndex-maxChatBoxLines ; i <= bottomMessageIndex ; i++) { - if(typeof chatBoxHistory[i] != "undefined") { - message(chatBoxHistory[i][0], chatBoxHistory[i][1]); - } else { - message("", COLOUR_WHITE); - } - } + clearChatBox(); + for(let i = bottomMessageIndex-maxChatBoxLines ; i <= bottomMessageIndex ; i++) { + if(typeof chatBoxHistory[i] != "undefined") { + message(chatBoxHistory[i][0], chatBoxHistory[i][1]); + } else { + message("", COLOUR_WHITE); + } + } } // =========================================================================== \ No newline at end of file diff --git a/scripts/client/content.js b/scripts/client/content.js index 214655ea..bcae54d0 100644 --- a/scripts/client/content.js +++ b/scripts/client/content.js @@ -8,58 +8,58 @@ // =========================================================================== function getCustomImage(imageName) { - let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]); - if(contentResource != null) { - if(contentResource.isStarted) { - let image = contentResource.exports.getCustomImage(imageName); - if(image != null) { - return image; - } - } - } - return false; + let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]); + if(contentResource != null) { + if(contentResource.isStarted) { + let image = contentResource.exports.getCustomImage(imageName); + if(image != null) { + return image; + } + } + } + return false; } // =========================================================================== function getCustomFont(fontName) { - let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]); - if(contentResource != null) { - if(contentResource.isStarted) { - let font = contentResource.exports.getCustomFont(fontName); - if(font != null) { - return font; - } - } - } - return false; + let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]); + if(contentResource != null) { + if(contentResource.isStarted) { + let font = contentResource.exports.getCustomFont(fontName); + if(font != null) { + return font; + } + } + } + return false; } // =========================================================================== function getCustomAudio(audioName) { - let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]); - if(contentResource != null) { - if(contentResource.isStarted) { - let audioFile = contentResource.exports.getCustomAudio(audioName); - if(audioFile != null) { - return audioFile; - } - } - } - return false; + let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]); + if(contentResource != null) { + if(contentResource.isStarted) { + let audioFile = contentResource.exports.getCustomAudio(audioName); + if(audioFile != null) { + return audioFile; + } + } + } + return false; } // =========================================================================== function playCustomAudio(audioName, volume = 0.5, loop = false) { - let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]); - if(contentResource != null) { - if(contentResource.isStarted) { - contentResource.exports.playCustomAudio(audioName, volume, loop); - } - } - return false; + let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]); + if(contentResource != null) { + if(contentResource.isStarted) { + contentResource.exports.playCustomAudio(audioName, volume, loop); + } + } + return false; } // =========================================================================== \ No newline at end of file diff --git a/scripts/client/event.js b/scripts/client/event.js index 2bc8a09d..91d1e502 100644 --- a/scripts/client/event.js +++ b/scripts/client/event.js @@ -8,210 +8,210 @@ // =========================================================================== function initEventScript() { - logToConsole(LOG_DEBUG, "[VRR.Event]: Initializing event script ..."); - addCustomEvents(); - addAllEventHandlers(); - logToConsole(LOG_DEBUG, "[VRR.Event]: Event script initialized!"); + logToConsole(LOG_DEBUG, "[VRR.Event]: Initializing event script ..."); + addCustomEvents(); + addAllEventHandlers(); + logToConsole(LOG_DEBUG, "[VRR.Event]: Event script initialized!"); } // =========================================================================== function addCustomEvents() { - addEvent("OnLocalPlayerEnterSphere", 1); - addEvent("OnLocalPlayerExitSphere", 1); - addEvent("OnLocalPlayerEnteredVehicle", 1); - addEvent("OnLocalPlayerExitedVehicle", 1); - addEvent("OnLocalPlayerSwitchWeapon", 2); + addEvent("OnLocalPlayerEnterSphere", 1); + addEvent("OnLocalPlayerExitSphere", 1); + addEvent("OnLocalPlayerEnteredVehicle", 1); + addEvent("OnLocalPlayerExitedVehicle", 1); + addEvent("OnLocalPlayerSwitchWeapon", 2); } // =========================================================================== function addAllEventHandlers() { - bindEventHandler("OnResourceStart", thisResource, onResourceStart); - bindEventHandler("OnResourceReady", thisResource, onResourceReady); - bindEventHandler("OnResourceStop", thisResource, onResourceStop); + bindEventHandler("OnResourceStart", thisResource, onResourceStart); + bindEventHandler("OnResourceReady", thisResource, onResourceReady); + bindEventHandler("OnResourceStop", thisResource, onResourceStop); - addEventHandler("OnProcess", onProcess); - addEventHandler("OnKeyUp", onKeyUp); - addEventHandler("OnDrawnHUD", onDrawnHUD); + addEventHandler("OnProcess", onProcess); + addEventHandler("OnKeyUp", onKeyUp); + addEventHandler("OnDrawnHUD", onDrawnHUD); - addEventHandler("OnPedWasted", onPedWasted); + addEventHandler("OnPedWasted", onPedWasted); - addEventHandler("OnElementStreamIn", onElementStreamIn); + addEventHandler("OnElementStreamIn", onElementStreamIn); - addEventHandler("OnLocalPlayerEnteredVehicle", onLocalPlayerEnteredVehicle); - addEventHandler("OnLocalPlayerExitedVehicle", onLocalPlayerExitedVehicle); - addEventHandler("OnLocalPlayerEnterSphere", onLocalPlayerEnterSphere); - addEventHandler("OnLocalPlayerExitSphere", onLocalPlayerExitSphere); - addEventHandler("OnLocalPlayerSwitchWeapon", onLocalPlayerSwitchWeapon); + addEventHandler("OnLocalPlayerEnteredVehicle", onLocalPlayerEnteredVehicle); + addEventHandler("OnLocalPlayerExitedVehicle", onLocalPlayerExitedVehicle); + addEventHandler("OnLocalPlayerEnterSphere", onLocalPlayerEnterSphere); + addEventHandler("OnLocalPlayerExitSphere", onLocalPlayerExitSphere); + addEventHandler("OnLocalPlayerSwitchWeapon", onLocalPlayerSwitchWeapon); - addEventHandler("OnPedInflictDamage", onPedInflictDamage); + addEventHandler("OnPedInflictDamage", onPedInflictDamage); - addEventHandler("OnLostFocus", onLostFocus); - addEventHandler("OnFocus", onFocus); + addEventHandler("OnLostFocus", onLostFocus); + addEventHandler("OnFocus", onFocus); - addEventHandler("OnCameraProcess", onCameraProcess); + addEventHandler("OnCameraProcess", onCameraProcess); } // =========================================================================== function onResourceStart(event, resource) { - sendResourceStartedSignalToServer(); - setUpInitialGame(); - garbageCollectorInterval = setInterval(collectAllGarbage, 1000*60); + sendResourceStartedSignalToServer(); + setUpInitialGame(); + garbageCollectorInterval = setInterval(collectAllGarbage, 1000*60); } // =========================================================================== function onResourceStop(event, resource) { - sendResourceStoppedSignalToServer(); + sendResourceStoppedSignalToServer(); } // =========================================================================== function onResourceReady(event, resource) { - sendResourceReadySignalToServer(); + sendResourceReadySignalToServer(); } // =========================================================================== function onProcess(event, deltaTime) { - if(localPlayer == null) { - return false; - } + if(localPlayer == null) { + return false; + } - if(!isSpawned) { - return false; - } + if(!isSpawned) { + return false; + } - processSync(); - processLocalPlayerControlState(); - processLocalPlayerVehicleControlState(); - processLocalPlayerSphereEntryExitHandling(); - processLocalPlayerVehicleEntryExitHandling(); - processJobRouteSphere(); - forceLocalPlayerEquippedWeaponItem(); - processWantedLevelReset(); - processGameSpecifics(); - processNearbyPickups(); - processVehiclePurchasing(); - //processVehicleFires(); + processSync(); + processLocalPlayerControlState(); + processLocalPlayerVehicleControlState(); + processLocalPlayerSphereEntryExitHandling(); + processLocalPlayerVehicleEntryExitHandling(); + processJobRouteSphere(); + forceLocalPlayerEquippedWeaponItem(); + processWantedLevelReset(); + processGameSpecifics(); + processNearbyPickups(); + processVehiclePurchasing(); + //processVehicleFires(); } // =========================================================================== function onKeyUp(event, keyCode, scanCode, keyModifiers) { - processSkinSelectKeyPress(keyCode); - //processKeyDuringAnimation(); - processGUIKeyPress(keyCode); - processToggleGUIKeyPress(keyCode); + processSkinSelectKeyPress(keyCode); + //processKeyDuringAnimation(); + processGUIKeyPress(keyCode); + processToggleGUIKeyPress(keyCode); } // =========================================================================== function onDrawnHUD(event) { - if(!renderHUD) { - return false; - } + if(!renderHUD) { + return false; + } - if(localPlayer == null) { - return false; - } + if(localPlayer == null) { + return false; + } - processSmallGameMessageRendering(); - processScoreBoardRendering(); - processLabelRendering(); - processLogoRendering(); - processItemActionRendering(); - processSkinSelectRendering(); - processNameTagRendering(); - processInteriorLightsRendering(); + processSmallGameMessageRendering(); + processScoreBoardRendering(); + processLabelRendering(); + processLogoRendering(); + processItemActionRendering(); + processSkinSelectRendering(); + processNameTagRendering(); + processInteriorLightsRendering(); } // =========================================================================== function onPedWasted(event, wastedPed, killerPed, weapon, pedPiece) { - logToConsole(LOG_DEBUG, `[VRR.Event] Ped ${wastedPed.name} died`); - wastedPed.clearWeapons(); + logToConsole(LOG_DEBUG, `[VRR.Event] Ped ${wastedPed.name} died`); + wastedPed.clearWeapons(); } // =========================================================================== function onElementStreamIn(event, element) { - syncElementProperties(element); + syncElementProperties(element); } // =========================================================================== function onLocalPlayerExitedVehicle(event, vehicle, seat) { - logToConsole(LOG_DEBUG, `[VRR.Event] Local player exited vehicle`); - sendNetworkEventToServer("vrr.onPlayerExitVehicle", getVehicleForNetworkEvent(vehicle), seat); + logToConsole(LOG_DEBUG, `[VRR.Event] Local player exited vehicle`); + sendNetworkEventToServer("vrr.onPlayerExitVehicle", getVehicleForNetworkEvent(vehicle), seat); - if(inVehicleSeat) { - parkedVehiclePosition = false; - parkedVehicleHeading = false; - } + if(inVehicleSeat) { + parkedVehiclePosition = false; + parkedVehicleHeading = false; + } } // =========================================================================== function onLocalPlayerEnteredVehicle(event, vehicle, seat) { - logToConsole(LOG_DEBUG, `[VRR.Event] Local player entered vehicle`); + logToConsole(LOG_DEBUG, `[VRR.Event] Local player entered vehicle`); - sendNetworkEventToServer("vrr.onPlayerEnterVehicle", getVehicleForNetworkEvent(vehicle), seat); + sendNetworkEventToServer("vrr.onPlayerEnterVehicle", getVehicleForNetworkEvent(vehicle), seat); - if(inVehicleSeat == 0) { - inVehicle.engine = false; - if(!inVehicle.engine) { - parkedVehiclePosition = inVehicle.position; - parkedVehicleHeading = inVehicle.heading; - } - } + if(inVehicleSeat == 0) { + inVehicle.engine = false; + if(!inVehicle.engine) { + parkedVehiclePosition = inVehicle.position; + parkedVehicleHeading = inVehicle.heading; + } + } } // =========================================================================== function onPedInflictDamage(event, damagedEntity, damagerEntity, weaponId, healthLoss, pedPiece) { - //let damagerEntityString = (!isNull(damagedEntity)) ? `${damagerEntity.name} (${damagerEntity.name}, ${damagerEntity.type} - ${typeof damagerEntity})` : `Unknown ped`; - //let damagedEntityString = (!isNull(damagedEntity)) ? `${damagedEntity.name} (${damagedEntity.name}, ${damagedEntity.type} - ${typeof damagedEntity})` : `Unknown ped`; - //logToConsole(LOG_DEBUG, `[VRR.Event] ${damagerEntityString} damaged ${damagedEntityString}'s '${pedPiece} with weapon ${weaponId}`); - if(!isNull(damagedEntity) && !isNull(damagerEntity)) { - if(damagedEntity.isType(ELEMENT_PLAYER)) { - if(damagedEntity == localPlayer) { - //if(!weaponDamageEnabled[damagerEntity.name]) { - event.preventDefault(); - sendNetworkEventToServer("vrr.weaponDamage", damagerEntity.name, weaponId, pedPiece, healthLoss); - //} - } - } - } + //let damagerEntityString = (!isNull(damagedEntity)) ? `${damagerEntity.name} (${damagerEntity.name}, ${damagerEntity.type} - ${typeof damagerEntity})` : `Unknown ped`; + //let damagedEntityString = (!isNull(damagedEntity)) ? `${damagedEntity.name} (${damagedEntity.name}, ${damagedEntity.type} - ${typeof damagedEntity})` : `Unknown ped`; + //logToConsole(LOG_DEBUG, `[VRR.Event] ${damagerEntityString} damaged ${damagedEntityString}'s '${pedPiece} with weapon ${weaponId}`); + if(!isNull(damagedEntity) && !isNull(damagerEntity)) { + if(damagedEntity.isType(ELEMENT_PLAYER)) { + if(damagedEntity == localPlayer) { + //if(!weaponDamageEnabled[damagerEntity.name]) { + event.preventDefault(); + sendNetworkEventToServer("vrr.weaponDamage", damagerEntity.name, weaponId, pedPiece, healthLoss); + //} + } + } + } } // =========================================================================== function onLocalPlayerEnterSphere(event, sphere) { - logToConsole(LOG_DEBUG, `[VRR.Event] Local player entered sphere`); - if(sphere == jobRouteLocationSphere) { - enteredJobRouteSphere(); - } + logToConsole(LOG_DEBUG, `[VRR.Event] Local player entered sphere`); + if(sphere == jobRouteLocationSphere) { + enteredJobRouteSphere(); + } } // =========================================================================== function onLocalPlayerExitSphere(event, sphere) { - logToConsole(LOG_DEBUG, `[VRR.Event] Local player exited sphere`); + logToConsole(LOG_DEBUG, `[VRR.Event] Local player exited sphere`); } // =========================================================================== function onLostFocus(event) { - processLostFocusAFK(); + processLostFocusAFK(); } // =========================================================================== function onFocus(event) { - processFocusAFK(); + processFocusAFK(); } // =========================================================================== @@ -227,8 +227,8 @@ function onCameraProcess(event) { // =========================================================================== function onChatOutput(event, messageText, colour) { - //event.preventDefault(); - //receiveChatBoxMessageFromServer(messageText, colour); + //event.preventDefault(); + //receiveChatBoxMessageFromServer(messageText, colour); } // =========================================================================== \ No newline at end of file diff --git a/scripts/client/gui.js b/scripts/client/gui.js index 86bd4cf3..676fde38 100644 --- a/scripts/client/gui.js +++ b/scripts/client/gui.js @@ -104,7 +104,7 @@ function closeAllWindows() { listDialog.window.shown = false; resetPassword.window.shown = false; passwordChange.window.shown = false; - + mexui.setInput(false); mexui.focusedControl = false; @@ -284,8 +284,8 @@ addNetworkEventHandler("vrr.guiInit", function() { // =========================================================================== function hideAllGUI() { - closeAllWindows(); - setChatWindowEnabled(true); + closeAllWindows(); + setChatWindowEnabled(true); guiSubmitKey = false; } diff --git a/scripts/client/house.js b/scripts/client/house.js index 47d4157e..5b74ef03 100644 --- a/scripts/client/house.js +++ b/scripts/client/house.js @@ -8,77 +8,77 @@ // =========================================================================== class HouseData { - constructor(houseId, entrancePosition, blipModel, pickupModel, hasInterior) { - this.index = -1; - this.houseId = houseId; - this.entrancePosition = entrancePosition; - this.blipModel = blipModel; - this.pickupModel = pickupModel; - this.hasInterior = hasInterior; - this.blipId = -1; - } + constructor(houseId, entrancePosition, blipModel, pickupModel, hasInterior) { + this.index = -1; + this.houseId = houseId; + this.entrancePosition = entrancePosition; + this.blipModel = blipModel; + this.pickupModel = pickupModel; + this.hasInterior = hasInterior; + this.blipId = -1; + } } // =========================================================================== function receiveHouseFromServer(houseId, entrancePosition, blipModel, pickupModel, hasInterior) { - logToConsole(LOG_DEBUG, `[VRR.House] Received house ${houseId} (${name}) from server`); - - if(getGame() == VRR_GAME_GTA_IV) { - if(getHouseData(houseId) != false) { - let houseData = getHouseData(houseId); - houseData.entrancePosition = entrancePosition; - houseData.blipModel = blipModel; - houseData.pickupModel = pickupModel; - houseData.hasInterior = hasInterior; + logToConsole(LOG_DEBUG, `[VRR.House] Received house ${houseId} (${name}) from server`); - logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId} already exists. Checking blip ...`); - if(blipModel == -1) { - if(houseData.blipId != -1) { - logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip has been removed by the server`); - if(getGame() == VRR_GAME_GTA_IV) { - natives.removeBlipAndClearIndex(getHouseData(houseId).blipId); - } else { - destroyElement(getElementFromId(blipId)); - } - houseData.blipId = -1; - } else { - logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip is unchanged`); - } - } else { - if(houseData.blipId != -1) { - logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip has been changed by the server`); - if(getGame() == VRR_GAME_GTA_IV) { - natives.setBlipCoordinates(houseData.blipId, houseData.entrancePosition); - natives.changeBlipSprite(houseData.blipId, houseData.blipModel); - natives.setBlipMarkerLongDistance(houseData.blipId, false); - natives.setBlipAsShortRange(houseData.blipId, true); - natives.changeBlipNameFromAscii(houseData.blipId, `${houseData.name.substr(0, 24)}${(houseData.name.length > 24) ? " ...": ""}`); - } - } else { - let blipId = createGameBlip(houseData.blipModel, houseData.entrancePosition, houseData.name); - if(blipId != -1) { - houseData.blipId = blipId; - } - logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`); - } - } - } else { - logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId} doesn't exist. Adding ...`); - let tempHouseData = new HouseData(houseId, entrancePosition, blipModel, pickupModel, hasInterior); - if(blipModel != -1) { - let blipId = createGameBlip(tempHouseData.blipModel, tempHouseData.entrancePosition, "House"); - if(blipId != -1) { - tempHouseData.blipId = blipId; - } - logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`); - } else { - logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId} has no blip.`); - } - houses.push(tempHouseData); - setAllHouseDataIndexes(); - } - } + if(getGame() == VRR_GAME_GTA_IV) { + if(getHouseData(houseId) != false) { + let houseData = getHouseData(houseId); + houseData.entrancePosition = entrancePosition; + houseData.blipModel = blipModel; + houseData.pickupModel = pickupModel; + houseData.hasInterior = hasInterior; + + logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId} already exists. Checking blip ...`); + if(blipModel == -1) { + if(houseData.blipId != -1) { + logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip has been removed by the server`); + if(getGame() == VRR_GAME_GTA_IV) { + natives.removeBlipAndClearIndex(getHouseData(houseId).blipId); + } else { + destroyElement(getElementFromId(blipId)); + } + houseData.blipId = -1; + } else { + logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip is unchanged`); + } + } else { + if(houseData.blipId != -1) { + logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip has been changed by the server`); + if(getGame() == VRR_GAME_GTA_IV) { + natives.setBlipCoordinates(houseData.blipId, houseData.entrancePosition); + natives.changeBlipSprite(houseData.blipId, houseData.blipModel); + natives.setBlipMarkerLongDistance(houseData.blipId, false); + natives.setBlipAsShortRange(houseData.blipId, true); + natives.changeBlipNameFromAscii(houseData.blipId, `${houseData.name.substr(0, 24)}${(houseData.name.length > 24) ? " ...": ""}`); + } + } else { + let blipId = createGameBlip(houseData.blipModel, houseData.entrancePosition, houseData.name); + if(blipId != -1) { + houseData.blipId = blipId; + } + logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`); + } + } + } else { + logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId} doesn't exist. Adding ...`); + let tempHouseData = new HouseData(houseId, entrancePosition, blipModel, pickupModel, hasInterior); + if(blipModel != -1) { + let blipId = createGameBlip(tempHouseData.blipModel, tempHouseData.entrancePosition, "House"); + if(blipId != -1) { + tempHouseData.blipId = blipId; + } + logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`); + } else { + logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId} has no blip.`); + } + houses.push(tempHouseData); + setAllHouseDataIndexes(); + } + } } // =========================================================================== @@ -88,21 +88,21 @@ function receiveHouseFromServer(houseId, entrancePosition, blipModel, pickupMode * @return {HouseData} The house's data (class instance) */ function getHouseData(houseId) { - for(let i in houses) { - if(houses[i].houseId == houseId) { - return houses[i]; - } - } + for(let i in houses) { + if(houses[i].houseId == houseId) { + return houses[i]; + } + } - return false; + return false; } // =========================================================================== function setAllHouseDataIndexes() { - for(let i in houses) { - houses[i].index = i; - } + for(let i in houses) { + houses[i].index = i; + } } // =========================================================================== \ No newline at end of file diff --git a/scripts/client/item.js b/scripts/client/item.js index a1735ae0..783426eb 100644 --- a/scripts/client/item.js +++ b/scripts/client/item.js @@ -23,40 +23,40 @@ function initItemScript() { // =========================================================================== function processItemActionRendering() { - 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 width = Math.ceil(getPercentage(itemActionDelaySize.x, progressPercent)); + 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 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); - } - } - } + 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); + } + } + } } // =========================================================================== function updatePlayerHotBar(activeSlot, itemsArray) { - logToConsole(LOG_DEBUG, `[VRR.Main] Updating hotbar`); + logToConsole(LOG_DEBUG, `[VRR.Main] Updating hotbar`); } // =========================================================================== function showItemActionDelay(duration) { - itemActionDelayDuration = duration; - itemActionDelayStart = sdl.ticks; - itemActionDelayEnabled = true; - logToConsole(LOG_DEBUG, `Item action delay started. Duration: ${itemActionDelayDuration}, Start: ${itemActionDelayStart}, Rendering Enabled: ${renderItemActionDelay}`); + itemActionDelayDuration = duration; + itemActionDelayStart = sdl.ticks; + itemActionDelayEnabled = true; + logToConsole(LOG_DEBUG, `Item action delay started. Duration: ${itemActionDelayDuration}, Start: ${itemActionDelayStart}, Rendering Enabled: ${renderItemActionDelay}`); } // =========================================================================== \ No newline at end of file diff --git a/scripts/client/job.js b/scripts/client/job.js index 022e9862..ce5575da 100644 --- a/scripts/client/job.js +++ b/scripts/client/job.js @@ -15,15 +15,15 @@ let jobRouteLocationSphere = null; // =========================================================================== class JobData { - constructor(jobId, name, position, blipModel, pickupModel) { - this.index = -1; - this.jobId = jobId; - this.name = name; - this.position = position; - this.blipModel = blipModel; - this.pickupModel = pickupModel; - this.blipId = -1; - } + constructor(jobId, name, position, blipModel, pickupModel) { + this.index = -1; + this.jobId = jobId; + this.name = name; + this.position = position; + this.blipModel = blipModel; + this.pickupModel = pickupModel; + this.blipId = -1; + } } // =========================================================================== @@ -36,136 +36,136 @@ function initJobScript() { // =========================================================================== function setLocalPlayerJobType(tempJobType) { - logToConsole(LOG_DEBUG, `[VRR.Job] Set local player job type to ${tempJobType}`); - localPlayerJobType = tempJobType; + logToConsole(LOG_DEBUG, `[VRR.Job] Set local player job type to ${tempJobType}`); + localPlayerJobType = tempJobType; } // =========================================================================== function setLocalPlayerWorkingState(tempWorking) { - logToConsole(LOG_DEBUG, `[VRR.Job] Setting working state to ${tempWorking}`); - localPlayerWorking = tempWorking; + logToConsole(LOG_DEBUG, `[VRR.Job] Setting working state to ${tempWorking}`); + localPlayerWorking = tempWorking; } // =========================================================================== function showJobRouteLocation(position, colour) { - logToConsole(LOG_DEBUG, `[VRR.Job] Showing job route location`); - if(getMultiplayerMod() == VRR_MPMOD_GTAC) { - if(game.game == VRR_GAME_GTA_SA) { - jobRouteLocationSphere = game.createPickup(1318, position, 1); - } else { - jobRouteLocationSphere = game.createSphere(position, 3); - jobRouteLocationSphere.colour = colour; - } + logToConsole(LOG_DEBUG, `[VRR.Job] Showing job route location`); + if(getMultiplayerMod() == VRR_MPMOD_GTAC) { + if(game.game == VRR_GAME_GTA_SA) { + jobRouteLocationSphere = game.createPickup(1318, position, 1); + } else { + jobRouteLocationSphere = game.createSphere(position, 3); + jobRouteLocationSphere.colour = colour; + } - if(jobRouteLocationBlip != null) { - destroyElement(jobRouteLocationBlip); - } + if(jobRouteLocationBlip != null) { + destroyElement(jobRouteLocationBlip); + } - blinkJobRouteLocationBlip(10, position, colour); - } + blinkJobRouteLocationBlip(10, position, colour); + } } // =========================================================================== function enteredJobRouteSphere() { - logToConsole(LOG_DEBUG, `[VRR.Job] Entered job route sphere`); - tellServerPlayerArrivedAtJobRouteLocation(); - destroyElement(jobRouteLocationSphere); - destroyElement(jobRouteLocationBlip); - jobRouteLocationSphere = null; - jobRouteLocationBlip = null; + logToConsole(LOG_DEBUG, `[VRR.Job] Entered job route sphere`); + tellServerPlayerArrivedAtJobRouteLocation(); + destroyElement(jobRouteLocationSphere); + destroyElement(jobRouteLocationBlip); + jobRouteLocationSphere = null; + jobRouteLocationBlip = null; } // =========================================================================== function blinkJobRouteLocationBlip(times, position, colour) { - for(let i = 1 ; i <= times ; i++) { - setTimeout(function() { - if(jobRouteLocationBlip != null) { - destroyElement(jobRouteLocationBlip); - jobRouteLocationBlip = null; - } else { - jobRouteLocationBlip = game.createBlip(position, 0, 2, colour); - } - }, 500*i); - } + for(let i = 1 ; i <= times ; i++) { + setTimeout(function() { + if(jobRouteLocationBlip != null) { + destroyElement(jobRouteLocationBlip); + jobRouteLocationBlip = null; + } else { + jobRouteLocationBlip = game.createBlip(position, 0, 2, colour); + } + }, 500*i); + } - setTimeout(function() { - jobRouteLocationBlip = game.createBlip(position, 0, 2, colour); - }, 500*times+1); + setTimeout(function() { + jobRouteLocationBlip = game.createBlip(position, 0, 2, colour); + }, 500*times+1); } // =========================================================================== function hideJobRouteLocation() { - destroyElement(jobRouteLocationSphere); - destroyElement(jobRouteLocationBlip); - jobRouteLocationSphere = null; - jobRouteLocationBlip = null; + destroyElement(jobRouteLocationSphere); + destroyElement(jobRouteLocationBlip); + jobRouteLocationSphere = null; + jobRouteLocationBlip = null; } // =========================================================================== function receiveJobFromServer(jobId, name, position, blipModel, pickupModel) { - logToConsole(LOG_DEBUG, `[VRR.Job] Received job ${jobId} (${name}) from server`); - - if(getGame() == VRR_GAME_GTA_IV) { - if(getJobData(jobId) != false) { - let jobData = getJobData(jobId); - jobData.name = name; - jobData.position = position; - jobData.blipModel = blipModel; - jobData.pickupModel = pickupModel; + logToConsole(LOG_DEBUG, `[VRR.Job] Received job ${jobId} (${name}) from server`); - logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId} already exists. Checking blip ...`); - if(blipModel == -1) { - if(jobData.blipId != -1) { - logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId}'s blip has been removed by the server`); - if(getGame() == VRR_GAME_GTA_IV) { - natives.removeBlipAndClearIndex(getJobData(jobId).blipId); - } else { - destroyElement(getElementFromId(blipId)); - } - jobData.blipId = -1; - } else { - logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId}'s blip is unchanged`); - } - } else { - if(jobData.blipId != -1) { - logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId}'s blip has been changed by the server`); - if(getGame() == VRR_GAME_GTA_IV) { - natives.setBlipCoordinates(jobData.blipId, jobData.position); - natives.changeBlipSprite(jobData.blipId, jobData.blipModel); - natives.setBlipMarkerLongDistance(jobData.blipId, false); - natives.setBlipAsShortRange(jobData.blipId, true); - natives.changeBlipNameFromAscii(jobData.blipId, `${jobData.name.substr(0, 24)}${(jobData.name.length > 24) ? " ...": ""}`); - } - } else { - let blipId = createGameBlip(jobData.blipModel, jobData.position, jobData.name); - if(blipId != -1) { - jobData.blipId = blipId; - } - logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`); - } - } - } else { - logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId} doesn't exist. Adding ...`); - let tempJobData = new JobData(jobId, name, position, blipModel, pickupModel); - if(blipModel != -1) { - let blipId = createGameBlip(tempJobData.blipModel, tempJobData.position, tempJobData.name); - if(blipId != -1) { - tempJobData.blipId = blipId; - } - logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`); - } else { - logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId} has no blip.`); - } - jobs.push(tempJobData); - setAllJobDataIndexes(); - } - } + if(getGame() == VRR_GAME_GTA_IV) { + if(getJobData(jobId) != false) { + let jobData = getJobData(jobId); + jobData.name = name; + jobData.position = position; + jobData.blipModel = blipModel; + jobData.pickupModel = pickupModel; + + logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId} already exists. Checking blip ...`); + if(blipModel == -1) { + if(jobData.blipId != -1) { + logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId}'s blip has been removed by the server`); + if(getGame() == VRR_GAME_GTA_IV) { + natives.removeBlipAndClearIndex(getJobData(jobId).blipId); + } else { + destroyElement(getElementFromId(blipId)); + } + jobData.blipId = -1; + } else { + logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId}'s blip is unchanged`); + } + } else { + if(jobData.blipId != -1) { + logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId}'s blip has been changed by the server`); + if(getGame() == VRR_GAME_GTA_IV) { + natives.setBlipCoordinates(jobData.blipId, jobData.position); + natives.changeBlipSprite(jobData.blipId, jobData.blipModel); + natives.setBlipMarkerLongDistance(jobData.blipId, false); + natives.setBlipAsShortRange(jobData.blipId, true); + natives.changeBlipNameFromAscii(jobData.blipId, `${jobData.name.substr(0, 24)}${(jobData.name.length > 24) ? " ...": ""}`); + } + } else { + let blipId = createGameBlip(jobData.blipModel, jobData.position, jobData.name); + if(blipId != -1) { + jobData.blipId = blipId; + } + logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`); + } + } + } else { + logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId} doesn't exist. Adding ...`); + let tempJobData = new JobData(jobId, name, position, blipModel, pickupModel); + if(blipModel != -1) { + let blipId = createGameBlip(tempJobData.blipModel, tempJobData.position, tempJobData.name); + if(blipId != -1) { + tempJobData.blipId = blipId; + } + logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`); + } else { + logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId} has no blip.`); + } + jobs.push(tempJobData); + setAllJobDataIndexes(); + } + } } // =========================================================================== @@ -175,21 +175,21 @@ function receiveJobFromServer(jobId, name, position, blipModel, pickupModel) { * @return {JobData} The job's data (class instance) */ function getJobData(jobId) { - for(let i in jobs) { - if(jobs[i].jobId == jobId) { - return jobs[i]; - } - } + for(let i in jobs) { + if(jobs[i].jobId == jobId) { + return jobs[i]; + } + } - return false; + return false; } // =========================================================================== function setAllJobDataIndexes() { - for(let i in jobs) { - jobs[i].index = i; - } + for(let i in jobs) { + jobs[i].index = i; + } } // =========================================================================== \ No newline at end of file diff --git a/scripts/client/jsconfig.json b/scripts/client/jsconfig.json index a5e369f2..f8c14e94 100644 --- a/scripts/client/jsconfig.json +++ b/scripts/client/jsconfig.json @@ -1,14 +1,14 @@ { "compilerOptions": { - "module": "commonjs", - "target": "es6", - "moduleResolution": "classic" + "module": "commonjs", + "target": "es6", + "moduleResolution": "classic" }, "include": [ - "*.js", - "gui/*.js", - "native/*.js", - "../shared/*.js", - "../third-party/mexui/*" + "*.js", + "gui/*.js", + "native/*.js", + "../shared/*.js", + "../third-party/mexui/*" ] } \ No newline at end of file diff --git a/scripts/client/keybind.js b/scripts/client/keybind.js index 4c8c2d9c..ecc4bcb8 100644 --- a/scripts/client/keybind.js +++ b/scripts/client/keybind.js @@ -23,71 +23,71 @@ 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()) { - return false; - } + logToConsole(LOG_DEBUG, `[VRR.KeyBind]: Binded key ${toUpperCase(getKeyNameFromId(key))} (${key})`); + keyBinds.push(toInteger(key)); + bindKey(toInteger(key), keyState, function(event) { + if(isAnyGUIActive()) { + return false; + } - if(hasKeyBindDelayElapsed()) { - if(canLocalPlayerUseKeyBinds()) { - logToConsole(LOG_DEBUG, `[VRR.KeyBind]: Using keybind for key ${toUpperCase(getKeyNameFromId(key))} (${key})`); - lastKeyBindUse = sdl.ticks; - tellServerPlayerUsedKeyBind(key); - } else { - logToConsole(LOG_DEBUG, `[VRR.KeyBind]: Failed to use keybind for key ${toUpperCase(getKeyNameFromId(key))} (${key}) - Not allowed to use keybinds!`); - } - } else { - logToConsole(LOG_DEBUG, `[VRR.KeyBind]: Failed to use keybind for key ${toUpperCase(getKeyNameFromId(key))} (${key}) - Not enough time has passed since last keybind use!`); - } - }); + if(hasKeyBindDelayElapsed()) { + if(canLocalPlayerUseKeyBinds()) { + logToConsole(LOG_DEBUG, `[VRR.KeyBind]: Using keybind for key ${toUpperCase(getKeyNameFromId(key))} (${key})`); + lastKeyBindUse = sdl.ticks; + tellServerPlayerUsedKeyBind(key); + } else { + logToConsole(LOG_DEBUG, `[VRR.KeyBind]: Failed to use keybind for key ${toUpperCase(getKeyNameFromId(key))} (${key}) - Not allowed to use keybinds!`); + } + } else { + logToConsole(LOG_DEBUG, `[VRR.KeyBind]: Failed to use keybind for key ${toUpperCase(getKeyNameFromId(key))} (${key}) - Not enough time has passed since last keybind use!`); + } + }); } // =========================================================================== function unBindAccountKey(key) { - logToConsole(LOG_DEBUG, `[VRR.KeyBind]: Unbinded key ${toUpperCase(getKeyNameFromId(key))} (${key})`); - unbindKey(key); - keyBinds.splice(keyBinds.indexOf(key), 1); - return true; + logToConsole(LOG_DEBUG, `[VRR.KeyBind]: Unbinded key ${toUpperCase(getKeyNameFromId(key))} (${key})`); + unbindKey(key); + keyBinds.splice(keyBinds.indexOf(key), 1); + return true; } // =========================================================================== function hasKeyBindDelayElapsed() { - if(sdl.ticks-lastKeyBindUse >= keyBindDelayTime) { - return true; - } + if(sdl.ticks-lastKeyBindUse >= keyBindDelayTime) { + return true; + } - return false; + return false; } // =========================================================================== function canLocalPlayerUseKeyBinds() { - if(isAnyGUIActive()) { - return false; - } + if(isAnyGUIActive()) { + return false; + } - if(!isSpawned) { - return false; - } + if(!isSpawned) { + return false; + } - if(itemActionDelayEnabled) { - return false; - } + if(itemActionDelayEnabled) { + return false; + } - return true; + return true; } // =========================================================================== function clearKeyBinds() { - for(let i in keyBinds) { - unbindKey(keyBinds[i]); - } - keyBinds = []; + for(let i in keyBinds) { + unbindKey(keyBinds[i]); + } + keyBinds = []; } // =========================================================================== \ No newline at end of file diff --git a/scripts/client/label.js b/scripts/client/label.js index 973bf20f..428fda7a 100644 --- a/scripts/client/label.js +++ b/scripts/client/label.js @@ -42,280 +42,280 @@ function initLabelScript() { // =========================================================================== function initLabelPropertyNameFont() { - return lucasFont.createDefaultFont(16.0, "Roboto", "Regular"); + return lucasFont.createDefaultFont(16.0, "Roboto", "Regular"); } // =========================================================================== function initLabelPropertyLockedFont() { - return lucasFont.createDefaultFont(12.0, "Roboto", "Light"); + return lucasFont.createDefaultFont(12.0, "Roboto", "Light"); } // =========================================================================== function initLabelJobNameFont() { - return lucasFont.createDefaultFont(16.0, "Roboto", "Regular"); + return lucasFont.createDefaultFont(16.0, "Roboto", "Regular"); } // =========================================================================== function initLabelJobHelpFont() { - return lucasFont.createDefaultFont(10.0, "Roboto", "Light"); + return lucasFont.createDefaultFont(10.0, "Roboto", "Light"); } // =========================================================================== function renderPropertyEntranceLabel(name, position, locked, isBusiness, price, rentPrice, labelInfoType) { - if(localPlayer == null) { - return false; - } + if(localPlayer == null) { + return false; + } if(propertyLabelNameFont == null) { return false; - } + } if(propertyLabelLockedFont == null) { return false; - } + } - let tempPosition = position; - tempPosition.z = tempPosition.z + propertyLabelHeight; - let screenPosition = getScreenFromWorldPosition(tempPosition); + let tempPosition = position; + tempPosition.z = tempPosition.z + propertyLabelHeight; + let screenPosition = getScreenFromWorldPosition(tempPosition); - if(screenPosition.x < 0 || screenPosition.x > game.width) { - return false; - } + if(screenPosition.x < 0 || screenPosition.x > game.width) { + return false; + } - let text = ""; - if(price > "0") { - text = `For sale: $${price}`; - let size = propertyLabelLockedFont.measure(text, game.width, 0.0, 0.0, propertyLabelLockedFont.size, true, true); - propertyLabelLockedFont.render(text, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, propertyLabelLockedFont.size, toColour(200, 200, 200, 255), false, true, false, true); + let text = ""; + if(price > "0") { + text = `For sale: $${price}`; + let size = propertyLabelLockedFont.measure(text, game.width, 0.0, 0.0, propertyLabelLockedFont.size, true, true); + propertyLabelLockedFont.render(text, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, propertyLabelLockedFont.size, toColour(200, 200, 200, 255), false, true, false, true); - screenPosition.y -= propertyLabelPriceOffset; - } + screenPosition.y -= propertyLabelPriceOffset; + } - text = ""; - if(rentPrice != "0") { - text = `For rent: $${rentPrice} every payday`; - let size = propertyLabelLockedFont.measure(text, game.width, 0.0, 0.0, propertyLabelLockedFont.size, true, true); - propertyLabelLockedFont.render(text, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, propertyLabelLockedFont.size, toColour(200, 200, 200, 255), false, true, false, true); + text = ""; + if(rentPrice != "0") { + text = `For rent: $${rentPrice} every payday`; + let size = propertyLabelLockedFont.measure(text, game.width, 0.0, 0.0, propertyLabelLockedFont.size, true, true); + propertyLabelLockedFont.render(text, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, propertyLabelLockedFont.size, toColour(200, 200, 200, 255), false, true, false, true); - screenPosition.y -= propertyLabelPriceOffset; - } + screenPosition.y -= propertyLabelPriceOffset; + } - if(isBusiness) { - text = (locked) ? "CLOSED" : "OPEN"; - } else { - text = (locked) ? "LOCKED" : "UNLOCKED"; - } + if(isBusiness) { + text = (locked) ? "CLOSED" : "OPEN"; + } else { + text = (locked) ? "LOCKED" : "UNLOCKED"; + } - if(!locked && labelInfoType != VRR_PROPLABEL_INFO_NONE) { - let infoText = ""; - switch(labelInfoType) { - case VRR_PROPLABEL_INFO_ENTER: - if(enterPropertyKey) { - infoText = `Press ${toUpperCase(getKeyNameFromId(enterPropertyKey))} to enter`; - } else { - infoText = `Use /enter to enter`; - } - break; + if(!locked && labelInfoType != VRR_PROPLABEL_INFO_NONE) { + let infoText = ""; + switch(labelInfoType) { + case VRR_PROPLABEL_INFO_ENTER: + if(enterPropertyKey) { + infoText = `Press ${toUpperCase(getKeyNameFromId(enterPropertyKey))} to enter`; + } else { + infoText = `Use /enter to enter`; + } + break; - case VRR_PROPLABEL_INFO_BUY: - infoText = `Use /buy to purchase items`; - break; + case VRR_PROPLABEL_INFO_BUY: + infoText = `Use /buy to purchase items`; + break; - case VRR_PROPLABEL_INFO_BUYBIZ: - infoText = `Use /buy to purchase items`; - break; + case VRR_PROPLABEL_INFO_BUYBIZ: + infoText = `Use /buy to purchase items`; + break; - //case VRR_PROPLABEL_INFO_RENTBIZ: - // infoText = `Use /bizrent to buy this business`; - // break; + //case VRR_PROPLABEL_INFO_RENTBIZ: + // infoText = `Use /bizrent to buy this business`; + // break; - case VRR_PROPLABEL_INFO_BUYHOUSE: - infoText = `Use /housebuy to buy this house`; - break; + case VRR_PROPLABEL_INFO_BUYHOUSE: + infoText = `Use /housebuy to buy this house`; + break; - case VRR_PROPLABEL_INFO_RENTHOUSE: - infoText = `Use /houserent to rent this house`; - break; + case VRR_PROPLABEL_INFO_RENTHOUSE: + infoText = `Use /houserent to rent this house`; + break; - case VRR_PROPLABEL_INFO_ENTERVEH: - infoText = "Enter a vehicle in the parking lot to buy it"; - break; + case VRR_PROPLABEL_INFO_ENTERVEH: + infoText = "Enter a vehicle in the parking lot to buy it"; + break; - case VRR_PROPLABEL_INFO_NONE: - default: - infoText = ""; - break; - } - if(getDistance(localPlayer.position, position) <= renderLabelDistance-2) { - let size = propertyLabelLockedFont.measure(infoText, game.width, 0.0, 0.0, propertyLabelLockedFont.size, true, true); - propertyLabelLockedFont.render(infoText, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, propertyLabelLockedFont.size, toColour(234, 198, 126, 255), false, true, false, true); - screenPosition.y -= propertyLabelLockedOffset; - } - } + case VRR_PROPLABEL_INFO_NONE: + default: + infoText = ""; + break; + } + if(getDistance(localPlayer.position, position) <= renderLabelDistance-2) { + let size = propertyLabelLockedFont.measure(infoText, game.width, 0.0, 0.0, propertyLabelLockedFont.size, true, true); + propertyLabelLockedFont.render(infoText, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, propertyLabelLockedFont.size, toColour(234, 198, 126, 255), false, true, false, true); + screenPosition.y -= propertyLabelLockedOffset; + } + } - let size = propertyLabelLockedFont.measure(text, game.width, 0.0, 0.0, propertyLabelLockedFont.size, true, true); - propertyLabelLockedFont.render(text, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, propertyLabelLockedFont.size, (locked) ? lockedColour : unlockedColour, false, true, false, true); + let size = propertyLabelLockedFont.measure(text, game.width, 0.0, 0.0, propertyLabelLockedFont.size, true, true); + propertyLabelLockedFont.render(text, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, propertyLabelLockedFont.size, (locked) ? lockedColour : unlockedColour, false, true, false, true); - screenPosition.y -= propertyLabelNameOffset; + screenPosition.y -= propertyLabelNameOffset; - text = name || " "; - size = propertyLabelNameFont.measure(text, game.width, 0.0, 0.0, propertyLabelNameFont.size, true, true); - propertyLabelNameFont.render(text, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, propertyLabelNameFont.size, (isBusiness) ? toColour(0, 153, 255, 255) : toColour(17, 204, 17, 255), false, true, false, true); + text = name || " "; + size = propertyLabelNameFont.measure(text, game.width, 0.0, 0.0, propertyLabelNameFont.size, true, true); + propertyLabelNameFont.render(text, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, propertyLabelNameFont.size, (isBusiness) ? toColour(0, 153, 255, 255) : toColour(17, 204, 17, 255), false, true, false, true); } // ------------------------------------------------------------------------- function renderPropertyExitLabel(position) { - if(localPlayer == null) { - return false; - } + if(localPlayer == null) { + return false; + } if(propertyLabelNameFont == null) { return false; - } + } if(propertyLabelLockedFont == null) { return false; } - let tempPosition = position; - tempPosition.z = tempPosition.z + propertyLabelHeight; - let screenPosition = getScreenFromWorldPosition(tempPosition); + let tempPosition = position; + tempPosition.z = tempPosition.z + propertyLabelHeight; + let screenPosition = getScreenFromWorldPosition(tempPosition); - if(screenPosition.x < 0 || screenPosition.x > game.width) { - return false; - } + if(screenPosition.x < 0 || screenPosition.x > game.width) { + return false; + } - let text = "EXIT"; - let size = propertyLabelNameFont.measure(text, game.width, 0.0, 0.0, propertyLabelNameFont.size, true, true); - propertyLabelNameFont.render(text, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, propertyLabelNameFont.size, COLOUR_WHITE, false, true, false, true); + let text = "EXIT"; + let size = propertyLabelNameFont.measure(text, game.width, 0.0, 0.0, propertyLabelNameFont.size, true, true); + propertyLabelNameFont.render(text, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, propertyLabelNameFont.size, COLOUR_WHITE, false, true, false, true); } // ------------------------------------------------------------------------- function renderJobLabel(name, position, jobType) { - if(localPlayer == null) { - return false; - } + if(localPlayer == null) { + return false; + } if(jobNameLabelFont == null) { return false; - } + } if(jobHelpLabelFont == null) { return false; } - let tempPosition = position; - tempPosition.z = tempPosition.z + propertyLabelHeight; - let screenPosition = getScreenFromWorldPosition(tempPosition); + let tempPosition = position; + tempPosition.z = tempPosition.z + propertyLabelHeight; + let screenPosition = getScreenFromWorldPosition(tempPosition); - if(screenPosition.x < 0 || screenPosition.x > game.width) { - return false; - } + if(screenPosition.x < 0 || screenPosition.x > game.width) { + return false; + } - let text = ""; - if(jobType == localPlayerJobType) { - if(localPlayerWorking) { - text = "Use /uniform and /equip for job stuff, or /stopwork to go off duty"; - } else { - text = "Use /startwork to go on duty"; - } - } else { - if(localPlayerJobType == 0) { - text = "Use /takejob to work here"; - } else { - text = "You already have a job. Use /quitjob if you want this one"; - } - } + let text = ""; + if(jobType == localPlayerJobType) { + if(localPlayerWorking) { + text = "Use /uniform and /equip for job stuff, or /stopwork to go off duty"; + } else { + text = "Use /startwork to go on duty"; + } + } else { + if(localPlayerJobType == 0) { + text = "Use /takejob to work here"; + } else { + text = "You already have a job. Use /quitjob if you want this one"; + } + } - let size = jobHelpLabelFont.measure(text, game.width, 0.0, 0.0, jobHelpLabelFont.size, true, true); - jobHelpLabelFont.render(text, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, jobHelpLabelFont.size, COLOUR_YELLOW, false, true, false, true); + let size = jobHelpLabelFont.measure(text, game.width, 0.0, 0.0, jobHelpLabelFont.size, true, true); + jobHelpLabelFont.render(text, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, jobHelpLabelFont.size, COLOUR_YELLOW, false, true, false, true); - screenPosition.y -= 18; + screenPosition.y -= 18; - text = name + " Job"; - size = jobNameLabelFont.measure(text, game.width, 0.0, 0.0, jobNameLabelFont.size, true, true); - jobNameLabelFont.render(text, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, jobNameLabelFont.size, COLOUR_WHITE, false, true, false, true); + text = name + " Job"; + size = jobNameLabelFont.measure(text, game.width, 0.0, 0.0, jobNameLabelFont.size, true, true); + jobNameLabelFont.render(text, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, jobNameLabelFont.size, COLOUR_WHITE, false, true, false, true); } // ------------------------------------------------------------------------- function processLabelRendering() { - if(renderLabels) { - if(!areServerElementsSupported()) { - if(localPlayer != null) { - for(let i in businesses) { - if(getDistance(localPlayer.position, businesses[i].entrancePosition) <= 75.0) { - natives.drawColouredCylinder(getPosBelowPos(businesses[i].entrancePosition, 1.0), 0.0, 0.0, 0, 153, 255, 255); - } - } + if(renderLabels) { + if(!areServerElementsSupported()) { + if(localPlayer != null) { + for(let i in businesses) { + if(getDistance(localPlayer.position, businesses[i].entrancePosition) <= 75.0) { + natives.drawColouredCylinder(getPosBelowPos(businesses[i].entrancePosition, 1.0), 0.0, 0.0, 0, 153, 255, 255); + } + } - for(let i in houses) { - if(getDistance(localPlayer.position, houses[i].entrancePosition) <= 75.0) { - natives.drawColouredCylinder(getPosBelowPos(houses[i].entrancePosition, 1.0), 0.0, 0.0, 0, 200, 0, 255); - } - } - - for(let i in jobs) { - if(getDistance(localPlayer.position, jobs[i].position) <= 75.0) { - natives.drawColouredCylinder(getPosBelowPos(jobs[i].position, 1.0), 0.0, 0.0, 255, 255, 0, 255); - } - } - } - } - - if(areWorldLabelsSupported()) { - if(localPlayer != null) { - let pickups = getElementsByType(ELEMENT_PICKUP); - for(let i in pickups) { - if(pickups[i].getData("vrr.label.type") != null) { - if(getDistance(localPlayer.position, pickups[i].position) <= renderLabelDistance) { - if(!pickups[i].isOnScreen) { - let price = "0"; - let rentPrice = "0"; - let labelInfoType = VRR_PROPLABEL_INFO_NONE; - if(pickups[i].getData("vrr.label.price") != null) { - price = makeLargeNumberReadable(pickups[i].getData("vrr.label.price")); - } - - if(pickups[i].getData("vrr.label.rentprice") != null) { - rentPrice = makeLargeNumberReadable(pickups[i].getData("vrr.label.rentprice")); - } - - if(pickups[i].getData("vrr.label.help") != null) { - labelInfoType = pickups[i].getData("vrr.label.help"); - } - - switch(pickups[i].getData("vrr.label.type")) { - case VRR_LABEL_BUSINESS: - renderPropertyEntranceLabel(pickups[i].getData("vrr.label.name"), pickups[i].position, pickups[i].getData("vrr.label.locked"), true, price, rentPrice, labelInfoType); - break; - - case VRR_LABEL_HOUSE: - renderPropertyEntranceLabel("House", pickups[i].position, pickups[i].getData("vrr.label.locked"), false, price, rentPrice, labelInfoType); - break; - - case VRR_LABEL_JOB: - renderJobLabel(pickups[i].getData("vrr.label.name"), pickups[i].position, pickups[i].getData("vrr.label.jobType")); - break; - - case VRR_LABEL_EXIT: - renderPropertyExitLabel(pickups[i].position); - break; - } - } - } - } - } - } - } - } + for(let i in houses) { + if(getDistance(localPlayer.position, houses[i].entrancePosition) <= 75.0) { + natives.drawColouredCylinder(getPosBelowPos(houses[i].entrancePosition, 1.0), 0.0, 0.0, 0, 200, 0, 255); + } + } + + for(let i in jobs) { + if(getDistance(localPlayer.position, jobs[i].position) <= 75.0) { + natives.drawColouredCylinder(getPosBelowPos(jobs[i].position, 1.0), 0.0, 0.0, 255, 255, 0, 255); + } + } + } + } + + if(areWorldLabelsSupported()) { + if(localPlayer != null) { + let pickups = getElementsByType(ELEMENT_PICKUP); + for(let i in pickups) { + if(pickups[i].getData("vrr.label.type") != null) { + if(getDistance(localPlayer.position, pickups[i].position) <= renderLabelDistance) { + if(!pickups[i].isOnScreen) { + let price = "0"; + let rentPrice = "0"; + let labelInfoType = VRR_PROPLABEL_INFO_NONE; + if(pickups[i].getData("vrr.label.price") != null) { + price = makeLargeNumberReadable(pickups[i].getData("vrr.label.price")); + } + + if(pickups[i].getData("vrr.label.rentprice") != null) { + rentPrice = makeLargeNumberReadable(pickups[i].getData("vrr.label.rentprice")); + } + + if(pickups[i].getData("vrr.label.help") != null) { + labelInfoType = pickups[i].getData("vrr.label.help"); + } + + switch(pickups[i].getData("vrr.label.type")) { + case VRR_LABEL_BUSINESS: + renderPropertyEntranceLabel(pickups[i].getData("vrr.label.name"), pickups[i].position, pickups[i].getData("vrr.label.locked"), true, price, rentPrice, labelInfoType); + break; + + case VRR_LABEL_HOUSE: + renderPropertyEntranceLabel("House", pickups[i].position, pickups[i].getData("vrr.label.locked"), false, price, rentPrice, labelInfoType); + break; + + case VRR_LABEL_JOB: + renderJobLabel(pickups[i].getData("vrr.label.name"), pickups[i].position, pickups[i].getData("vrr.label.jobType")); + break; + + case VRR_LABEL_EXIT: + renderPropertyExitLabel(pickups[i].position); + break; + } + } + } + } + } + } + } + } } // ------------------------------------------------------------------------- \ No newline at end of file diff --git a/scripts/client/logo.js b/scripts/client/logo.js index 286e38e1..9a23f20b 100644 --- a/scripts/client/logo.js +++ b/scripts/client/logo.js @@ -15,38 +15,38 @@ let logoSize = toVector2(128, 128); function initLogoScript() { logToConsole(LOG_DEBUG, "[VRR.Logo]: Initializing logo script ..."); - //logoImage = loadLogoImage(); + //logoImage = loadLogoImage(); logToConsole(LOG_DEBUG, "[VRR.Logo]: Logo script initialized!"); } // =========================================================================== function loadLogoImage() { - let logoStream = openFile(mainLogoPath); - let tempLogoImage = null; - if(logoStream != null) { - tempLogoImage = graphics.loadPNG(logoStream); - logoStream.close(); - } + let logoStream = openFile(mainLogoPath); + let tempLogoImage = null; + if(logoStream != null) { + tempLogoImage = graphics.loadPNG(logoStream); + logoStream.close(); + } - return tempLogoImage; + return tempLogoImage; } // =========================================================================== function processLogoRendering() { - if(renderLogo) { - if(logoImage != null) { - graphics.drawRectangle(logoImage, logoPos, logoSize); - } - } + if(renderLogo) { + if(logoImage != null) { + graphics.drawRectangle(logoImage, logoPos, logoSize); + } + } } // =========================================================================== function setServerLogoRenderState(state) { - logToConsole(LOG_DEBUG, `[VRR.Main] Server logo ${(state) ? "enabled" : "disabled"}`); - renderLogo = state; + logToConsole(LOG_DEBUG, `[VRR.Main] Server logo ${(state) ? "enabled" : "disabled"}`); + renderLogo = state; } // =========================================================================== \ No newline at end of file diff --git a/scripts/client/messaging.js b/scripts/client/messaging.js index a2c97cfd..11c17b71 100644 --- a/scripts/client/messaging.js +++ b/scripts/client/messaging.js @@ -16,64 +16,64 @@ let smallGameMessageTimer = null; function initMessagingScript() { logToConsole(LOG_DEBUG, "[VRR.Messaging]: Initializing messaging script ..."); - smallGameMessageFont = loadSmallGameMessageFont(); + smallGameMessageFont = loadSmallGameMessageFont(); logToConsole(LOG_DEBUG, "[VRR.Messaging]: Messaging script initialized!"); } // =========================================================================== function loadSmallGameMessageFont() { - let tempSmallGameMessageFont = null; - let fontStream = openFile("files/fonts/pricedown.ttf"); - if(fontStream != null) { - tempSmallGameMessageFont = lucasFont.createFont(fontStream, 20.0); - fontStream.close(); - } + let tempSmallGameMessageFont = null; + let fontStream = openFile("files/fonts/pricedown.ttf"); + if(fontStream != null) { + tempSmallGameMessageFont = lucasFont.createFont(fontStream, 20.0); + fontStream.close(); + } - return tempSmallGameMessageFont; + return tempSmallGameMessageFont; } // =========================================================================== function loadBigGameMessageFont() { - let tempBigGameMessageFont = null; - let fontStream = openFile("files/fonts/pricedown.ttf"); - if(fontStream != null) { - tempBigGameMessageFont = lucasFont.createFont(fontStream, 28.0); - fontStream.close(); - } + let tempBigGameMessageFont = null; + let fontStream = openFile("files/fonts/pricedown.ttf"); + if(fontStream != null) { + tempBigGameMessageFont = lucasFont.createFont(fontStream, 28.0); + fontStream.close(); + } - return tempBigGameMessageFont; + return tempBigGameMessageFont; } // =========================================================================== function processSmallGameMessageRendering() { - if(renderSmallGameMessage) { - if(smallGameMessageFont != null) { - if(smallGameMessageFont != "") { - smallGameMessageFont.render(smallGameMessageText, [0, game.height-90], game.width, 0.5, 0.0, smallGameMessageFont.size, smallGameMessageColour, true, true, false, true); - } - } - } + if(renderSmallGameMessage) { + if(smallGameMessageFont != null) { + if(smallGameMessageFont != "") { + smallGameMessageFont.render(smallGameMessageText, [0, game.height-90], game.width, 0.5, 0.0, smallGameMessageFont.size, smallGameMessageColour, true, true, false, true); + } + } + } } // =========================================================================== function showSmallGameMessage(text, colour, duration) { - logToConsole(LOG_DEBUG, `[VRR.Messaging] Showing small game message '${text}' for ${duration}ms`); - if(smallGameMessageText != "") { - clearTimeout(smallGameMessageTimer); - } + logToConsole(LOG_DEBUG, `[VRR.Messaging] Showing small game message '${text}' for ${duration}ms`); + if(smallGameMessageText != "") { + clearTimeout(smallGameMessageTimer); + } - smallGameMessageColour = colour; - smallGameMessageText = text; + smallGameMessageColour = colour; + smallGameMessageText = text; - smallGameMessageTimer = setTimeout(function() { - smallGameMessageText = ""; - smallGameMessageColour = COLOUR_WHITE; - smallGameMessageTimer = null; - }, duration); + smallGameMessageTimer = setTimeout(function() { + smallGameMessageText = ""; + smallGameMessageColour = COLOUR_WHITE; + smallGameMessageTimer = null; + }, duration); } // =========================================================================== \ No newline at end of file diff --git a/scripts/client/mousecam.js b/scripts/client/mousecam.js index cd4bfd7b..edb85550 100644 --- a/scripts/client/mousecam.js +++ b/scripts/client/mousecam.js @@ -632,10 +632,10 @@ function update() addEventHandler("OnCameraProcess", (event) => { - if(mouseCameraEnabled) { - update(); - event.preventDefault(); - } + if(mouseCameraEnabled) { + update(); + event.preventDefault(); + } }); function toggleMouseCamera() { diff --git a/scripts/client/nametag.js b/scripts/client/nametag.js index 7009f884..757683b2 100644 --- a/scripts/client/nametag.js +++ b/scripts/client/nametag.js @@ -74,11 +74,11 @@ function drawNametag(x, y, health, armour, text, ping, alpha, distance, colour, alpha *= 0.75; let width = nametagWidth; health = Math.max(0.0, Math.min(1.0, health)); - armour = Math.max(0.0, Math.min(1.0, armour)); + armour = Math.max(0.0, Math.min(1.0, armour)); - // Starts at bottom and works it's way up - // ------------------------------------------- - // Health Bar + // Starts at bottom and works it's way up + // ------------------------------------------- + // Health Bar if(getMultiplayerMod() == VRR_MPMOD_GTAC) { if(game.game == VRR_GAME_GTA_III) { @@ -104,7 +104,7 @@ function drawNametag(x, y, health, armour, text, ping, alpha, distance, colour, graphics.drawRectangle(null, [hx+2, hy+2], [(width-4)*health, 10-6], colour, colour, colour, colour); } - // Armour Bar + // Armour Bar if (armour > 0.0) { // Go up 10 pixels to draw the next part @@ -119,16 +119,16 @@ function drawNametag(x, y, health, armour, text, ping, alpha, distance, colour, y -= 20; - // Nametag + // Nametag if(nametagFont != null) { let size = nametagFont.measure(text, game.width, 0.0, 0.0, nametagFont.size, false, false); nametagFont.render(text, [x-size[0]/2, y-size[1]/2], game.width, 0.0, 0.0, nametagFont.size, colour, false, false, false, true); } - // Go up another 10 pixels for the next part - y -= 20; + // Go up another 10 pixels for the next part + y -= 20; - // AFK Status + // AFK Status if(afkStatusFont != null) { if(afk) { let size = afkStatusFont.measure("PAUSED", game.width, 0.0, 0.0, afkStatusFont.size, false, false); @@ -147,7 +147,7 @@ function updateNametags(element) { if(localPlayer != null) { let playerPos = localPlayer.position; let elementPos = element.position; - let client = getClientFromPlayerElement(element); + let client = getClientFromPlayerElement(element); elementPos[2] += 0.9; @@ -173,26 +173,26 @@ function updateNametags(element) { } if(element.type == ELEMENT_PLAYER) { - let name = element.name; - let colour = COLOUR_WHITE; + let name = element.name; + let colour = COLOUR_WHITE; let paused = false; let ping = -1; - if(typeof playerNames[element.name] != "undefined") { - name = playerNames[element.name]; - } - - if(typeof playerPaused[element.name] != "undefined") { - paused = playerPaused[element.name]; - } - - if(typeof playerColours[element.name] != "undefined") { - colour = playerColours[element.name]; + if(typeof playerNames[element.name] != "undefined") { + name = playerNames[element.name]; } - if(typeof playerPing[element.name] != "undefined") { - ping = playerPing[element.name]; - } + if(typeof playerPaused[element.name] != "undefined") { + paused = playerPaused[element.name]; + } + + if(typeof playerColours[element.name] != "undefined") { + colour = playerColours[element.name]; + } + + if(typeof playerPing[element.name] != "undefined") { + ping = playerPing[element.name]; + } drawNametag(screenPos[0], screenPos[1], health, armour, name, ping, 1.0-distance/nametagDistance, distance, colour, paused, element.skin); } diff --git a/scripts/client/native/connected.js b/scripts/client/native/connected.js index 72054b5f..358735f3 100644 --- a/scripts/client/native/connected.js +++ b/scripts/client/native/connected.js @@ -8,13 +8,13 @@ // =========================================================================== function sendNetworkEventToPlayer(networkEvent, client, ...args) { - triggerNetworkEvent.apply(null, networkEvent, client, args); + triggerNetworkEvent.apply(null, networkEvent, client, args); } // =========================================================================== function getPlayerPosition() { - return localPlayer.position; + return localPlayer.position; } // =========================================================================== @@ -30,39 +30,39 @@ function setPlayerPosition(position) { // =========================================================================== function getElementPosition(element) { - return element.position; + return element.position; } // =========================================================================== function setElementPosition(element, position) { - if(!element.isSyncer) { - return false; - } + if(!element.isSyncer) { + return false; + } - element.position = position; + element.position = position; } // =========================================================================== function deleteGameElement(element, position) { - if(!element.isOwner) { - return false; - } + if(!element.isOwner) { + return false; + } - destroyGameElement(element); + destroyGameElement(element); } // =========================================================================== function createGameVehicle(modelIndex, position, heading) { - return game.createVehicle(getGameConfig().vehicles[getGame()][modelIndex][0], position, heading); + return game.createVehicle(getGameConfig().vehicles[getGame()][modelIndex][0], position, heading); } // =========================================================================== function addNetworkEventHandler(eventName, handlerFunction) { - addNetworkHandler(eventName, handlerFunction); + addNetworkHandler(eventName, handlerFunction); } // =========================================================================== @@ -156,7 +156,7 @@ function createGameBlip(blipModel, position, name = "") { natives.setBlipAsShortRange(blipId, true); natives.changeBlipNameFromAscii(blipId, `${name.substr(0, 24)}${(name.length > 24) ? " ...": ""}`); return blipId; - } + } } return -1; diff --git a/scripts/client/radio.js b/scripts/client/radio.js index 2608e834..a9ea993d 100644 --- a/scripts/client/radio.js +++ b/scripts/client/radio.js @@ -8,39 +8,39 @@ // =========================================================================== function playStreamingRadio(url, loop, volume, element = false) { - if(streamingRadio != null) { - streamingRadio.stop(); - } + if(streamingRadio != null) { + streamingRadio.stop(); + } - streamingRadioVolume = volume; + streamingRadioVolume = volume; - streamingRadio = audio.createSoundFromURL(url, loop); - streamingRadio.volume = volume/100; - streamingRadio.play(); + streamingRadio = audio.createSoundFromURL(url, loop); + streamingRadio.volume = volume/100; + streamingRadio.play(); } // =========================================================================== function stopStreamingRadio() { - if(streamingRadio != null) { - streamingRadio.stop(); - } - streamingRadio = null; + if(streamingRadio != null) { + streamingRadio.stop(); + } + streamingRadio = null; } // =========================================================================== function setStreamingRadioVolume(volume) { - if(streamingRadio != null) { - streamingRadioVolume = volume; - streamingRadio.volume = volume/100; - } + if(streamingRadio != null) { + streamingRadioVolume = volume; + streamingRadio.volume = volume/100; + } } // =========================================================================== function playAudioFile(audioName, loop, volume) { - playCustomAudio(audioName, volume/100, loop); + playCustomAudio(audioName, volume/100, loop); } // =========================================================================== \ No newline at end of file diff --git a/scripts/client/scoreboard.js b/scripts/client/scoreboard.js index 5007d78b..04dd9630 100644 --- a/scripts/client/scoreboard.js +++ b/scripts/client/scoreboard.js @@ -43,7 +43,7 @@ function processScoreBoardRendering() { } if(renderScoreBoard) { - if(isKeyDown(SDLK_TAB)) { + 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); diff --git a/scripts/client/server.js b/scripts/client/server.js index 8ca4741d..5dc99b72 100644 --- a/scripts/client/server.js +++ b/scripts/client/server.js @@ -8,198 +8,186 @@ // =========================================================================== function initServerScript() { - logToConsole(LOG_DEBUG, "[VRR.Server]: Initializing server script ..."); - addAllNetworkHandlers(); - logToConsole(LOG_DEBUG, "[VRR.Server]: Server script initialized!"); + logToConsole(LOG_DEBUG, "[VRR.Server]: Initializing server script ..."); + addAllNetworkHandlers(); + logToConsole(LOG_DEBUG, "[VRR.Server]: Server script initialized!"); } // =========================================================================== function addAllNetworkHandlers() { - logToConsole(LOG_DEBUG, "[VRR.Server]: Adding network handlers ..."); + logToConsole(LOG_DEBUG, "[VRR.Server]: Adding network handlers ..."); - addNetworkEventHandler("vrr.smallGameMessage", showSmallGameMessage); - addNetworkEventHandler("vrr.working", setLocalPlayerWorkingState); - addNetworkEventHandler("vrr.jobType", setLocalPlayerJobType); - addNetworkEventHandler("vrr.passenger", enterVehicleAsPassenger); - - addNetworkEventHandler("vrr.freeze", setLocalPlayerFrozenState); - addNetworkEventHandler("vrr.control", setLocalPlayerControlState); - addNetworkEventHandler("vrr.fadeCamera", fadeLocalCamera); - addNetworkEventHandler("vrr.removeFromVehicle", removeLocalPlayerFromVehicle); - addNetworkEventHandler("vrr.clearPeds", clearLocalPlayerOwnedPeds); - addNetworkEventHandler("vrr.restoreCamera", restoreLocalCamera); - addNetworkEventHandler("vrr.cameraLookAt", setLocalCameraLookAt); - addNetworkEventHandler("vrr.logo", setServerLogoRenderState); - addNetworkEventHandler("vrr.ambience", setCityAmbienceState); - addNetworkEventHandler("vrr.runCode", runClientCode); - addNetworkEventHandler("vrr.clearWeapons", clearLocalPlayerWeapons); - addNetworkEventHandler("vrr.giveWeapon", giveLocalPlayerWeapon); - addNetworkEventHandler("vrr.position", setLocalPlayerPosition); - addNetworkEventHandler("vrr.heading", setLocalPlayerHeading); - addNetworkEventHandler("vrr.interior", setLocalPlayerInterior); - addNetworkEventHandler("vrr.minuteDuration", setMinuteDuration); - addNetworkEventHandler("vrr.showJobRouteLocation", showJobRouteLocation); - addNetworkEventHandler("vrr.hideJobRouteLocation", hideJobRouteLocation); - addNetworkEventHandler("vrr.snow", setSnowState); - addNetworkEventHandler("vrr.health", setLocalPlayerHealth); - addNetworkEventHandler("vrr.enterPropertyKey", setEnterPropertyKey); - addNetworkEventHandler("vrr.skinSelect", toggleSkinSelect); - addNetworkEventHandler("vrr.hotbar", updatePlayerHotBar); - addNetworkEventHandler("vrr.pedSpeech", playPedSpeech); - addNetworkEventHandler("vrr.clearPedState", clearLocalPedState); - addNetworkEventHandler("vrr.drunkEffect", setLocalPlayerDrunkEffect); - addNetworkEventHandler("vrr.showItemActionDelay", showItemActionDelay); - addNetworkEventHandler("vrr.set2DRendering", setPlayer2DRendering); - addNetworkEventHandler("vrr.mouseCursor", toggleMouseCursor); - addNetworkEventHandler("vrr.mouseCamera", toggleMouseCamera); - addNetworkEventHandler("vrr.mouseCameraForce", setMouseCameraState); - addNetworkEventHandler("vrr.weaponDamageEnabled", setPlayerWeaponDamageEnabled); - addNetworkEventHandler("vrr.weaponDamageEvent", setPlayerWeaponDamageEvent); - addNetworkEventHandler("vrr.spawned", onServerSpawnedPlayer); - addNetworkEventHandler("vrr.money", setLocalPlayerCash); - addNetworkEventHandler("vrr.armour", setLocalPlayerArmour); - addNetworkEventHandler("vrr.wantedLevel", forceLocalPlayerWantedLevel); - - addNetworkEventHandler("vrr.delKeyBind", unBindAccountKey); - addNetworkEventHandler("vrr.addKeyBind", bindAccountKey); - addNetworkEventHandler("vrr.clearKeyBinds", clearKeyBinds); - - addNetworkEventHandler("vrr.nametag", updatePlayerNameTag); - addNetworkEventHandler("vrr.ping", updatePlayerPing); - - addNetworkEventHandler("vrr.m", receiveChatBoxMessageFromServer); - addNetworkEventHandler("vrr.chatScrollLines", setChatScrollLines); - - addNetworkEventHandler("vrr.radioStream", playStreamingRadio); - addNetworkEventHandler("vrr.audioFileStream", playAudioFile); - addNetworkEventHandler("vrr.stopRadioStream", stopStreamingRadio); - addNetworkEventHandler("vrr.radioVolume", setStreamingRadioVolume); - - addNetworkEventHandler("vrr.veh.lights", setVehicleLights); - addNetworkEventHandler("vrr.veh.engine", setVehicleEngine); - addNetworkEventHandler("vrr.veh.repair", repairVehicle); - - addNetworkEventHandler("vrr.pedAnim", makePedPlayAnimation); - addNetworkEventHandler("vrr.pedStopAnim", makePedStopAnimation); - addNetworkEventHandler("vrr.localPlayerSkin", setLocalPlayerSkin); - addNetworkEventHandler("vrr.forcePedAnim", forcePedAnimation); - addNetworkEventHandler("vrr.hideAllGUI", hideAllGUI); - addNetworkEventHandler("vrr.clientInfo", serverRequestedClientInfo); - addNetworkEventHandler("vrr.interiorLights", updateInteriorLightsState); - addNetworkEventHandler("vrr.cutsceneInterior", setCutsceneInterior); - - addNetworkEventHandler("vrr.syncElement", forceSyncElementProperties); - addNetworkEventHandler("vrr.elementPosition", setElementPosition); - addNetworkEventHandler("vrr.elementCollisions", setElementCollisionsEnabled); - - addNetworkEventHandler("vrr.vehBuyState", setVehiclePurchaseState); - - addNetworkEventHandler("vrr.showRegistration", showRegistrationGUI); - addNetworkEventHandler("vrr.showNewCharacter", showNewCharacterGUI); - addNetworkEventHandler("vrr.showLogin", showLoginGUI); - - addNetworkEventHandler("vrr.logLevel", setLogLevel); - addNetworkEventHandler("vrr.infiniteRun", setLocalPlayerInfiniteRun); - - addNetworkEventHandler("vrr.business", receiveBusinessFromServer); - addNetworkEventHandler("vrr.house", receiveHouseFromServer); - - addNetworkEventHandler("vrr.holdObject", makePedHoldObject); - - addNetworkEventHandler("vrr.playerPedId", sendLocalPlayerNetworkIdToServer); - - addNetworkEventHandler("vrr.ped", setLocalPlayerPedPartsAndProps); + addNetworkEventHandler("vrr.smallGameMessage", showSmallGameMessage); + addNetworkEventHandler("vrr.working", setLocalPlayerWorkingState); + addNetworkEventHandler("vrr.jobType", setLocalPlayerJobType); + addNetworkEventHandler("vrr.passenger", enterVehicleAsPassenger); + addNetworkEventHandler("vrr.freeze", setLocalPlayerFrozenState); + addNetworkEventHandler("vrr.control", setLocalPlayerControlState); + addNetworkEventHandler("vrr.fadeCamera", fadeLocalCamera); + addNetworkEventHandler("vrr.removeFromVehicle", removeLocalPlayerFromVehicle); + addNetworkEventHandler("vrr.clearPeds", clearLocalPlayerOwnedPeds); + addNetworkEventHandler("vrr.restoreCamera", restoreLocalCamera); + addNetworkEventHandler("vrr.cameraLookAt", setLocalCameraLookAt); + addNetworkEventHandler("vrr.logo", setServerLogoRenderState); + addNetworkEventHandler("vrr.ambience", setCityAmbienceState); + addNetworkEventHandler("vrr.runCode", runClientCode); + addNetworkEventHandler("vrr.clearWeapons", clearLocalPlayerWeapons); + addNetworkEventHandler("vrr.giveWeapon", giveLocalPlayerWeapon); + addNetworkEventHandler("vrr.position", setLocalPlayerPosition); + addNetworkEventHandler("vrr.heading", setLocalPlayerHeading); + addNetworkEventHandler("vrr.interior", setLocalPlayerInterior); + addNetworkEventHandler("vrr.minuteDuration", setMinuteDuration); + addNetworkEventHandler("vrr.showJobRouteLocation", showJobRouteLocation); + addNetworkEventHandler("vrr.hideJobRouteLocation", hideJobRouteLocation); + addNetworkEventHandler("vrr.snow", setSnowState); + addNetworkEventHandler("vrr.health", setLocalPlayerHealth); + addNetworkEventHandler("vrr.enterPropertyKey", setEnterPropertyKey); + addNetworkEventHandler("vrr.skinSelect", toggleSkinSelect); + addNetworkEventHandler("vrr.hotbar", updatePlayerHotBar); + addNetworkEventHandler("vrr.pedSpeech", playPedSpeech); + addNetworkEventHandler("vrr.clearPedState", clearLocalPedState); + addNetworkEventHandler("vrr.drunkEffect", setLocalPlayerDrunkEffect); + addNetworkEventHandler("vrr.showItemActionDelay", showItemActionDelay); + addNetworkEventHandler("vrr.set2DRendering", setPlayer2DRendering); + addNetworkEventHandler("vrr.mouseCursor", toggleMouseCursor); + addNetworkEventHandler("vrr.mouseCamera", toggleMouseCamera); + addNetworkEventHandler("vrr.mouseCameraForce", setMouseCameraState); + addNetworkEventHandler("vrr.weaponDamageEnabled", setPlayerWeaponDamageEnabled); + addNetworkEventHandler("vrr.weaponDamageEvent", setPlayerWeaponDamageEvent); + addNetworkEventHandler("vrr.spawned", onServerSpawnedPlayer); + addNetworkEventHandler("vrr.money", setLocalPlayerCash); + addNetworkEventHandler("vrr.armour", setLocalPlayerArmour); + addNetworkEventHandler("vrr.wantedLevel", forceLocalPlayerWantedLevel); + addNetworkEventHandler("vrr.delKeyBind", unBindAccountKey); + addNetworkEventHandler("vrr.addKeyBind", bindAccountKey); + addNetworkEventHandler("vrr.clearKeyBinds", clearKeyBinds); + addNetworkEventHandler("vrr.nametag", updatePlayerNameTag); + addNetworkEventHandler("vrr.ping", updatePlayerPing); + addNetworkEventHandler("vrr.m", receiveChatBoxMessageFromServer); + addNetworkEventHandler("vrr.chatScrollLines", setChatScrollLines); + addNetworkEventHandler("vrr.radioStream", playStreamingRadio); + addNetworkEventHandler("vrr.audioFileStream", playAudioFile); + addNetworkEventHandler("vrr.stopRadioStream", stopStreamingRadio); + addNetworkEventHandler("vrr.radioVolume", setStreamingRadioVolume); + addNetworkEventHandler("vrr.veh.lights", setVehicleLights); + addNetworkEventHandler("vrr.veh.engine", setVehicleEngine); + addNetworkEventHandler("vrr.veh.repair", repairVehicle); + addNetworkEventHandler("vrr.pedAnim", makePedPlayAnimation); + addNetworkEventHandler("vrr.pedStopAnim", makePedStopAnimation); + addNetworkEventHandler("vrr.localPlayerSkin", setLocalPlayerSkin); + addNetworkEventHandler("vrr.forcePedAnim", forcePedAnimation); + addNetworkEventHandler("vrr.hideAllGUI", hideAllGUI); + addNetworkEventHandler("vrr.clientInfo", serverRequestedClientInfo); + addNetworkEventHandler("vrr.interiorLights", updateInteriorLightsState); + addNetworkEventHandler("vrr.cutsceneInterior", setCutsceneInterior); + addNetworkEventHandler("vrr.syncElement", forceSyncElementProperties); + addNetworkEventHandler("vrr.elementPosition", setElementPosition); + addNetworkEventHandler("vrr.elementCollisions", setElementCollisionsEnabled); + addNetworkEventHandler("vrr.vehBuyState", setVehiclePurchaseState); + addNetworkEventHandler("vrr.showRegistration", showRegistrationGUI); + addNetworkEventHandler("vrr.showNewCharacter", showNewCharacterGUI); + addNetworkEventHandler("vrr.showLogin", showLoginGUI); + addNetworkEventHandler("vrr.logLevel", setLogLevel); + addNetworkEventHandler("vrr.infiniteRun", setLocalPlayerInfiniteRun); + addNetworkEventHandler("vrr.business", receiveBusinessFromServer); + addNetworkEventHandler("vrr.house", receiveHouseFromServer); + addNetworkEventHandler("vrr.job", receiveJobFromServer); + addNetworkEventHandler("vrr.vehicle", receiveVehicleFromServer); + addNetworkEventHandler("vrr.holdObject", makePedHoldObject); + addNetworkEventHandler("vrr.playerPedId", sendLocalPlayerNetworkIdToServer); + addNetworkEventHandler("vrr.ped", setLocalPlayerPedPartsAndProps); + addNetworkEventHandler("vrr.pedSpeak", makePlayerPedSpeak); } // =========================================================================== function sendResourceReadySignalToServer() { - sendNetworkEventToServer("vrr.clientReady"); + sendNetworkEventToServer("vrr.clientReady"); } // =========================================================================== function sendResourceStartedSignalToServer() { - sendNetworkEventToServer("vrr.clientStarted"); + sendNetworkEventToServer("vrr.clientStarted"); } // =========================================================================== function sendResourceStoppedSignalToServer() { - if(isConnected) { - sendNetworkEventToServer("vrr.clientStopped"); - } + if(isConnected) { + sendNetworkEventToServer("vrr.clientStopped"); + } } // =========================================================================== function setPlayer2DRendering(hudState, labelState, smallGameMessageState, scoreboardState, hotBarState, itemActionDelayState) { - logToConsole(LOG_DEBUG, `[VRR.Main] Updating render states (HUD: ${hudState}, Labels: ${labelState}, Bottom Text: ${smallGameMessageState}, Scoreboard: ${scoreboardState}, HotBar: ${hotBarState}, Item Action Delay: ${itemActionDelayState})`); - renderHUD = hudState; + logToConsole(LOG_DEBUG, `[VRR.Main] Updating render states (HUD: ${hudState}, Labels: ${labelState}, Bottom Text: ${smallGameMessageState}, Scoreboard: ${scoreboardState}, HotBar: ${hotBarState}, Item Action Delay: ${itemActionDelayState})`); + renderHUD = hudState; - if(getGame() == VRR_GAME_GTA_IV) { - natives.displayCash(hudState); - natives.displayAmmo(hudState); - natives.displayHud(hudState); - natives.displayRadar(hudState); - natives.displayAreaName(hudState); - } else { - if(typeof setHUDEnabled != "undefined") { - setHUDEnabled(hudState); - } - } + if(getGame() == VRR_GAME_GTA_IV) { + natives.displayCash(hudState); + natives.displayAmmo(hudState); + natives.displayHud(hudState); + natives.displayRadar(hudState); + natives.displayAreaName(hudState); + } else { + if(typeof setHUDEnabled != "undefined") { + setHUDEnabled(hudState); + } + } - renderLabels = labelState; - renderSmallGameMessage = smallGameMessageState; - renderScoreBoard = scoreboardState; - renderHotBar = hotBarState; - renderItemActionDelay = itemActionDelayState; + renderLabels = labelState; + renderSmallGameMessage = smallGameMessageState; + renderScoreBoard = scoreboardState; + renderHotBar = hotBarState; + renderItemActionDelay = itemActionDelayState; } // =========================================================================== function onServerSpawnedPlayer(state) { - logToConsole(LOG_DEBUG, `[VRR.Main] Setting spawned state to ${state}`); - isSpawned = state; - if(state) { - setUpInitialGame(); - calledDeathEvent = false; - } + logToConsole(LOG_DEBUG, `[VRR.Main] Setting spawned state to ${state}`); + isSpawned = state; + if(state) { + setUpInitialGame(); + calledDeathEvent = false; + } } // =========================================================================== function tellServerPlayerUsedKeyBind(key) { - sendNetworkEventToServer("vrr.useKeyBind", key); + sendNetworkEventToServer("vrr.useKeyBind", key); } // =========================================================================== function tellServerPlayerArrivedAtJobRouteLocation() { - sendNetworkEventToServer("vrr.arrivedAtJobRouteLocation"); + sendNetworkEventToServer("vrr.arrivedAtJobRouteLocation"); } // =========================================================================== function tellServerItemActionDelayComplete() { - sendNetworkEventToServer("vrr.itemActionDelayComplete"); + sendNetworkEventToServer("vrr.itemActionDelayComplete"); } // =========================================================================== function sendServerClientInfo() { - let clientVersion = "0.0.0.0"; - if(typeof CLIENT_VERSION_MAJOR != "undefined") { - clientVersion = `${CLIENT_VERSION_MAJOR}.${CLIENT_VERSION_MINOR}.${CLIENT_VERSION_PATCH}.${CLIENT_VERSION_BUILD}`; - } - sendNetworkEventToServer("vrr.clientInfo", clientVersion, game.width, game.height); + let clientVersion = "0.0.0.0"; + if(typeof CLIENT_VERSION_MAJOR != "undefined") { + clientVersion = `${CLIENT_VERSION_MAJOR}.${CLIENT_VERSION_MINOR}.${CLIENT_VERSION_PATCH}.${CLIENT_VERSION_BUILD}`; + } + sendNetworkEventToServer("vrr.clientInfo", clientVersion, game.width, game.height); } // =========================================================================== function sendServerNewAFKStatus(state) { - sendNetworkEventToServer("vrr.afk", state); + sendNetworkEventToServer("vrr.afk", state); } // =========================================================================== @@ -211,135 +199,144 @@ function anchorBoat(vehicleId) { // =========================================================================== function setEnterPropertyKey(key) { - enterPropertyKey = key; + enterPropertyKey = key; } // =========================================================================== function serverRequestedClientInfo() { - sendServerClientInfo(); + sendServerClientInfo(); } // =========================================================================== function updateInteriorLightsState(state) { - interiorLightsEnabled = state; + interiorLightsEnabled = state; } // =========================================================================== function forceSyncElementProperties(elementId) { - if(getElementFromId(elementId) == null) { - return false; - } + if(getElementFromId(elementId) == null) { + return false; + } - syncElementProperties(getElementFromId(elementId)); + syncElementProperties(getElementFromId(elementId)); } // =========================================================================== function setElementPosition(elementId, position) { - if(getElementFromId(elementId) == null) { - return false; - } + if(getElementFromId(elementId) == null) { + return false; + } - if(!getElementFromId(elementId).isSyncer) { - return false; - } + if(!getElementFromId(elementId).isSyncer) { + return false; + } - getElementFromId(elementId).position = position; + getElementFromId(elementId).position = position; } // =========================================================================== function setElementCollisionsEnabled(elementId, state) { - if(getElementFromId(elementId) == null) { - return false; - } + if(getElementFromId(elementId) == null) { + return false; + } - getElementFromId(elementId).collisionsEnabled = state; + getElementFromId(elementId).collisionsEnabled = state; } // =========================================================================== function setLocalPlayerArmour(armour) { - if(typeof localPlayer.armour != "undefined") { - localPlayer.armour = armour; - } + if(typeof localPlayer.armour != "undefined") { + localPlayer.armour = armour; + } } // =========================================================================== function forceLocalPlayerWantedLevel(wantedLevel) { - forceWantedLevel = toInteger(wantedLevel); + forceWantedLevel = toInteger(wantedLevel); } // =========================================================================== function setLogLevel(level) { - logLevel = level; + logLevel = level; } // =========================================================================== function setLocalPlayerInfiniteRun(state) { - if(localPlayer != null) { - if(getGame() == VRR_GAME_GTA_III || getGame() == VRR_GAME_GTA_VC) { - game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), boolToInt(state)); - } - } + if(localPlayer != null) { + if(getGame() == VRR_GAME_GTA_III || getGame() == VRR_GAME_GTA_VC) { + game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), boolToInt(state)); + } + } } // =========================================================================== function setLocalPlayerSkin(skinId) { - logToConsole(LOG_INFO, skinId); - if(getGame() == VRR_GAME_GTA_IV) { - if(natives.isModelInCdimage(skinId)) { - natives.requestModel(skinId); - natives.loadAllObjectsNow(); - if(natives.hasModelLoaded(skinId)) { - natives.changePlayerModel(natives.getPlayerId(), skinId); - } - } - - //natives.requestModel(skinId); - //natives.changePlayerModel(natives.getPlayerId(), skinId); - - //localPlayer.skin = allowedSkins[skinSelectorIndex][0]; - //localPlayer.modelIndex = allowedSkins[skinSelectorIndex][0]; - } else { - localPlayer.skin = skinId; - } + logToConsole(LOG_INFO, skinId); + if(getGame() == VRR_GAME_GTA_IV) { + if(natives.isModelInCdimage(skinId)) { + natives.requestModel(skinId); + natives.loadAllObjectsNow(); + if(natives.hasModelLoaded(skinId)) { + natives.changePlayerModel(natives.getPlayerId(), skinId); + } + } + } else { + localPlayer.skin = skinId; + } } // =========================================================================== function makePedHoldObject(pedId, modelIndex) { - if(getGame() == VRR_GAME_GTA_IV) { - natives.givePedAmbientObject(natives.getPedFromNetworkId(pedId), getGameConfig().objects[getGame()][modelIndex][1]) - } + if(getGame() == VRR_GAME_GTA_IV) { + natives.givePedAmbientObject(natives.getPedFromNetworkId(pedId), getGameConfig().objects[getGame()][modelIndex][1]) + } } // =========================================================================== function sendLocalPlayerNetworkIdToServer() { - sendNetworkEventToServer("vrr.playerPedId", natives.getNetworkIdFromPed(localPlayer)); + sendNetworkEventToServer("vrr.playerPedId", natives.getNetworkIdFromPed(localPlayer)); } // =========================================================================== function setCutsceneInterior(cutsceneName) { - if(getGame() == VRR_GAME_GTA_IV) { - if(cutsceneName == "") { - natives.clearCutscene(); - } else { - if(natives.isInteriorScene()) { - natives.clearCutscene(); - } - natives.initCutscene(cutsceneName); - } - } + if(getGame() == VRR_GAME_GTA_IV) { + if(cutsceneName == "") { + natives.clearCutscene(); + } else { + if(natives.isInteriorScene()) { + natives.clearCutscene(); + } + natives.initCutscene(cutsceneName); + } + } +} + +// =========================================================================== + +function makePlayerPedSpeak(speechName) { + if(getGame() == VRR_GAME_GTA_IV) { + // if player is in vehicle, allow megaphone (if last arg is "1", it will cancel megaphone echo) + // Only speeches with _MEGAPHONE will have the bullhorn effect + // Afaik it only works on police voices anyway + if(localPlayer.vehicle != null) { + natives.sayAmbientSpeech(localPlayer, speechName, true, false, 0); + } else { + natives.sayAmbientSpeech(localPlayer, speechName, true, false, 1); + } + } } // =========================================================================== \ No newline at end of file diff --git a/scripts/client/skin-select.js b/scripts/client/skin-select.js index abd8cc52..bc0fd1e9 100644 --- a/scripts/client/skin-select.js +++ b/scripts/client/skin-select.js @@ -45,111 +45,111 @@ function loadSkinSelectMessageFontBottom() { function processSkinSelectKeyPress(keyCode) { if(usingSkinSelector) { - if(keyCode == SDLK_PAGEUP) { - if(skinSelectorIndex >= allowedSkins.length-1) { - skinSelectorIndex = 1; - } else { - skinSelectorIndex = skinSelectorIndex + 1; - } - logToConsole(LOG_DEBUG, `Switching to skin ${allowedSkins[skinSelectorIndex][1]} (Index: ${skinSelectorIndex}, Skin: ${allowedSkins[skinSelectorIndex][0]})`); - skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1]; - if(getGame() == VRR_GAME_GTA_IV) { - let skinId = allowedSkins[skinSelectorIndex][0]; - if(natives.isModelInCdimage(skinId)) { - natives.requestModel(skinId); - natives.loadAllObjectsNow(); - if(natives.hasModelLoaded(skinId)) { - natives.changePlayerModel(natives.getPlayerId(), skinId); - } - } - } else { - localPlayer.skin = allowedSkins[skinSelectorIndex][0]; - } - } else if(keyCode == SDLK_PAGEDOWN) { - if(skinSelectorIndex <= 0) { - skinSelectorIndex = allowedSkins.length-1; - } else { - skinSelectorIndex = skinSelectorIndex - 1; - } - logToConsole(LOG_DEBUG, `Switching to skin ${allowedSkins[skinSelectorIndex][1]} (Index: ${skinSelectorIndex}, Skin: ${allowedSkins[skinSelectorIndex][0]})`); - skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1]; - if(getGame() == VRR_GAME_GTA_IV) { - let skinId = allowedSkins[skinSelectorIndex][0]; - if(natives.isModelInCdimage(skinId)) { - natives.requestModel(skinId); - natives.loadAllObjectsNow(); - if(natives.hasModelLoaded(skinId)) { - natives.changePlayerModel(natives.getPlayerId(), skinId); - } - } - } else { - localPlayer.skin = allowedSkins[skinSelectorIndex][0]; - } - } else if(keyCode == SDLK_RETURN) { - sendNetworkEventToServer("vrr.skinSelected", skinSelectorIndex); - toggleSkinSelect(false); - return true; - } else if(keyCode == SDLK_BACKSPACE) { - sendNetworkEventToServer("vrr.skinSelected", -1); - toggleSkinSelect(false); - return true; - } - localPlayer.heading = skinSelectHeading; - } + if(keyCode == SDLK_PAGEUP) { + if(skinSelectorIndex >= allowedSkins.length-1) { + skinSelectorIndex = 1; + } else { + skinSelectorIndex = skinSelectorIndex + 1; + } + logToConsole(LOG_DEBUG, `Switching to skin ${allowedSkins[skinSelectorIndex][1]} (Index: ${skinSelectorIndex}, Skin: ${allowedSkins[skinSelectorIndex][0]})`); + skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1]; + if(getGame() == VRR_GAME_GTA_IV) { + let skinId = allowedSkins[skinSelectorIndex][0]; + if(natives.isModelInCdimage(skinId)) { + natives.requestModel(skinId); + natives.loadAllObjectsNow(); + if(natives.hasModelLoaded(skinId)) { + natives.changePlayerModel(natives.getPlayerId(), skinId); + } + } + } else { + localPlayer.skin = allowedSkins[skinSelectorIndex][0]; + } + } else if(keyCode == SDLK_PAGEDOWN) { + if(skinSelectorIndex <= 0) { + skinSelectorIndex = allowedSkins.length-1; + } else { + skinSelectorIndex = skinSelectorIndex - 1; + } + logToConsole(LOG_DEBUG, `Switching to skin ${allowedSkins[skinSelectorIndex][1]} (Index: ${skinSelectorIndex}, Skin: ${allowedSkins[skinSelectorIndex][0]})`); + skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1]; + if(getGame() == VRR_GAME_GTA_IV) { + let skinId = allowedSkins[skinSelectorIndex][0]; + if(natives.isModelInCdimage(skinId)) { + natives.requestModel(skinId); + natives.loadAllObjectsNow(); + if(natives.hasModelLoaded(skinId)) { + natives.changePlayerModel(natives.getPlayerId(), skinId); + } + } + } else { + localPlayer.skin = allowedSkins[skinSelectorIndex][0]; + } + } else if(keyCode == SDLK_RETURN) { + sendNetworkEventToServer("vrr.skinSelected", skinSelectorIndex); + toggleSkinSelect(false); + return true; + } else if(keyCode == SDLK_BACKSPACE) { + sendNetworkEventToServer("vrr.skinSelected", -1); + toggleSkinSelect(false); + return true; + } + localPlayer.heading = skinSelectHeading; + } } // =========================================================================== function processSkinSelectRendering() { if(usingSkinSelector) { - if(skinSelectMessageFontTop != null && skinSelectMessageFontBottom != null) { - if(skinSelectMessageTextTop != "" && skinSelectMessageTextBottom != "") { - skinSelectMessageFontTop.render(skinSelectMessageTextTop, [0, game.height-100], game.width, 0.5, 0.0, skinSelectMessageFontTop.size, skinSelectMessageColourTop, true, true, false, true); - skinSelectMessageFontBottom.render(skinSelectMessageTextBottom, [0, game.height-65], game.width, 0.5, 0.0, skinSelectMessageFontBottom.size, skinSelectMessageColourBottom, true, true, false, true); - } - } - } + if(skinSelectMessageFontTop != null && skinSelectMessageFontBottom != null) { + if(skinSelectMessageTextTop != "" && skinSelectMessageTextBottom != "") { + skinSelectMessageFontTop.render(skinSelectMessageTextTop, [0, game.height-100], game.width, 0.5, 0.0, skinSelectMessageFontTop.size, skinSelectMessageColourTop, true, true, false, true); + skinSelectMessageFontBottom.render(skinSelectMessageTextBottom, [0, game.height-65], game.width, 0.5, 0.0, skinSelectMessageFontBottom.size, skinSelectMessageColourBottom, true, true, false, true); + } + } + } } // =========================================================================== function toggleSkinSelect(state) { - if(state) { - skinSelectorIndex = getAllowedSkinIndexFromSkin(localPlayer.skin); - if(!skinSelectorIndex) { - skinSelectorIndex = 0; - } + if(state) { + skinSelectorIndex = getAllowedSkinIndexFromSkin(localPlayer.skin); + if(!skinSelectorIndex) { + skinSelectorIndex = 0; + } - usingSkinSelector = true; - skinSelectPosition = localPlayer.position; - skinSelectHeading = localPlayer.heading; + usingSkinSelector = true; + skinSelectPosition = localPlayer.position; + skinSelectHeading = localPlayer.heading; - if(isCustomCameraSupported()) { - let tempPosition = localPlayer.position; - tempPosition.z += 0.5; - let frontCameraPosition = getPosInFrontOfPos(tempPosition, localPlayer.heading, 3); - game.setCameraLookAt(frontCameraPosition, localPlayer.position, true); - } + if(isCustomCameraSupported()) { + let tempPosition = localPlayer.position; + tempPosition.z += 0.5; + let frontCameraPosition = getPosInFrontOfPos(tempPosition, localPlayer.heading, 3); + game.setCameraLookAt(frontCameraPosition, localPlayer.position, true); + } - if(getGame() == VRR_GAME_GTA_IV) { - let skinId = allowedSkins[skinSelectorIndex][0]; - if(natives.isModelInCdimage(skinId)) { - natives.requestModel(skinId); - natives.loadAllObjectsNow(); - if(natives.hasModelLoaded(skinId)) { - natives.changePlayerModel(natives.getPlayerId(), skinId); - } - } - } else { - localPlayer.skin = allowedSkins[skinSelectorIndex][0]; - } - - skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1]; - setLocalPlayerControlState(false, false); - } else { - usingSkinSelector = false; - setLocalPlayerControlState(false, false); - } + if(getGame() == VRR_GAME_GTA_IV) { + let skinId = allowedSkins[skinSelectorIndex][0]; + if(natives.isModelInCdimage(skinId)) { + natives.requestModel(skinId); + natives.loadAllObjectsNow(); + if(natives.hasModelLoaded(skinId)) { + natives.changePlayerModel(natives.getPlayerId(), skinId); + } + } + } else { + localPlayer.skin = allowedSkins[skinSelectorIndex][0]; + } + + skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1]; + setLocalPlayerControlState(false, false); + } else { + usingSkinSelector = false; + setLocalPlayerControlState(false, false); + } } // =========================================================================== \ No newline at end of file diff --git a/scripts/client/startup.js b/scripts/client/startup.js index c0e59f71..e8f4b94f 100644 --- a/scripts/client/startup.js +++ b/scripts/client/startup.js @@ -8,164 +8,165 @@ // =========================================================================== function initClientScripts() { - initGUIScript(); - initNameTagScript(); - initScoreBoardScript(); - initMessagingScript(); - initServerScript(); - initLogoScript(); - initLabelScript(); - initChatBoxScript(); - initAFKScript(); - initKeyBindScript(); - initEventScript(); - initSkinSelectScript(); + initGUIScript(); + initNameTagScript(); + initScoreBoardScript(); + initMessagingScript(); + initServerScript(); + initLogoScript(); + initLabelScript(); + initChatBoxScript(); + initAFKScript(); + initKeyBindScript(); + initEventScript(); + initSkinSelectScript(); } // =========================================================================== function setUpInitialGame() { - if(getGame() == VRR_GAME_GTA_III) { - game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), 0); - game.setGameStat(STAT_PROGRESSMADE, 9999); - game.setGameStat(STAT_TOTALPROGRESSINGAME, 9999); - game.SET_CAR_DENSITY_MULTIPLIER(3.0); - game.SET_PED_DENSITY_MULTIPLIER(3.0); - game.onMission = true; - SetStandardControlsEnabled(true); - return true; - } + if(getGame() == VRR_GAME_GTA_III) { + game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), 0); + game.setGameStat(STAT_PROGRESSMADE, 9999); + game.setGameStat(STAT_TOTALPROGRESSINGAME, 9999); + game.SET_CAR_DENSITY_MULTIPLIER(3.0); + game.SET_PED_DENSITY_MULTIPLIER(3.0); + game.onMission = true; + SetStandardControlsEnabled(true); + return true; + } - if(getGame() == VRR_GAME_GTA_VC) { - game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), 0); - game.setGameStat(STAT_PROGRESSMADE, 9999); - game.setGameStat(STAT_TOTALPROGRESSINGAME, 9999); - game.SET_CAR_DENSITY_MULTIPLIER(3.0); - game.SET_PED_DENSITY_MULTIPLIER(3.0); + if(getGame() == VRR_GAME_GTA_VC) { + game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), 0); + game.setGameStat(STAT_PROGRESSMADE, 9999); + game.setGameStat(STAT_TOTALPROGRESSINGAME, 9999); + game.SET_CAR_DENSITY_MULTIPLIER(3.0); + game.SET_PED_DENSITY_MULTIPLIER(3.0); - game.REQUEST_ANIMATION("bikev"); - game.REQUEST_ANIMATION("bikeh"); - game.REQUEST_ANIMATION("biked"); - game.REQUEST_ANIMATION("knife"); - game.REQUEST_ANIMATION("python"); - game.REQUEST_ANIMATION("shotgun"); - game.REQUEST_ANIMATION("buddy"); - game.REQUEST_ANIMATION("tec"); - game.REQUEST_ANIMATION("uzi"); - game.REQUEST_ANIMATION("rifle"); - game.REQUEST_ANIMATION("m60"); - game.REQUEST_ANIMATION("sniper"); - game.REQUEST_ANIMATION("grenade"); - game.REQUEST_ANIMATION("flame"); - game.REQUEST_ANIMATION("medic"); - game.REQUEST_ANIMATION("sunbathe"); - //game.REQUEST_ANIMATION("playidles"); - game.REQUEST_ANIMATION("riot"); - game.REQUEST_ANIMATION("strip"); - game.REQUEST_ANIMATION("lance"); - game.REQUEST_ANIMATION("skate"); + game.REQUEST_ANIMATION("bikev"); + game.REQUEST_ANIMATION("bikeh"); + game.REQUEST_ANIMATION("biked"); + game.REQUEST_ANIMATION("knife"); + game.REQUEST_ANIMATION("python"); + game.REQUEST_ANIMATION("shotgun"); + game.REQUEST_ANIMATION("buddy"); + game.REQUEST_ANIMATION("tec"); + game.REQUEST_ANIMATION("uzi"); + game.REQUEST_ANIMATION("rifle"); + game.REQUEST_ANIMATION("m60"); + game.REQUEST_ANIMATION("sniper"); + game.REQUEST_ANIMATION("grenade"); + game.REQUEST_ANIMATION("flame"); + game.REQUEST_ANIMATION("medic"); + game.REQUEST_ANIMATION("sunbathe"); + //game.REQUEST_ANIMATION("playidles"); + game.REQUEST_ANIMATION("riot"); + game.REQUEST_ANIMATION("strip"); + game.REQUEST_ANIMATION("lance"); + game.REQUEST_ANIMATION("skate"); - game.LOAD_ALL_MODELS_NOW(); - game.onMission = true; - SetStandardControlsEnabled(true); - return true; - } + game.LOAD_ALL_MODELS_NOW(); + game.onMission = true; + SetStandardControlsEnabled(true); + return true; + } - if(getGame() == VRR_GAME_GTA_SA) { - game.setGameStat(STAT_WEAPONTYPE_PISTOL_SKILL, 400); - game.setGameStat(STAT_WEAPONTYPE_PISTOL_SILENCED_SKILL, 400); - game.setGameStat(STAT_WEAPONTYPE_DESERT_EAGLE_SKILL, 400); - game.setGameStat(STAT_WEAPONTYPE_SHOTGUN_SKILL, 400); - game.setGameStat(STAT_WEAPONTYPE_SAWNOFF_SHOTGUN_SKILL, 400); - game.setGameStat(STAT_WEAPONTYPE_SPAS12_SHOTGUN_SKILL, 400); - game.setGameStat(STAT_WEAPONTYPE_MICRO_UZI_SKILL, 400); - game.setGameStat(STAT_WEAPONTYPE_MP5_SKILL, 400); - game.setGameStat(STAT_WEAPONTYPE_AK47_SKILL, 400); - game.setGameStat(STAT_WEAPONTYPE_M4_SKILL, 400); - game.setGameStat(STAT_DRIVING_SKILL, 9999); - game.setGameStat(STAT_FAT, 9999); - game.setGameStat(STAT_ENERGY, 9999); - game.setGameStat(STAT_CYCLE_SKILL, 9999); - game.setGameStat(STAT_BIKE_SKILL, 9999); - game.setGameStat(STAT_GAMBLING, 9999); - game.setGameStat(STAT_PROGRESS_MADE, 9999); - game.setGameStat(STAT_RESPECT, 0); - game.setGameStat(STAT_RESPECT_TOTAL, 0); - game.setGameStat(STAT_SEX_APPEAL, 0); - game.setGameStat(STAT_STAMINA, 9999); - game.setGameStat(STAT_TOTAL_PROGRESS, 9999); - game.setGameStat(STAT_UNDERWATER_STAMINA, 9999); - game.setGameStat(STAT_BODY_MUSCLE, 9999); + if(getGame() == VRR_GAME_GTA_SA) { + game.setGameStat(STAT_WEAPONTYPE_PISTOL_SKILL, 400); + game.setGameStat(STAT_WEAPONTYPE_PISTOL_SILENCED_SKILL, 400); + game.setGameStat(STAT_WEAPONTYPE_DESERT_EAGLE_SKILL, 400); + game.setGameStat(STAT_WEAPONTYPE_SHOTGUN_SKILL, 400); + game.setGameStat(STAT_WEAPONTYPE_SAWNOFF_SHOTGUN_SKILL, 400); + game.setGameStat(STAT_WEAPONTYPE_SPAS12_SHOTGUN_SKILL, 400); + game.setGameStat(STAT_WEAPONTYPE_MICRO_UZI_SKILL, 400); + game.setGameStat(STAT_WEAPONTYPE_MP5_SKILL, 400); + game.setGameStat(STAT_WEAPONTYPE_AK47_SKILL, 400); + game.setGameStat(STAT_WEAPONTYPE_M4_SKILL, 400); + game.setGameStat(STAT_DRIVING_SKILL, 9999); + game.setGameStat(STAT_FAT, 9999); + game.setGameStat(STAT_ENERGY, 9999); + game.setGameStat(STAT_CYCLE_SKILL, 9999); + game.setGameStat(STAT_BIKE_SKILL, 9999); + game.setGameStat(STAT_GAMBLING, 9999); + game.setGameStat(STAT_PROGRESS_MADE, 9999); + game.setGameStat(STAT_RESPECT, 0); + game.setGameStat(STAT_RESPECT_TOTAL, 0); + game.setGameStat(STAT_SEX_APPEAL, 0); + game.setGameStat(STAT_STAMINA, 9999); + game.setGameStat(STAT_TOTAL_PROGRESS, 9999); + game.setGameStat(STAT_UNDERWATER_STAMINA, 9999); + game.setGameStat(STAT_BODY_MUSCLE, 9999); - game.setDefaultInteriors(false); - game.onMission = true; - return true; - } + game.setDefaultInteriors(false); + game.onMission = true; + return true; + } - if(getGame() == VRR_GAME_GTA_IV) { - natives.allowEmergencyServices(false); - natives.setCreateRandomCops(true); - natives.setMaxWantedLevel(0); - natives.setWantedMultiplier(0.0); - natives.allowPlayerToCarryNonMissionObjects(natives.getPlayerId(), true); - natives.setPlayerTeam(natives.getPlayerId(), 0); - natives.loadAllObjectsNow(); - natives.setCellphoneRanked(false); - natives.setOverrideNoSprintingOnPhoneInMultiplayer(false); - natives.setSyncWeatherAndGameTime(false); - natives.usePlayerColourInsteadOfTeamColour(true); - natives.disablePauseMenu(true); - natives.allowReactionAnims(localPlayer, true); - natives.allowGameToPauseForStreaming(false); - natives.allowStuntJumpsToTrigger(false); - natives.setPickupsFixCars(false); + if(getGame() == VRR_GAME_GTA_IV) { + natives.allowEmergencyServices(false); + natives.setCreateRandomCops(true); + natives.setMaxWantedLevel(0); + natives.setWantedMultiplier(0.0); + natives.allowPlayerToCarryNonMissionObjects(natives.getPlayerId(), true); + natives.setPlayerTeam(natives.getPlayerId(), 0); + natives.loadAllObjectsNow(); + natives.setCellphoneRanked(false); + natives.setOverrideNoSprintingOnPhoneInMultiplayer(false); + natives.setSyncWeatherAndGameTime(false); + natives.usePlayerColourInsteadOfTeamColour(true); + natives.disablePauseMenu(true); + natives.allowReactionAnims(localPlayer, false); + natives.allowGameToPauseForStreaming(false); + natives.allowStuntJumpsToTrigger(false); + natives.setPickupsFixCars(false); + natives.forceFullVoice(localPlayer); - // HUD and Display - //natives.displayCash(false); - //natives.displayAmmo(false); - //natives.displayHud(false); - //natives.displayRadar(false); - //natives.displayAreaName(false); - natives.displayPlayerNames(true); - natives.setPoliceRadarBlips(false); - natives.removeTemporaryRadarBlipsForPickups(); - natives.displayNonMinigameHelpMessages(false); - natives.setDisplayPlayerNameAndIcon(natives.getPlayerId(), true); + // HUD and Display + //natives.displayCash(false); + //natives.displayAmmo(false); + //natives.displayHud(false); + //natives.displayRadar(false); + //natives.displayAreaName(false); + natives.displayPlayerNames(true); + natives.setPoliceRadarBlips(false); + natives.removeTemporaryRadarBlipsForPickups(); + natives.displayNonMinigameHelpMessages(false); + natives.setDisplayPlayerNameAndIcon(natives.getPlayerId(), true); - // Item/Money Dropping - natives.setMoneyCarriedByAllNewPeds(0); - natives.setDeadPedsDropWeapons(false); - natives.setPlayersDropMoneyInNetworkGame(false); + // Item/Money Dropping + natives.setMoneyCarriedByAllNewPeds(0); + natives.setDeadPedsDropWeapons(false); + natives.setPlayersDropMoneyInNetworkGame(false); - // Population - //natives.dontSuppressAnyCarModels(5.0); - //natives.dontSuppressAnyPedModels(5.0); - //natives.forceGenerateParkedCarsTooCloseToOthers(true); - //natives.setParkedCarDensityMultiplier(5.0); - //natives.setRandomCarDensityMultiplier(5.0); - //natives.setPedDensityMultiplier(5.0); - //natives.setCarDensityMultiplier(5.0); - //natives.setScenarioPedDensityMultiplier(5.0, 5.0); - natives.switchRandomTrains(true); - natives.switchRandomBoats(true); - natives.switchAmbientPlanes(true); - natives.switchMadDrivers(false); + // Population + //natives.dontSuppressAnyCarModels(5.0); + //natives.dontSuppressAnyPedModels(5.0); + //natives.forceGenerateParkedCarsTooCloseToOthers(true); + //natives.setParkedCarDensityMultiplier(5.0); + //natives.setRandomCarDensityMultiplier(5.0); + //natives.setPedDensityMultiplier(5.0); + //natives.setCarDensityMultiplier(5.0); + //natives.setScenarioPedDensityMultiplier(5.0, 5.0); + natives.switchRandomTrains(true); + natives.switchRandomBoats(true); + natives.switchAmbientPlanes(true); + natives.switchMadDrivers(false); - // Singleplayer Cellphone - natives.requestScript("spcellphone"); - natives.startNewScript("spcellphone", 0); - //natives.setMessagesWaiting(false); + // Singleplayer Cellphone + natives.requestScript("spcellphone"); + natives.startNewScript("spcellphone", 0); + //natives.setMessagesWaiting(false); - // Animation libraries - natives.requestAnims("DANCING"); - return true; - } + // Animation libraries + natives.requestAnims("DANCING"); + return true; + } - if(getGame() == VRR_GAME_MAFIA_ONE) { - game.mapEnabled = false; - game.setTrafficEnabled(false); - return true; - } + if(getGame() == VRR_GAME_MAFIA_ONE) { + game.mapEnabled = false; + game.setTrafficEnabled(false); + return true; + } } // =========================================================================== diff --git a/scripts/client/sync.js b/scripts/client/sync.js index 34a5e7b3..7a001b37 100644 --- a/scripts/client/sync.js +++ b/scripts/client/sync.js @@ -8,37 +8,37 @@ // =========================================================================== function processSync(event, deltaTime) { - if(localPlayer != null) { - if(!areServerElementsSupported()) { - sendNetworkEventToServer("vrr.plr.pos", (localPlayer.vehicle != null) ? localPlayer.vehicle.position : localPlayer.position); - sendNetworkEventToServer("vrr.plr.rot", (localPlayer.vehicle != null) ? localPlayer.vehicle.heading : localPlayer.heading); + if(localPlayer != null) { + if(!areServerElementsSupported()) { + sendNetworkEventToServer("vrr.plr.pos", (localPlayer.vehicle != null) ? localPlayer.vehicle.position : localPlayer.position); + sendNetworkEventToServer("vrr.plr.rot", (localPlayer.vehicle != null) ? localPlayer.vehicle.heading : localPlayer.heading); - //if(localPlayer.vehicle != null) { - // sendNetworkEventToServer("vrr.veh.pos", getVehicleForNetworkEvent(localPlayer.vehicle), localPlayer.vehicle.position); - // sendNetworkEventToServer("vrr.veh.rot", getVehicleForNetworkEvent(localPlayer.vehicle), localPlayer.vehicle.heading); - //} - } + //if(localPlayer.vehicle != null) { + // sendNetworkEventToServer("vrr.veh.pos", getVehicleForNetworkEvent(localPlayer.vehicle), localPlayer.vehicle.position); + // sendNetworkEventToServer("vrr.veh.rot", getVehicleForNetworkEvent(localPlayer.vehicle), localPlayer.vehicle.heading); + //} + } - if(localPlayer.health <= 0) { - if(!calledDeathEvent) { - logToConsole(LOG_DEBUG, `Local player died`); - localPlayer.clearWeapons(); - calledDeathEvent = true; - sendNetworkEventToServer("vrr.playerDeath"); - } - } + if(localPlayer.health <= 0) { + if(!calledDeathEvent) { + logToConsole(LOG_DEBUG, `Local player died`); + localPlayer.clearWeapons(); + calledDeathEvent = true; + sendNetworkEventToServer("vrr.playerDeath"); + } + } - if(streamingRadioElement) { - streamingRadio.position = getElementPosition(streamingRadioElement); - //streamingRadio.volume = getStreamingRadioVolumeForPosition(streamingRadio.position); - } - } + if(streamingRadioElement) { + streamingRadio.position = getElementPosition(streamingRadioElement); + //streamingRadio.volume = getStreamingRadioVolumeForPosition(streamingRadio.position); + } + } } // =========================================================================== function setVehicleEngine(vehicleId, state) { - getElementFromId(vehicleId).engine = state; + getElementFromId(vehicleId).engine = state; } // =========================================================================== @@ -46,370 +46,370 @@ function setVehicleEngine(vehicleId, state) { function setVehicleLights(vehicleId, state) { - if(getGame() != VRR_GAME_MAFIA_ONE) { - if(!state) { - getElementFromId(vehicleId).lightStatus = 2; - } else { - getElementFromId(vehicleId).lightStatus = 1; - } - } else if(getGame() == VRR_GAME_GTA_IV) { - if(!state) { - natives.forceCarLights(natives.getVehicleFromNetworkId(vehicleId, 0)); - } else { - natives.forceCarLights(natives.getVehicleFromNetworkId(vehicleId, 1)); - } - } else { - if(!state) { - getElementFromId(vehicleId).lights = false; - } else { - getElementFromId(vehicleId).lights = true; - } - } + if(getGame() != VRR_GAME_MAFIA_ONE) { + if(!state) { + getElementFromId(vehicleId).lightStatus = 2; + } else { + getElementFromId(vehicleId).lightStatus = 1; + } + } else if(getGame() == VRR_GAME_GTA_IV) { + if(!state) { + natives.forceCarLights(natives.getVehicleFromNetworkId(vehicleId, 0)); + } else { + natives.forceCarLights(natives.getVehicleFromNetworkId(vehicleId, 1)); + } + } else { + if(!state) { + getElementFromId(vehicleId).lights = false; + } else { + getElementFromId(vehicleId).lights = true; + } + } } // =========================================================================== function repairVehicle(syncId) { - getVehicleFromSyncId(syncId).fix(); + getVehicleFromSyncId(syncId).fix(); } // =========================================================================== function syncVehicleProperties(vehicle) { - if(!areServerElementsSupported()) { - return false; - } + if(!areServerElementsSupported()) { + return false; + } - if(doesEntityDataExist(vehicle, "vrr.lights")) { - let lightStatus = getEntityData(vehicle, "vrr.lights"); - if(!lightStatus) { - vehicle.lightStatus = 2; - } else { - vehicle.lightStatus = 1; - } - } + if(doesEntityDataExist(vehicle, "vrr.lights")) { + let lightStatus = getEntityData(vehicle, "vrr.lights"); + if(!lightStatus) { + vehicle.lightStatus = 2; + } else { + vehicle.lightStatus = 1; + } + } - if(doesEntityDataExist(vehicle, "vrr.invincible")) { - let invincible = getEntityData(vehicle, "vrr.invincible"); - element.setProofs(invincible, invincible, invincible, invincible, invincible); - } + if(doesEntityDataExist(vehicle, "vrr.invincible")) { + let invincible = getEntityData(vehicle, "vrr.invincible"); + element.setProofs(invincible, invincible, invincible, invincible, invincible); + } - if(doesEntityDataExist(vehicle, "vrr.panelStatus")) { - let panelsStatus = getEntityData(vehicle, "vrr.panelStatus"); - for(let i in panelsStatus) { - vehicle.setPanelStatus(i, panelsStatus[i]); - } - } + if(doesEntityDataExist(vehicle, "vrr.panelStatus")) { + let panelsStatus = getEntityData(vehicle, "vrr.panelStatus"); + for(let i in panelsStatus) { + vehicle.setPanelStatus(i, panelsStatus[i]); + } + } - if(doesEntityDataExist(vehicle, "vrr.wheelStatus")) { - let wheelsStatus = getEntityData(vehicle, "vrr.wheelStatus"); - for(let i in wheelsStatus) { - vehicle.setWheelStatus(i, wheelsStatus[i]); - } - } + if(doesEntityDataExist(vehicle, "vrr.wheelStatus")) { + let wheelsStatus = getEntityData(vehicle, "vrr.wheelStatus"); + for(let i in wheelsStatus) { + vehicle.setWheelStatus(i, wheelsStatus[i]); + } + } - if(doesEntityDataExist(vehicle, "vrr.lightStatus")) { - let lightStatus = getEntityData(vehicle, "vrr.lightStatus"); - for(let i in lightStatus) { - vehicle.setLightStatus(i, lightStatus[i]); - } - } + if(doesEntityDataExist(vehicle, "vrr.lightStatus")) { + let lightStatus = getEntityData(vehicle, "vrr.lightStatus"); + for(let i in lightStatus) { + vehicle.setLightStatus(i, lightStatus[i]); + } + } - if(doesEntityDataExist(vehicle, "vrr.suspensionHeight")) { - let suspensionHeight = getEntityData(vehicle, "vrr.suspensionHeight"); - vehicle.setSuspensionHeight(suspensionHeight); - } + if(doesEntityDataExist(vehicle, "vrr.suspensionHeight")) { + let suspensionHeight = getEntityData(vehicle, "vrr.suspensionHeight"); + vehicle.setSuspensionHeight(suspensionHeight); + } - if(getGame() == VRR_GAME_GTA_SA) { - let allUpgrades = getGameConfig().vehicleUpgrades[getGame()]; - for(let i in allUpgrades) { - vehicle.removeUpgrade(i); - } + if(getGame() == VRR_GAME_GTA_SA) { + let allUpgrades = getGameConfig().vehicleUpgrades[getGame()]; + for(let i in allUpgrades) { + vehicle.removeUpgrade(i); + } - if(doesEntityDataExist(vehicle, "vrr.upgrades")) { - let upgrades = getEntityData(vehicle, "vrr.upgrades"); - for(let i in upgrades) { - if(upgrades[i] != 0) { - vehicle.addUpgrade(upgrades[i]); - } - } - } - } + if(doesEntityDataExist(vehicle, "vrr.upgrades")) { + let upgrades = getEntityData(vehicle, "vrr.upgrades"); + for(let i in upgrades) { + if(upgrades[i] != 0) { + vehicle.addUpgrade(upgrades[i]); + } + } + } + } - if(getGame() == VRR_GAME_GTA_SA || getGame() == VRR_GAME_GTA_IV) { - if(doesEntityDataExist(vehicle, "vrr.livery")) { - let livery = getEntityData(vehicle, "vrr.livery"); - if(getGame() == VRR_GAME_GTA_SA) { - vehicle.setPaintJob(livery); - } else if(getGame() == VRR_GAME_GTA_IV) { - vehicle.livery = livery; - } - } - } + if(getGame() == VRR_GAME_GTA_SA || getGame() == VRR_GAME_GTA_IV) { + if(doesEntityDataExist(vehicle, "vrr.livery")) { + let livery = getEntityData(vehicle, "vrr.livery"); + if(getGame() == VRR_GAME_GTA_SA) { + vehicle.setPaintJob(livery); + } else if(getGame() == VRR_GAME_GTA_IV) { + vehicle.livery = livery; + } + } + } } // =========================================================================== function syncCivilianProperties(civilian) { - if(!areServerElementsSupported()) { - return false; - } + if(!areServerElementsSupported()) { + return false; + } - if(getGame() == VRR_GAME_GTA_III) { - if(doesEntityDataExist(civilian, "vrr.scale")) { - let scaleFactor = getEntityData(civilian, "vrr.scale"); - let tempMatrix = civilian.matrix; - tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z)); - let tempPosition = civilian.position; - civilian.matrix = tempMatrix; - tempPosition.z += scaleFactor.z; - civilian.position = tempPosition; - } - } + if(getGame() == VRR_GAME_GTA_III) { + if(doesEntityDataExist(civilian, "vrr.scale")) { + let scaleFactor = getEntityData(civilian, "vrr.scale"); + let tempMatrix = civilian.matrix; + tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z)); + let tempPosition = civilian.position; + civilian.matrix = tempMatrix; + tempPosition.z += scaleFactor.z; + civilian.position = tempPosition; + } + } - if(getGame() == VRR_GAME_GTA_SA) { - if(doesEntityDataExist(civilian, "vrr.fightStyle")) { - let fightStyle = getEntityData(civilian, "vrr.fightStyle"); - civilian.setFightStyle(fightStyle[0], fightStyle[1]); - } - } + if(getGame() == VRR_GAME_GTA_SA) { + if(doesEntityDataExist(civilian, "vrr.fightStyle")) { + let fightStyle = getEntityData(civilian, "vrr.fightStyle"); + civilian.setFightStyle(fightStyle[0], fightStyle[1]); + } + } - if(getGame() == VRR_GAME_GTA_III) { - if(doesEntityDataExist(civilian, "vrr.walkStyle")) { - let walkStyle = getEntityData(civilian, "vrr.walkStyle"); - civilian.walkStyle = walkStyle; - } - } + if(getGame() == VRR_GAME_GTA_III) { + if(doesEntityDataExist(civilian, "vrr.walkStyle")) { + let walkStyle = getEntityData(civilian, "vrr.walkStyle"); + civilian.walkStyle = walkStyle; + } + } - if(getGame() == VRR_GAME_GTA_IV) { - if(doesEntityDataExist(civilian, "vrr.bodyPropHair")) { - let bodyPropHair = getEntityData(civilian, "vrr.bodyPropHair"); - civilian.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]); - } + if(getGame() == VRR_GAME_GTA_IV) { + if(doesEntityDataExist(civilian, "vrr.bodyPropHair")) { + let bodyPropHair = getEntityData(civilian, "vrr.bodyPropHair"); + civilian.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]); + } - if(doesEntityDataExist(civilian, "vrr.bodyPropHead")) { - let bodyPropHead = getEntityData(civilian, "vrr.bodyPropHead"); - civilian.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]); - } + if(doesEntityDataExist(civilian, "vrr.bodyPropHead")) { + let bodyPropHead = getEntityData(civilian, "vrr.bodyPropHead"); + civilian.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]); + } - if(doesEntityDataExist(civilian, "vrr.bodyPropEyes")) { - let bodyPropEyes = getEntityData(civilian, "vrr.bodyPropEyes"); - civilian.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]); - } + if(doesEntityDataExist(civilian, "vrr.bodyPropEyes")) { + let bodyPropEyes = getEntityData(civilian, "vrr.bodyPropEyes"); + civilian.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]); + } - if(doesEntityDataExist(civilian, "vrr.bodyPropLeftHand")) { - let bodyPropLeftHand = getEntityData(civilian, "vrr.bodyPropLeftHand"); - civilian.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]); - } + if(doesEntityDataExist(civilian, "vrr.bodyPropLeftHand")) { + let bodyPropLeftHand = getEntityData(civilian, "vrr.bodyPropLeftHand"); + civilian.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]); + } - if(doesEntityDataExist(civilian, "vrr.bodyPropRightHand")) { - let bodyPropRightHand = getEntityData(civilian, "vrr.bodyPropRightHand"); - civilian.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]); - } + if(doesEntityDataExist(civilian, "vrr.bodyPropRightHand")) { + let bodyPropRightHand = getEntityData(civilian, "vrr.bodyPropRightHand"); + civilian.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]); + } - if(doesEntityDataExist(civilian, "vrr.bodyPropLeftWrist")) { - let bodyPropLeftWrist = getEntityData(civilian, "vrr.bodyPropLeftWrist"); - civilian.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]); - } + if(doesEntityDataExist(civilian, "vrr.bodyPropLeftWrist")) { + let bodyPropLeftWrist = getEntityData(civilian, "vrr.bodyPropLeftWrist"); + civilian.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]); + } - if(doesEntityDataExist(civilian, "vrr.bodyPropRightWrist")) { - let bodyPropRightWrist = getEntityData(civilian, "vrr.bodyPropRightWrist"); - civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]); - } + if(doesEntityDataExist(civilian, "vrr.bodyPropRightWrist")) { + let bodyPropRightWrist = getEntityData(civilian, "vrr.bodyPropRightWrist"); + civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]); + } - if(doesEntityDataExist(civilian, "vrr.bodyPropRightWrist")) { - let bodyPropRightWrist = getEntityData(civilian, "vrr.bodyPropRightWrist"); - civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]); - } + if(doesEntityDataExist(civilian, "vrr.bodyPropRightWrist")) { + let bodyPropRightWrist = getEntityData(civilian, "vrr.bodyPropRightWrist"); + civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]); + } - if(doesEntityDataExist(civilian, "vrr.bodyPropHip")) { - let bodyPropHip = getEntityData(civilian, "vrr.bodyPropHip"); - civilian.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]); - } + if(doesEntityDataExist(civilian, "vrr.bodyPropHip")) { + let bodyPropHip = getEntityData(civilian, "vrr.bodyPropHip"); + civilian.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]); + } - if(doesEntityDataExist(civilian, "vrr.bodyPropLeftFoot")) { - let bodyPropLeftFoot = getEntityData(civilian, "vrr.bodyPropLeftFoot"); - civilian.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]); - } + if(doesEntityDataExist(civilian, "vrr.bodyPropLeftFoot")) { + let bodyPropLeftFoot = getEntityData(civilian, "vrr.bodyPropLeftFoot"); + civilian.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]); + } - if(doesEntityDataExist(civilian, "vrr.bodyPropRightFoot")) { - let bodyPropRightFoot = getEntityData(civilian, "vrr.bodyPropRightFoot"); - civilian.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]); - } - } + if(doesEntityDataExist(civilian, "vrr.bodyPropRightFoot")) { + let bodyPropRightFoot = getEntityData(civilian, "vrr.bodyPropRightFoot"); + civilian.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]); + } + } - if(doesEntityDataExist(civilian, "vrr.anim")) { - let animData = getEntityData(vehicle, "vrr.anim"); - civilian.addAnimation(animData[0], animData[1]); - } + if(doesEntityDataExist(civilian, "vrr.anim")) { + let animData = getEntityData(vehicle, "vrr.anim"); + civilian.addAnimation(animData[0], animData[1]); + } } // =========================================================================== function syncPlayerProperties(player) { - if(!areServerElementsSupported()) { - return false; - } + if(!areServerElementsSupported()) { + return false; + } - if(getGame() == VRR_GAME_GTA_III) { - if(doesEntityDataExist(player, "vrr.scale")) { - let scaleFactor = getEntityData(player, "vrr.scale"); - let tempMatrix = player.matrix; - tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z)); - let tempPosition = player.position; - player.matrix = tempMatrix; - tempPosition.z += scaleFactor.z; - player.position = tempPosition; - } - } + if(getGame() == VRR_GAME_GTA_III) { + if(doesEntityDataExist(player, "vrr.scale")) { + let scaleFactor = getEntityData(player, "vrr.scale"); + let tempMatrix = player.matrix; + tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z)); + let tempPosition = player.position; + player.matrix = tempMatrix; + tempPosition.z += scaleFactor.z; + player.position = tempPosition; + } + } - if(getGame() == VRR_GAME_GTA_SA) { - if(doesEntityDataExist(player, "vrr.fightStyle")) { - let fightStyle = getEntityData(player, "vrr.fightStyle"); - player.setFightStyle(fightStyle[0], fightStyle[1]); - } - } + if(getGame() == VRR_GAME_GTA_SA) { + if(doesEntityDataExist(player, "vrr.fightStyle")) { + let fightStyle = getEntityData(player, "vrr.fightStyle"); + player.setFightStyle(fightStyle[0], fightStyle[1]); + } + } - //if(getGame() == VRR_GAME_GTA_SA) { - // if(doesEntityDataExist(player, "vrr.walkStyle")) { - // let walkStyle = getEntityData(player, "vrr.walkStyle"); - // player.walkStyle = walkStyle; - // } - //} + //if(getGame() == VRR_GAME_GTA_SA) { + // if(doesEntityDataExist(player, "vrr.walkStyle")) { + // let walkStyle = getEntityData(player, "vrr.walkStyle"); + // player.walkStyle = walkStyle; + // } + //} - if(getGame() == VRR_GAME_GTA_IV) { - if(doesEntityDataExist(player, "vrr.bodyPartHair")) { - let bodyPartHead = getEntityData(player, "vrr.bodyPartHair"); - player.changeBodyPart(0, bodyPartHead[0], bodyPartHair[1]); - } + if(getGame() == VRR_GAME_GTA_IV) { + if(doesEntityDataExist(player, "vrr.bodyPartHair")) { + let bodyPartHead = getEntityData(player, "vrr.bodyPartHair"); + player.changeBodyPart(0, bodyPartHead[0], bodyPartHair[1]); + } - if(doesEntityDataExist(player, "vrr.bodyPartHead")) { - let bodyPartHead = getEntityData(player, "vrr.bodyPartHead"); - player.changeBodyPart(1, bodyPartHead[0], bodyPartHead[1]); - } + if(doesEntityDataExist(player, "vrr.bodyPartHead")) { + let bodyPartHead = getEntityData(player, "vrr.bodyPartHead"); + player.changeBodyPart(1, bodyPartHead[0], bodyPartHead[1]); + } - if(doesEntityDataExist(player, "vrr.bodyPartUpper")) { - let bodyPartUpper = getEntityData(player, "vrr.bodyPartUpper"); - player.changeBodyPart(1, bodyPartUpper[0], bodyPartUpper[1]); - } + if(doesEntityDataExist(player, "vrr.bodyPartUpper")) { + let bodyPartUpper = getEntityData(player, "vrr.bodyPartUpper"); + player.changeBodyPart(1, bodyPartUpper[0], bodyPartUpper[1]); + } - if(doesEntityDataExist(player, "vrr.bodyPartLower")) { - let bodyPartLower = getEntityData(player, "vrr.bodyPartLower"); - player.changeBodyPart(1, bodyPartLower[0], bodyPartLower[1]); - } - } + if(doesEntityDataExist(player, "vrr.bodyPartLower")) { + let bodyPartLower = getEntityData(player, "vrr.bodyPartLower"); + player.changeBodyPart(1, bodyPartLower[0], bodyPartLower[1]); + } + } - if(getGame() == VRR_GAME_GTA_IV) { - if(doesEntityDataExist(player, "vrr.bodyPropHair")) { - let bodyPropHair = getEntityData(player, "vrr.bodyPropHair"); - player.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]); - } + if(getGame() == VRR_GAME_GTA_IV) { + if(doesEntityDataExist(player, "vrr.bodyPropHair")) { + let bodyPropHair = getEntityData(player, "vrr.bodyPropHair"); + player.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]); + } - if(doesEntityDataExist(player, "vrr.bodyPropHead")) { - let bodyPropHead = getEntityData(player, "vrr.bodyPropHead"); - player.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]); - } + if(doesEntityDataExist(player, "vrr.bodyPropHead")) { + let bodyPropHead = getEntityData(player, "vrr.bodyPropHead"); + player.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]); + } - if(doesEntityDataExist(player, "vrr.bodyPropEyes")) { - let bodyPropEyes = getEntityData(player, "vrr.bodyPropEyes"); - player.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]); - } + if(doesEntityDataExist(player, "vrr.bodyPropEyes")) { + let bodyPropEyes = getEntityData(player, "vrr.bodyPropEyes"); + player.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]); + } - if(doesEntityDataExist(player, "vrr.bodyPropLeftHand")) { - let bodyPropLeftHand = getEntityData(player, "vrr.bodyPropLeftHand"); - player.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]); - } + if(doesEntityDataExist(player, "vrr.bodyPropLeftHand")) { + let bodyPropLeftHand = getEntityData(player, "vrr.bodyPropLeftHand"); + player.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]); + } - if(doesEntityDataExist(player, "vrr.bodyPropRightHand")) { - let bodyPropRightHand = getEntityData(player, "vrr.bodyPropRightHand"); - player.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]); - } + if(doesEntityDataExist(player, "vrr.bodyPropRightHand")) { + let bodyPropRightHand = getEntityData(player, "vrr.bodyPropRightHand"); + player.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]); + } - if(doesEntityDataExist(player, "vrr.bodyPropLeftWrist")) { - let bodyPropLeftWrist = getEntityData(player, "vrr.bodyPropLeftWrist"); - player.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]); - } + if(doesEntityDataExist(player, "vrr.bodyPropLeftWrist")) { + let bodyPropLeftWrist = getEntityData(player, "vrr.bodyPropLeftWrist"); + player.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]); + } - if(doesEntityDataExist(player, "vrr.bodyPropRightWrist")) { - let bodyPropRightWrist = getEntityData(player, "vrr.bodyPropRightWrist"); - player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]); - } + if(doesEntityDataExist(player, "vrr.bodyPropRightWrist")) { + let bodyPropRightWrist = getEntityData(player, "vrr.bodyPropRightWrist"); + player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]); + } - if(doesEntityDataExist(player, "vrr.bodyPropRightWrist")) { - let bodyPropRightWrist = getEntityData(player, "vrr.bodyPropRightWrist"); - player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]); - } + if(doesEntityDataExist(player, "vrr.bodyPropRightWrist")) { + let bodyPropRightWrist = getEntityData(player, "vrr.bodyPropRightWrist"); + player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]); + } - if(doesEntityDataExist(player, "vrr.bodyPropHip")) { - let bodyPropHip = getEntityData(player, "vrr.bodyPropHip"); - player.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]); - } + if(doesEntityDataExist(player, "vrr.bodyPropHip")) { + let bodyPropHip = getEntityData(player, "vrr.bodyPropHip"); + player.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]); + } - if(doesEntityDataExist(player, "vrr.bodyPropLeftFoot")) { - let bodyPropLeftFoot = getEntityData(player, "vrr.bodyPropLeftFoot"); - player.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]); - } + if(doesEntityDataExist(player, "vrr.bodyPropLeftFoot")) { + let bodyPropLeftFoot = getEntityData(player, "vrr.bodyPropLeftFoot"); + player.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]); + } - if(doesEntityDataExist(player, "vrr.bodyPropRightFoot")) { - let bodyPropRightFoot = getEntityData(player, "vrr.bodyPropRightFoot"); - player.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]); - } - } + if(doesEntityDataExist(player, "vrr.bodyPropRightFoot")) { + let bodyPropRightFoot = getEntityData(player, "vrr.bodyPropRightFoot"); + player.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]); + } + } } // =========================================================================== function syncObjectProperties(object) { - if(!areServerElementsSupported()) { - return false; - } + if(!areServerElementsSupported()) { + return false; + } - if(getGame() == VRR_GAME_GTA_III || getGame() == VRR_GAME_GTA_VC) { - if(doesEntityDataExist(object, "vrr.scale")) { - let scaleFactor = getEntityData(object, "vrr.scale"); - let tempMatrix = object.matrix; - tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z)); - let tempPosition = object.position; - object.matrix = tempMatrix; - tempPosition.z += scaleFactor.z; - object.position = tempPosition; - } - } + if(getGame() == VRR_GAME_GTA_III || getGame() == VRR_GAME_GTA_VC) { + if(doesEntityDataExist(object, "vrr.scale")) { + let scaleFactor = getEntityData(object, "vrr.scale"); + let tempMatrix = object.matrix; + tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z)); + let tempPosition = object.position; + object.matrix = tempMatrix; + tempPosition.z += scaleFactor.z; + object.position = tempPosition; + } + } } // =========================================================================== function syncElementProperties(element) { - if(!areServerElementsSupported()) { - return false; - } + if(!areServerElementsSupported()) { + return false; + } - if(doesEntityDataExist(element, "vrr.interior")) { - if(typeof element.interior != "undefined") { - element.interior = getEntityData(element, "vrr.interior"); - } - } + if(doesEntityDataExist(element, "vrr.interior")) { + if(typeof element.interior != "undefined") { + element.interior = getEntityData(element, "vrr.interior"); + } + } - switch(element.type) { - case ELEMENT_VEHICLE: - syncVehicleProperties(element); - break; + switch(element.type) { + case ELEMENT_VEHICLE: + syncVehicleProperties(element); + break; - case ELEMENT_PED: - syncCivilianProperties(element); - break; + case ELEMENT_PED: + syncCivilianProperties(element); + break; - case ELEMENT_PLAYER: - syncPlayerProperties(element); - break; + case ELEMENT_PLAYER: + syncPlayerProperties(element); + break; - case ELEMENT_OBJECT: - syncObjectProperties(element); - break; + case ELEMENT_OBJECT: + syncObjectProperties(element); + break; - default: - break; - } + default: + break; + } } @@ -417,21 +417,21 @@ function syncElementProperties(element) { // =========================================================================== function receiveHouseFromServer(houseId, entrancePosition, blipModel, pickupModel, hasInterior) { - if(getGame() == VRR_GAME_GTA_IV) { - - } + if(getGame() == VRR_GAME_GTA_IV) { + + } } // =========================================================================== function setLocalPlayerPedPartsAndProps(parts, props) { - for(let i in parts) { - localPlayer.changeBodyPart(parts[i][0], parts[i][1], parts[i][2]); - } + for(let i in parts) { + localPlayer.changeBodyPart(parts[i][0], parts[i][1], parts[i][2]); + } - for(let j in props) { - localPlayer.changeBodyProp(props[j][0], props[j][1]); - } + for(let j in props) { + localPlayer.changeBodyProp(props[j][0], props[j][1]); + } } // =========================================================================== \ No newline at end of file diff --git a/scripts/client/utilities.js b/scripts/client/utilities.js index 82a1276c..a17297d0 100644 --- a/scripts/client/utilities.js +++ b/scripts/client/utilities.js @@ -8,253 +8,253 @@ // =========================================================================== let weaponSlots = [ - false, - [ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11 - ], - [ - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 2, - 2, - 2, - 2, - 2, - 3, - 3, - 4, - 4, - 4, - 5, - 5, - 5, - 5, - 6, - 6, - 8, - 8, - 7, - 7, - 7, - 7, - 9, - -1, - 9, - ], - [ - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 8, - 8, - 8, - -1, - -1, - -1, - 2, - 2, - 2, - 3, - 3, - 3, - 4, - 4, - 5, - 5, - 4, - 6, - 6, - 7, - 7, - 7, - 7, - 8, - 12, - 9, - 9, - 9, - 9, - 9, - 11, - 9, - 9, - 9, - ], + false, + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + [ + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 2, + 2, + 2, + 2, + 2, + 3, + 3, + 4, + 4, + 4, + 5, + 5, + 5, + 5, + 6, + 6, + 8, + 8, + 7, + 7, + 7, + 7, + 9, + -1, + 9, + ], + [ + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 8, + 8, + 8, + -1, + -1, + -1, + 2, + 2, + 2, + 3, + 3, + 3, + 4, + 4, + 5, + 5, + 4, + 6, + 6, + 7, + 7, + 7, + 7, + 8, + 12, + 9, + 9, + 9, + 9, + 9, + 11, + 9, + 9, + 9, + ], ]; function openAllGarages() { - switch(game.game) { - case VRR_GAME_GTA_III: - for(let i=0;i<=26;i++) { - openGarage(i); - game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i); - } - break; + switch(game.game) { + case VRR_GAME_GTA_III: + for(let i=0;i<=26;i++) { + openGarage(i); + game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i); + } + break; - case VRR_GAME_GTA_VC: - for(let i=0;i<=32;i++) { - openGarage(i); - game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i); - } - break; + case VRR_GAME_GTA_VC: + for(let i=0;i<=32;i++) { + openGarage(i); + game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i); + } + break; - case VRR_GAME_GTA_SA: - for(let i=0;i<=44;i++) { - openGarage(i); - } - break; + case VRR_GAME_GTA_SA: + for(let i=0;i<=44;i++) { + openGarage(i); + } + break; - default: - break; - } + default: + break; + } } // =========================================================================== function closeAllGarages() { - switch(game.game) { - case VRR_GAME_GTA_III: - for(let i=0;i<=26;i++) { - closeGarage(i); - game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i); - } - break; + switch(game.game) { + case VRR_GAME_GTA_III: + for(let i=0;i<=26;i++) { + closeGarage(i); + game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i); + } + break; - case VRR_GAME_GTA_VC: - for(let i=0;i<=32;i++) { - closeGarage(i); - game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i); - } - break; + case VRR_GAME_GTA_VC: + for(let i=0;i<=32;i++) { + closeGarage(i); + game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i); + } + break; - case VRR_GAME_GTA_SA: - for(let i=0;i<=44;i++) { - closeGarage(i); - } - break; + case VRR_GAME_GTA_SA: + for(let i=0;i<=44;i++) { + closeGarage(i); + } + break; - default: - break; - } + default: + break; + } } // =========================================================================== function setLocalPlayerFrozenState(state) { - logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting frozen state to ${state}`); - gui.showCursor(state, !state); + logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting frozen state to ${state}`); + gui.showCursor(state, !state); } // =========================================================================== function setLocalPlayerControlState(controlState, cursorState = false) { - logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting control state to ${controlState} (Cursor: ${cursorState})`); - controlsEnabled = controlState; - if(getGame() == VRR_GAME_GTA_III || getGame() == VRR_GAME_GTA_VC) { - game.SET_PLAYER_CONTROL(localClient.index, boolToInt(controlState)); - } + logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting control state to ${controlState} (Cursor: ${cursorState})`); + controlsEnabled = controlState; + if(getGame() == VRR_GAME_GTA_III || getGame() == VRR_GAME_GTA_VC) { + game.SET_PLAYER_CONTROL(localClient.index, boolToInt(controlState)); + } - if(getGame() != VRR_GAME_GTA_IV) { - localPlayer.collisionsEnabled = controlState; - localPlayer.invincible = true; - } + if(getGame() != VRR_GAME_GTA_IV) { + localPlayer.collisionsEnabled = controlState; + localPlayer.invincible = true; + } } // =========================================================================== function fadeLocalCamera(state, time) { - if(isFadeCameraSupported()) { - logToConsole(LOG_DEBUG, `[VRR.Utilities] Fading camera ${(state)?"in":"out"} for ${time} seconds`); + if(isFadeCameraSupported()) { + logToConsole(LOG_DEBUG, `[VRR.Utilities] Fading camera ${(state)?"in":"out"} for ${time} seconds`); - if(isFadeCameraSupported()) { - game.fadeCamera(state, time); - } - } + if(isFadeCameraSupported()) { + game.fadeCamera(state, time); + } + } } // =========================================================================== function removeLocalPlayerFromVehicle() { - localPlayer.removeFromVehicle(); + localPlayer.removeFromVehicle(); } // =========================================================================== function restoreLocalCamera() { - logToConsole(LOG_DEBUG, `[VRR.Utilities] Camera restored`); - if(isCustomCameraSupported()) { - game.restoreCamera(true); - } + logToConsole(LOG_DEBUG, `[VRR.Utilities] Camera restored`); + if(isCustomCameraSupported()) { + game.restoreCamera(true); + } }; // =========================================================================== function clearLocalPlayerOwnedPeds() { - logToConsole(LOG_DEBUG, `[VRR.Utilities] Clearing all self-owned peds ...`); - clearSelfOwnedPeds(); - logToConsole(LOG_DEBUG, `[VRR.Utilities] All self-owned peds cleared`); + logToConsole(LOG_DEBUG, `[VRR.Utilities] Clearing all self-owned peds ...`); + clearSelfOwnedPeds(); + logToConsole(LOG_DEBUG, `[VRR.Utilities] All self-owned peds cleared`); }; // =========================================================================== function setLocalCameraLookAt(cameraPosition, cameraLookAt) { - logToConsole(LOG_DEBUG, `[VRR.Utilities] Set camera to look at [${cameraLookAt.x}, ${cameraLookAt.y}, ${cameraLookAt.z}] from [${cameraPosition.x}, ${cameraPosition.y}, ${cameraPosition.z}]`); - if(isCustomCameraSupported()) { - game.setCameraLookAt(cameraPosition, cameraLookAt, true); - } + logToConsole(LOG_DEBUG, `[VRR.Utilities] Set camera to look at [${cameraLookAt.x}, ${cameraLookAt.y}, ${cameraLookAt.z}] from [${cameraPosition.x}, ${cameraPosition.y}, ${cameraPosition.z}]`); + if(isCustomCameraSupported()) { + game.setCameraLookAt(cameraPosition, cameraLookAt, true); + } } // =========================================================================== function setCityAmbienceState(state, clearElements = false) { - logToConsole(LOG_DEBUG, `[VRR.Utilities] Ambient civilians and traffic ${(state) ? "enabled" : "disabled"}`); - game.setTrafficEnabled(state); + logToConsole(LOG_DEBUG, `[VRR.Utilities] Ambient civilians and traffic ${(state) ? "enabled" : "disabled"}`); + game.setTrafficEnabled(state); - if(getMultiplayerMod() == VRR_MPMOD_GTAC) { - game.setGenerateCarsAroundCamera(state); - if(game.game != VRR_GAME_GTA_SA) { - game.setCiviliansEnabled(state); - } + if(getMultiplayerMod() == VRR_MPMOD_GTAC) { + game.setGenerateCarsAroundCamera(state); + if(game.game != VRR_GAME_GTA_SA) { + game.setCiviliansEnabled(state); + } - if(clearElements) { - clearSelfOwnedPeds(); - clearSelfOwnedVehicles(); - } - } + if(clearElements) { + clearSelfOwnedPeds(); + clearSelfOwnedVehicles(); + } + } } // =========================================================================== @@ -266,8 +266,8 @@ function runClientCode(code, returnTo) { } catch(error) { sendNetworkEventToServer("vrr.runCodeFail", returnTo, code); return false; - } - sendNetworkEventToServer("vrr.runCodeSuccess", returnTo, code, returnValue); + } + sendNetworkEventToServer("vrr.runCodeSuccess", returnTo, code, returnValue); } // =========================================================================== @@ -275,444 +275,446 @@ function runClientCode(code, returnTo) { function enterVehicleAsPassenger() { if(localPlayer.vehicle == null) { let tempVehicle = getClosestVehicle(localPlayer.position); - if(getGame() != VRR_GAME_GTA_IV) { - if(tempVehicle != null) { - localPlayer.enterVehicle(tempVehicle, false); - } - } else { - for(let i = 0 ; i <= natives.getMaximumNumberOfPassengers(tempVehicle); i++) { - if(natives.isCarPassengerSeatFree(tempVehicle, i)) { - natives.taskEnterCarAsPassenger(localPlayer, tempVehicle, i, 10000); - } - } - } + if(getGame() != VRR_GAME_GTA_IV) { + if(tempVehicle != null) { + localPlayer.enterVehicle(tempVehicle, false); + } + } else { + // Disable for now. GTA IV has built-in passenger entry + + //for(let i = 0 ; i <= natives.getMaximumNumberOfPassengers(tempVehicle); i++) { + // if(natives.isCarPassengerSeatFree(tempVehicle, i)) { + // natives.taskEnterCarAsPassenger(localPlayer, tempVehicle, i, 10000); + // } + //} + } } } // =========================================================================== function giveLocalPlayerWeapon(weaponId, ammo, active) { - logToConsole(LOG_DEBUG, `[VRR.Utilities] Giving weapon ${weaponId} with ${ammo} ammo`); - forceWeapon = weaponId; - if(getGame() == VRR_GAME_MAFIA_ONE) { - localPlayer.giveWeapon(weaponId, 0, ammo); - forceWeaponAmmo = 0; - forceWeaponClipAmmo = ammo; - } else { - localPlayer.giveWeapon(weaponId, ammo, active); - if(getGame() < VRR_GAME_GTA_IV) { - forceWeaponAmmo = localPlayer.getWeaponAmmunition(getWeaponSlot(weaponId)); - forceWeaponClipAmmo = localPlayer.getWeaponClipAmmunition(getWeaponSlot(weaponId)); - } else { - forceWeaponAmmo = ammo; - forceWeaponClipAmmo = ammo; - } - } + logToConsole(LOG_DEBUG, `[VRR.Utilities] Giving weapon ${weaponId} with ${ammo} ammo`); + forceWeapon = weaponId; + if(getGame() == VRR_GAME_MAFIA_ONE) { + localPlayer.giveWeapon(weaponId, 0, ammo); + forceWeaponAmmo = 0; + forceWeaponClipAmmo = ammo; + } else { + localPlayer.giveWeapon(weaponId, ammo, active); + if(getGame() < VRR_GAME_GTA_IV) { + forceWeaponAmmo = localPlayer.getWeaponAmmunition(getWeaponSlot(weaponId)); + forceWeaponClipAmmo = localPlayer.getWeaponClipAmmunition(getWeaponSlot(weaponId)); + } else { + forceWeaponAmmo = ammo; + forceWeaponClipAmmo = ammo; + } + } } // =========================================================================== function clearLocalPlayerWeapons() { - logToConsole(LOG_DEBUG, `[VRR.Utilities] Clearing weapons`); - localPlayer.clearWeapons(); - forceWeapon = 0; - forceWeaponAmmo = 0; - forceWeaponClipAmmo = 0; + logToConsole(LOG_DEBUG, `[VRR.Utilities] Clearing weapons`); + localPlayer.clearWeapons(); + forceWeapon = 0; + forceWeaponAmmo = 0; + forceWeaponClipAmmo = 0; } // =========================================================================== function getClosestVehicle(pos) { - return getElementsByType(ELEMENT_VEHICLE).reduce((i, j) => (i.position.distance(pos) < j.position.distance(pos)) ? i : j); + return getElementsByType(ELEMENT_VEHICLE).reduce((i, j) => (i.position.distance(pos) < j.position.distance(pos)) ? i : j); } // =========================================================================== function setLocalPlayerPosition(position) { - logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting position to ${position.x}, ${position.y}, ${position.z}`); - if(typeof localPlayer.velocity != "undefined") { - localPlayer.velocity = toVector3(0.0, 0.0, 0.0); - } + logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting position to ${position.x}, ${position.y}, ${position.z}`); + if(typeof localPlayer.velocity != "undefined") { + localPlayer.velocity = toVector3(0.0, 0.0, 0.0); + } - if(typeof localPlayer.position != "undefined") { - localPlayer.position = position; - } + if(typeof localPlayer.position != "undefined") { + localPlayer.position = position; + } } // =========================================================================== function setLocalPlayerHeading(heading) { - logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting heading to ${heading}`); - if(typeof localPlayer.heading != "undefined") { - localPlayer.heading = heading; - } + logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting heading to ${heading}`); + if(typeof localPlayer.heading != "undefined") { + localPlayer.heading = heading; + } } // =========================================================================== function setLocalPlayerInterior(interior) { - logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting interior to ${interior}`); - if(getMultiplayerMod() == VRR_MPMOD_GTAC) { - if(!isGTAIV()) { - localPlayer.interior = interior; - game.cameraInterior = interior; - } else { - if(getGameConfig().mainWorldInterior != interior) { - let interiorId = natives.getInteriorAtCoords(localPlayer.position); - natives.activateInterior(interiorId, true); - natives.loadAllObjectsNow(); - } - } - } + logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting interior to ${interior}`); + if(getMultiplayerMod() == VRR_MPMOD_GTAC) { + if(!isGTAIV()) { + localPlayer.interior = interior; + game.cameraInterior = interior; + } else { + if(getGameConfig().mainWorldInterior != interior) { + let interiorId = natives.getInteriorAtCoords(localPlayer.position); + natives.activateInterior(interiorId, true); + natives.loadAllObjectsNow(); + } + } + } - //let vehicles = getElementsByType(ELEMENT_VEHICLE); - //for(let i in vehicles) { - // if(getEntityData(vehicles[i], "vrr.interior")) { - // vehicles[i].interior = getEntityData(vehicles[i], "vrr.interior"); - // } - //} + //let vehicles = getElementsByType(ELEMENT_VEHICLE); + //for(let i in vehicles) { + // if(getEntityData(vehicles[i], "vrr.interior")) { + // vehicles[i].interior = getEntityData(vehicles[i], "vrr.interior"); + // } + //} } // =========================================================================== function setSnowState(falling, ground) { - logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting falling snow to ${falling} and ground snow to ${ground}`); - snowing = falling; - if(ground) { - forceSnowing(false); - forceSnowing(ground); - } + logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting falling snow to ${falling} and ground snow to ${ground}`); + snowing = falling; + if(ground) { + forceSnowing(false); + forceSnowing(ground); + } } // =========================================================================== function setLocalPlayerHealth(health) { - localPlayer.health = health; + localPlayer.health = health; } // =========================================================================== function isSnowEnabled() { - return (typeof snowing != "undefined"); + return (typeof snowing != "undefined"); } // =========================================================================== function playPedSpeech(pedName, speechId) { - logToConsole(LOG_DEBUG, `[VRR.Utilities] Making ${pedName}'s ped talk (${speechId})`); - if(getMultiplayerMod() == VRR_MPMOD_GTAC) { - game.SET_CHAR_SAY(int, int); - } + logToConsole(LOG_DEBUG, `[VRR.Utilities] Making ${pedName}'s ped talk (${speechId})`); + if(getMultiplayerMod() == VRR_MPMOD_GTAC) { + game.SET_CHAR_SAY(int, int); + } } // =========================================================================== function clearLocalPedState() { - logToConsole(LOG_DEBUG, `[VRR.Utilities] Clearing local ped state`); - localPlayer.clearObjective(); + logToConsole(LOG_DEBUG, `[VRR.Utilities] Clearing local ped state`); + localPlayer.clearObjective(); } // =========================================================================== function getWeaponSlot(weaponId) { - if(getGame() == VRR_GAME_GTA_IV) { - return false; - } - + if(getGame() == VRR_GAME_GTA_IV) { + return false; + } + return weaponSlots[getGame()][weaponId]; } // =========================================================================== function setLocalPlayerDrunkEffect(amount, duration) { - if(getMultiplayerMod() == VRR_MPMOD_GTAC) { - logToConsole(LOG_DEBUG, `[VRR.Utilities] Drunk effect set to ${amount} for ${duration}ms`); - drunkEffectAmount = 0; - drunkEffectDurationTimer = setInterval(function() { - drunkEffectAmount = drunkEffectAmount; - if(drunkEffectAmount > 0) { - //game.SET_MOTION_BLUR(drunkEffectAmount); - game.SET_PLAYER_DRUNKENNESS(drunkEffectAmount, duration); - } else { - clearInterval(drunkEffectDurationTimer); - drunkEffectDurationTimer = null; - } - }, 1000); - } + if(getMultiplayerMod() == VRR_MPMOD_GTAC) { + logToConsole(LOG_DEBUG, `[VRR.Utilities] Drunk effect set to ${amount} for ${duration}ms`); + drunkEffectAmount = 0; + drunkEffectDurationTimer = setInterval(function() { + drunkEffectAmount = drunkEffectAmount; + if(drunkEffectAmount > 0) { + //game.SET_MOTION_BLUR(drunkEffectAmount); + game.SET_PLAYER_DRUNKENNESS(drunkEffectAmount, duration); + } else { + clearInterval(drunkEffectDurationTimer); + drunkEffectDurationTimer = null; + } + }, 1000); + } } // =========================================================================== function getLocalPlayerVehicleSeat() { - for(let i = 0 ; i <= 4 ; i++) { - if(localPlayer.vehicle.getOccupant(i) == localPlayer) { - return i; - } - } + for(let i = 0 ; i <= 4 ; i++) { + if(localPlayer.vehicle.getOccupant(i) == localPlayer) { + return i; + } + } } // =========================================================================== function clearSelfOwnedPeds() { - logToConsole(LOG_DEBUG, `Clearing self-owned peds`); - getElementsByType(ELEMENT_PED).forEach(function(ped) { - //if(ped.isOwner) { - destroyElement(ped); - //} - }); + logToConsole(LOG_DEBUG, `Clearing self-owned peds`); + getElementsByType(ELEMENT_PED).forEach(function(ped) { + //if(ped.isOwner) { + destroyElement(ped); + //} + }); } // =========================================================================== function clearSelfOwnedVehicles() { - logToConsole(LOG_DEBUG, `Clearing self-owned vehicles`); - getElementsByType(ELEMENT_VEHICLE).forEach(function(vehicle) { - //if(vehicle.isOwner) { - destroyElement(vehicle); - //} - }); + logToConsole(LOG_DEBUG, `Clearing self-owned vehicles`); + getElementsByType(ELEMENT_VEHICLE).forEach(function(vehicle) { + //if(vehicle.isOwner) { + destroyElement(vehicle); + //} + }); } // =========================================================================== function setMouseCameraState(state) { - logToConsole(LOG_DEBUG, `[VRR.Utilities] ${(state)?"Enabled":"Disabled"} mouse camera`); - mouseCameraEnabled = state; - SetStandardControlsEnabled(!mouseCameraEnabled); + logToConsole(LOG_DEBUG, `[VRR.Utilities] ${(state)?"Enabled":"Disabled"} mouse camera`); + mouseCameraEnabled = state; + SetStandardControlsEnabled(!mouseCameraEnabled); } // =========================================================================== function toggleMouseCursor() { - logToConsole(LOG_DEBUG, `[VRR.Utilities] ${(!gui.cursorEnabled)?"Enabled":"Disabled"} mouse cursor`); - gui.showCursor(!gui.cursorEnabled, gui.cursorEnabled); + logToConsole(LOG_DEBUG, `[VRR.Utilities] ${(!gui.cursorEnabled)?"Enabled":"Disabled"} mouse cursor`); + gui.showCursor(!gui.cursorEnabled, gui.cursorEnabled); } // =========================================================================== function toggleMouseCursor() { - logToConsole(LOG_DEBUG, `[VRR.Utilities] ${(!gui.cursorEnabled)?"Enabled":"Disabled"} mouse cursor`); - setMouseCameraState(!mouseCameraEnabled); + logToConsole(LOG_DEBUG, `[VRR.Utilities] ${(!gui.cursorEnabled)?"Enabled":"Disabled"} mouse cursor`); + setMouseCameraState(!mouseCameraEnabled); } // =========================================================================== function setPlayerWeaponDamageEvent(clientName, eventType) { - logToConsole(LOG_DEBUG, `[VRR.Utilities] Set ${clientName} damage event type to ${eventType}`); - weaponDamageEvent[clientName] = eventType; + logToConsole(LOG_DEBUG, `[VRR.Utilities] Set ${clientName} damage event type to ${eventType}`); + weaponDamageEvent[clientName] = eventType; } // =========================================================================== function setPlayerWeaponDamageEnabled(clientName, state) { - logToConsole(LOG_DEBUG, `[VRR.Utilities] ${(state)?"Enabled":"Disabled"} damage from ${clientName}`); - weaponDamageEnabled[clientName] = state; + logToConsole(LOG_DEBUG, `[VRR.Utilities] ${(state)?"Enabled":"Disabled"} damage from ${clientName}`); + weaponDamageEnabled[clientName] = state; } // =========================================================================== function setLocalPlayerCash(amount) { - logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting local player money`); - if(typeof localPlayer.money != "undefined") { - localPlayer.money = toInteger(amount); - } + logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting local player money`); + if(typeof localPlayer.money != "undefined") { + localPlayer.money = toInteger(amount); + } - if(getGame() == VRR_GAME_GTA_IV) { - natives.setMultiplayerHudCash(amount); - } + if(getGame() == VRR_GAME_GTA_IV) { + natives.setMultiplayerHudCash(amount); + } } // =========================================================================== function destroyAutoCreatedPickups() { - if(typeof ELEMENT_PICKUP != "undefined") { - getElementsByType(ELEMENT_PICKUP).forEach(function(pickup) { - if(pickup.isOwner) { - destroyElement(pickup); - } - }); - } + if(typeof ELEMENT_PICKUP != "undefined") { + getElementsByType(ELEMENT_PICKUP).forEach(function(pickup) { + if(pickup.isOwner) { + destroyElement(pickup); + } + }); + } } // =========================================================================== function processLocalPlayerControlState() { - if(localPlayer == null) { - return false; - } + if(localPlayer == null) { + return false; + } - if(isSpawned) { - return false; - } + if(isSpawned) { + return false; + } - if(!controlsEnabled) { - clearLocalPedState(); - } + if(!controlsEnabled) { + clearLocalPedState(); + } } // =========================================================================== function processWantedLevelReset() { - if(localPlayer == null) { - return false; - } + if(localPlayer == null) { + return false; + } - if(!isSpawned) { - return false; - } + if(!isSpawned) { + return false; + } - if(typeof localPlayer.wantedLevel != "undefined") { - localPlayer.wantedLevel = forceWantedLevel; - } + if(typeof localPlayer.wantedLevel != "undefined") { + localPlayer.wantedLevel = forceWantedLevel; + } } // =========================================================================== function processLocalPlayerVehicleControlState() { - if(areServerElementsSupported()) { - if(inVehicle && localPlayer.vehicle != null) { - if(getEntityData(localPlayer.vehicle, "vrr.engine") == false) { - localPlayer.vehicle.engine = false; - } + if(areServerElementsSupported()) { + if(inVehicle && localPlayer.vehicle != null) { + if(getEntityData(localPlayer.vehicle, "vrr.engine") == false) { + localPlayer.vehicle.engine = false; + } - if(!localPlayer.vehicle.engine) { - if(typeof localPlayer.vehicle.velocity != "undefined") { - localPlayer.vehicle.velocity = toVector3(0.0, 0.0, 0.0); - localPlayer.vehicle.turnVelocity = toVector3(0.0, 0.0, 0.0); - } + if(!localPlayer.vehicle.engine) { + if(typeof localPlayer.vehicle.velocity != "undefined") { + localPlayer.vehicle.velocity = toVector3(0.0, 0.0, 0.0); + localPlayer.vehicle.turnVelocity = toVector3(0.0, 0.0, 0.0); + } - if(parkedVehiclePosition) { - localPlayer.vehicle.position = parkedVehiclePosition; - localPlayer.vehicle.heading = parkedVehicleHeading; - } - } else { - if(parkedVehiclePosition) { - parkedVehiclePosition = false; - parkedVehicleHeading = false; - } - } - } - } + if(parkedVehiclePosition) { + localPlayer.vehicle.position = parkedVehiclePosition; + localPlayer.vehicle.heading = parkedVehicleHeading; + } + } else { + if(parkedVehiclePosition) { + parkedVehiclePosition = false; + parkedVehicleHeading = false; + } + } + } + } } // =========================================================================== function processLocalPlayerSphereEntryExitHandling() { - let position = getLocalPlayerPosition(); + let position = getLocalPlayerPosition(); - if(areMarkersSupported()) { - getElementsByType(ELEMENT_MARKER).forEach(function(sphere) { - if(getDistance(position, sphere.position) <= sphere.radius) { - if(!inSphere) { - inSphere = sphere; - triggerEvent("OnLocalPlayerEnterSphere", null, sphere); - } - } else { - if(inSphere) { - inSphere = false; - triggerEvent("OnLocalPlayerExitSphere", null, sphere); - } - } - }); - } + if(areMarkersSupported()) { + getElementsByType(ELEMENT_MARKER).forEach(function(sphere) { + if(getDistance(position, sphere.position) <= sphere.radius) { + if(!inSphere) { + inSphere = sphere; + triggerEvent("OnLocalPlayerEnterSphere", null, sphere); + } + } else { + if(inSphere) { + inSphere = false; + triggerEvent("OnLocalPlayerExitSphere", null, sphere); + } + } + }); + } } // =========================================================================== function processJobRouteSphere() { - if(game.game == VRR_GAME_GTA_SA) { - let position = getLocalPlayerPosition(); - if(jobRouteLocationSphere != null) { - if(getDistance(position, jobRouteLocationSphere.position) <= 2.0) { - enteredJobRouteSphere(); - } - } - } + if(game.game == VRR_GAME_GTA_SA) { + let position = getLocalPlayerPosition(); + if(jobRouteLocationSphere != null) { + if(getDistance(position, jobRouteLocationSphere.position) <= 2.0) { + enteredJobRouteSphere(); + } + } + } } // =========================================================================== function forceLocalPlayerEquippedWeaponItem() { - if(typeof localPlayer.weapon != "undefined") { - if(forceWeapon != 0) { - if(localPlayer.weapon != forceWeapon) { - localPlayer.weapon = forceWeapon; - if(getGame() < VRR_GAME_GTA_IV) { - localPlayer.setWeaponClipAmmunition(getWeaponSlot(forceWeapon), forceWeaponClipAmmo); - localPlayer.setWeaponAmmunition(getWeaponSlot(forceWeapon), forceWeaponAmmo); - } - } else { - if(getGame() < VRR_GAME_GTA_IV) { - forceWeaponClipAmmo = localPlayer.getWeaponClipAmmunition(getWeaponSlot(forceWeapon)); - forceWeaponAmmo = localPlayer.getWeaponAmmunition(getWeaponSlot(forceWeapon)); - } - } - } else { - if(localPlayer.weapon > 0) { - localPlayer.clearWeapons(); - } - } - } + if(typeof localPlayer.weapon != "undefined") { + if(forceWeapon != 0) { + if(localPlayer.weapon != forceWeapon) { + localPlayer.weapon = forceWeapon; + if(getGame() < VRR_GAME_GTA_IV) { + localPlayer.setWeaponClipAmmunition(getWeaponSlot(forceWeapon), forceWeaponClipAmmo); + localPlayer.setWeaponAmmunition(getWeaponSlot(forceWeapon), forceWeaponAmmo); + } + } else { + if(getGame() < VRR_GAME_GTA_IV) { + forceWeaponClipAmmo = localPlayer.getWeaponClipAmmunition(getWeaponSlot(forceWeapon)); + forceWeaponAmmo = localPlayer.getWeaponAmmunition(getWeaponSlot(forceWeapon)); + } + } + } else { + if(localPlayer.weapon > 0) { + localPlayer.clearWeapons(); + } + } + } } // =========================================================================== function getLocalPlayerPosition() { - let position = localPlayer.position; - if(localPlayer.vehicle) { - position = localPlayer.vehicle.position; - } + let position = localPlayer.position; + if(localPlayer.vehicle) { + position = localPlayer.vehicle.position; + } - return position; + return position; } // =========================================================================== function processLocalPlayerVehicleEntryExitHandling() { - if(localPlayer.vehicle) { - if(!inVehicle) { - inVehicle = localPlayer.vehicle; - inVehicleSeat = getLocalPlayerVehicleSeat(); - triggerEvent("OnLocalPlayerEnteredVehicle", inVehicle, inVehicleSeat); - } - } else { - if(inVehicle) { - triggerEvent("OnLocalPlayerExitedVehicle", inVehicle, inVehicleSeat); - inVehicle = false; - inVehicleSeat = false; - } - } + if(localPlayer.vehicle) { + if(!inVehicle) { + inVehicle = localPlayer.vehicle; + inVehicleSeat = getLocalPlayerVehicleSeat(); + triggerEvent("OnLocalPlayerEnteredVehicle", inVehicle, inVehicleSeat); + } + } else { + if(inVehicle) { + triggerEvent("OnLocalPlayerExitedVehicle", inVehicle, inVehicleSeat); + inVehicle = false; + inVehicleSeat = false; + } + } } // =========================================================================== function getVehicleForNetworkEvent(vehicle) { - if(getGame() == VRR_GAME_GTA_IV) { - return natives.getNetworkIdFromVehicle(vehicle); - } - return vehicle; + if(getGame() == VRR_GAME_GTA_IV) { + return natives.getNetworkIdFromVehicle(vehicle); + } + return vehicle; } // =========================================================================== function setMinuteDuration(minuteDuration) { - logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting minute duration to ${minuteDuration}ms`); + logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting minute duration to ${minuteDuration}ms`); - if(isTimeSupported()) { - game.time.minuteDuration = minuteDuration; - } + if(isTimeSupported()) { + game.time.minuteDuration = minuteDuration; + } } // =========================================================================== function getStreamingRadioVolumeForPosition(position) { - return streamingRadioVolume; + return streamingRadioVolume; } // =========================================================================== function getLocalPlayerLookAtPosition() { - if(localPlayer != null) { + if(localPlayer != null) { let centerCameraPos = getWorldFromScreenPosition(toVector3(game.width/2, game.height/2, 0)); return getWorldFromScreenPosition(toVector3(game.width/2, game.height/2, getDistance(centerCameraPos, localPlayer.position)+20)); } @@ -721,11 +723,11 @@ function getLocalPlayerLookAtPosition() { // =========================================================================== function processInteriorLightsRendering() { - if(renderInteriorLights) { - if(!interiorLightsEnabled) { - graphics.drawRectangle(null, toVector2(0.0, 0.0), toVector2(game.width, game.height), interiorLightsColour, interiorLightsColour, interiorLightsColour, interiorLightsColour); - } - } + if(renderInteriorLights) { + if(!interiorLightsEnabled) { + graphics.drawRectangle(null, toVector2(0.0, 0.0), toVector2(game.width, game.height), interiorLightsColour, interiorLightsColour, interiorLightsColour, interiorLightsColour); + } + } } // =========================================================================== @@ -752,80 +754,80 @@ function getPlayerFromParams(params) { // =========================================================================== function processNearbyPickups() { - if(typeof ELEMENT_PICKUP != "undefined") { - let pickups = getElementsByType(ELEMENT_PICKUP); - for(let i in pickups) { - if(getDistance(pickups[i].position, localPlayer.position) < 5) { - //if(pickups[i].interior == localPlayer.interior && pickups[i].dimension == localPlayer.dimension) { - if(currentPickup != pickups[i]) { - currentPickup = pickups[i]; - sendNetworkEventToServer("vrr.pickup", pickups[i].id); - } - //} - } - } - } + if(typeof ELEMENT_PICKUP != "undefined") { + let pickups = getElementsByType(ELEMENT_PICKUP); + for(let i in pickups) { + if(getDistance(pickups[i].position, localPlayer.position) < 5) { + //if(pickups[i].interior == localPlayer.interior && pickups[i].dimension == localPlayer.dimension) { + if(currentPickup != pickups[i]) { + currentPickup = pickups[i]; + sendNetworkEventToServer("vrr.pickup", pickups[i].id); + } + //} + } + } + } } // =========================================================================== function processGameSpecifics() { - if(game.game < VRR_GAME_GTA_IV) { - game.clearMessages(); - } + if(game.game < VRR_GAME_GTA_IV) { + game.clearMessages(); + } - destroyAutoCreatedPickups(); + destroyAutoCreatedPickups(); } // =========================================================================== function processVehiclePurchasing() { - if(vehiclePurchaseState == VRR_VEHBUYSTATE_TESTDRIVE) { - if(inVehicle == false) { - vehiclePurchaseState = VRR_VEHBUYSTATE_EXITVEH; - sendNetworkEventToServer("vrr.vehBuyState", VRR_VEHBUYSTATE_EXITVEH); - return false; - } else { - if(vehiclePurchasing == inVehicle) { - if(getDistance(inVehicle.position, vehiclePurchasePosition) >= 25) { - vehiclePurchaseState = VRR_VEHBUYSTATE_FARENOUGH; - sendNetworkEventToServer("vrr.vehBuyState", VRR_VEHBUYSTATE_FARENOUGH); - } - } else { - vehiclePurchaseState = VRR_VEHBUYSTATE_WRONGVEH; - sendNetworkEventToServer("vrr.vehBuyState", VRR_VEHBUYSTATE_WRONGVEH); - } - } - } + if(vehiclePurchaseState == VRR_VEHBUYSTATE_TESTDRIVE) { + if(inVehicle == false) { + vehiclePurchaseState = VRR_VEHBUYSTATE_EXITVEH; + sendNetworkEventToServer("vrr.vehBuyState", VRR_VEHBUYSTATE_EXITVEH); + return false; + } else { + if(vehiclePurchasing == inVehicle) { + if(getDistance(inVehicle.position, vehiclePurchasePosition) >= 25) { + vehiclePurchaseState = VRR_VEHBUYSTATE_FARENOUGH; + sendNetworkEventToServer("vrr.vehBuyState", VRR_VEHBUYSTATE_FARENOUGH); + } + } else { + vehiclePurchaseState = VRR_VEHBUYSTATE_WRONGVEH; + sendNetworkEventToServer("vrr.vehBuyState", VRR_VEHBUYSTATE_WRONGVEH); + } + } + } } // =========================================================================== function setVehiclePurchaseState(state, vehicleId, position) { - vehiclePurchaseState = state; + vehiclePurchaseState = state; - if(vehicleId != null) { - vehiclePurchasing = getElementFromId(vehicleId); - } else { - vehiclePurchasing = null; - } + if(vehicleId != null) { + vehiclePurchasing = getElementFromId(vehicleId); + } else { + vehiclePurchasing = null; + } - vehiclePurchasePosition = position; + vehiclePurchasePosition = position; } // =========================================================================== function processVehicleFires() { - let vehicles = getElementsByType(ELEMENT_VEHICLE); - for(let i in vehicles) { - if(vehicles[i].isSyncer) { - if(!doesEntityDataExist(vehicles[i], "vrr.fire")) { - triggerNetworkEvent("vrr.vehFire", vehicles[i].id); - } else { - vehicles[i].health = 249; - } - } - } + let vehicles = getElementsByType(ELEMENT_VEHICLE); + for(let i in vehicles) { + if(vehicles[i].isSyncer) { + if(!doesEntityDataExist(vehicles[i], "vrr.fire")) { + triggerNetworkEvent("vrr.vehFire", vehicles[i].id); + } else { + vehicles[i].health = 249; + } + } + } } // =========================================================================== \ No newline at end of file diff --git a/scripts/server/accent.js b/scripts/server/accent.js index 41cea951..30697e45 100644 --- a/scripts/server/accent.js +++ b/scripts/server/accent.js @@ -8,30 +8,30 @@ // =========================================================================== function getPlayerAccentText(client) { - return getPlayerCurrentSubAccount(client).accent; + return getPlayerCurrentSubAccount(client).accent; } // =========================================================================== function setPlayerAccentText(client, text) { - getPlayerCurrentSubAccount(client).accent = text; + getPlayerCurrentSubAccount(client).accent = text; } // =========================================================================== function doesPlayerHaveAccent(client) { - return (getPlayerCurrentSubAccount(client).accent != ""); + return (getPlayerCurrentSubAccount(client).accent != ""); } // =========================================================================== function getPlayerAccentInlineOutput(client) { - let outputText = ""; - if(doesPlayerHaveAccent(client)) { - outputText = `[${getPlayerAccentText(client)}] `; - } + let outputText = ""; + if(doesPlayerHaveAccent(client)) { + outputText = `[${getPlayerAccentText(client)}] `; + } - return outputText; + return outputText; } // =========================================================================== diff --git a/scripts/server/account.js b/scripts/server/account.js index ebead70e..aa125ce1 100644 --- a/scripts/server/account.js +++ b/scripts/server/account.js @@ -581,7 +581,7 @@ function loginSuccess(client) { logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the "not a tester" error message (GUI disabled).`); messagePlayerError(client, getLocaleString(client, "NotATester")); return false; - } + } } } @@ -948,7 +948,7 @@ function checkRegistration(client, password, confirmPassword = "", emailAddress setAccountEmailVerificationCode(getPlayerData(client).accountData, emailVerificationCode); sendEmailVerificationEmail(client, emailVerificationCode); logToConsole(LOG_WARN, `${getPlayerDisplayForConsole(client)} was sent a registration email verification code`); - } + } if(doesServerHaveTesterOnlyEnabled() && !isPlayerATester(client)) { setTimeout(function() { @@ -963,7 +963,7 @@ function checkRegistration(client, password, confirmPassword = "", emailAddress logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the "not a tester" error message (GUI disabled).`); messagePlayerError(client, getLocaleString(client, "NotATester")); return false; - } + } } else { messagePlayerAlert(client, getLocaleString(client, "RegistrationCreateCharReminder")); diff --git a/scripts/server/animation.js b/scripts/server/animation.js index 4c18f00f..86556bb0 100644 --- a/scripts/server/animation.js +++ b/scripts/server/animation.js @@ -21,7 +21,7 @@ function playPlayerAnimationCommand(command, params, client) { } let animationSlot = getAnimationFromParams(getParam(params, " ", 1)); - let animationPositionOffset = 1; + let animationPositionOffset = 1; if(!animationSlot) { messagePlayerError(client, getLocaleString(client, "AnimationNotFound")); @@ -61,7 +61,7 @@ function stopPlayerAnimationCommand(command, params, client) { getPlayerData(client).currentAnimation = -1; getPlayerData(client).currentAnimationPositionOffset = false; getPlayerData(client).currentAnimationPositionReturnTo = false; - getPlayerData(client).animationStart = 0; + getPlayerData(client).animationStart = 0; getPlayerData(client).animationForced = false; setPlayerMouseCameraState(client, false); @@ -88,7 +88,7 @@ function showAnimationListCommand(command, params, client) { * @return {Array} The animation's data (array) */ function getAnimationData(animationSlot, gameId = getServerGame()) { - return getGameConfig().animations[gameId][animationSlot]; + return getGameConfig().animations[gameId][animationSlot]; } // =========================================================================== @@ -100,13 +100,13 @@ function isPlayerInForcedAnimation(client) { // =========================================================================== function makePlayerPlayAnimation(client, animationSlot, offsetPosition = 1) { - getPlayerData(client).currentAnimation = animationSlot; + getPlayerData(client).currentAnimation = animationSlot; getPlayerData(client).currentAnimationPositionOffset = offsetPosition; getPlayerData(client).currentAnimationPositionReturnTo = getPlayerPosition(client); - getPlayerData(client).animationStart = getCurrentUnixTimestamp(); + getPlayerData(client).animationStart = getCurrentUnixTimestamp(); getPlayerData(client).animationForced = false; - makePedPlayAnimation(getPlayerData(client).ped, animationSlot, offsetPosition); + makePedPlayAnimation(getPlayerData(client).ped, animationSlot, offsetPosition); //if(getAnimationData(animationSlot)[9] != VRR_ANIMMOVE_NONE) { // if(getGame() < VRR_GAME_GTA_SA) { @@ -118,10 +118,10 @@ function makePlayerPlayAnimation(client, animationSlot, offsetPosition = 1) { // =========================================================================== function forcePlayerPlayAnimation(client, animationSlot, offsetPosition = 1) { - getPlayerData(client).currentAnimation = animationSlot; + getPlayerData(client).currentAnimation = animationSlot; getPlayerData(client).currentAnimationPositionOffset = offsetPosition; getPlayerData(client).currentAnimationPositionReturnTo = getPlayerPosition(client); - getPlayerData(client).animationStart = getCurrentUnixTimestamp(); + getPlayerData(client).animationStart = getCurrentUnixTimestamp(); getPlayerData(client).animationForced = true; setPlayerControlState(client, false); @@ -137,7 +137,7 @@ function makePlayerStopAnimation(client) { getPlayerData(client).currentAnimation = -1; getPlayerData(client).currentAnimationPositionOffset = false; getPlayerData(client).currentAnimationPositionReturnTo = false; - getPlayerData(client).animationStart = 0; + getPlayerData(client).animationStart = 0; getPlayerData(client).animationForced = false; } diff --git a/scripts/server/anticheat.js b/scripts/server/anticheat.js index 38ff2b63..9cf7fafb 100644 --- a/scripts/server/anticheat.js +++ b/scripts/server/anticheat.js @@ -8,14 +8,14 @@ // =========================================================================== function initAntiCheatScript() { - logToConsole(LOG_DEBUG, "[VRR.AntiCheat]: Initializing anticheat script ..."); + logToConsole(LOG_DEBUG, "[VRR.AntiCheat]: Initializing anticheat script ..."); logToConsole(LOG_DEBUG, "[VRR.AntiCheat]: Anticheat script initialized!"); } // =========================================================================== function clearPlayerStateToEnterExitProperty(client) { - if(getPlayerData(client).pedState != VRR_PEDSTATE_READY) { + if(getPlayerData(client).pedState != VRR_PEDSTATE_READY) { if(getPlayerData(client).pedState == VRR_PEDSTATE_ENTERINGVEHICLE) { sendPlayerClearPedState(client); getPlayerData(client).pedState = VRR_PEDSTATE_READY; diff --git a/scripts/server/ban.js b/scripts/server/ban.js index cfd6154b..fc4db510 100644 --- a/scripts/server/ban.js +++ b/scripts/server/ban.js @@ -10,8 +10,8 @@ // =========================================================================== function initBanScript() { - logToConsole(LOG_INFO, "[VRR.Ban]: Initializing ban script ..."); - logToConsole(LOG_INFO, "[VRR.Ban]: Ban script initialized!"); + logToConsole(LOG_INFO, "[VRR.Ban]: Initializing ban script ..."); + logToConsole(LOG_INFO, "[VRR.Ban]: Ban script initialized!"); } // =========================================================================== @@ -22,22 +22,22 @@ function accountBanCommand(command, params, client) { return false; } - let splitParams = params.split(" "); - let targetClient = getPlayerFromParams(getParam(params, " ", 1)); - let reason = splitParams.slice(1).join(" "); + let splitParams = params.split(" "); + let targetClient = getPlayerFromParams(getParam(params, " ", 1)); + let reason = splitParams.slice(1).join(" "); - if(!targetClient) { - messagePlayerError(client, "That player is not connected!") - return false; - } - - // Prevent banning admins with really high permissions - if(doesPlayerHaveStaffPermission(targetClient, "ManageServer") || doesPlayerHaveStaffPermission(targetClient, "Developer")) { - messagePlayerError(client, getLocaleString(client, "CantBanPlayer")); - return false; + if(!targetClient) { + messagePlayerError(client, "That player is not connected!") + return false; } - logToConsole(LOG_WARN, `[VRR.Ban]: ${getPlayerDisplayForConsole(targetClient)} (${getPlayerData(targetClient).accountData.name}) account was banned by ${getPlayerDisplayForConsole(client)}. Reason: ${reason}`); + // Prevent banning admins with really high permissions + if(doesPlayerHaveStaffPermission(targetClient, "ManageServer") || doesPlayerHaveStaffPermission(targetClient, "Developer")) { + messagePlayerError(client, getLocaleString(client, "CantBanPlayer")); + return false; + } + + logToConsole(LOG_WARN, `[VRR.Ban]: ${getPlayerDisplayForConsole(targetClient)} (${getPlayerData(targetClient).accountData.name}) account was banned by ${getPlayerDisplayForConsole(client)}. Reason: ${reason}`); messageAdminAction(`{ALTCOLOUR}${getPlayerData(targetClient).currentSubAccountData.name} {MAINCOLOUR}has been account banned.`); banAccount(getPlayerData(targetClient).accountData.databaseId, getPlayerData(client).accountData.databaseId, reason); @@ -52,27 +52,27 @@ function subAccountBanCommand(command, params, client, fromDiscord) { return false; } - let splitParams = params.split(" "); - let targetClient = getPlayerFromParams(getParam(params, " ", 1)); - let reason = splitParams.slice(1).join(" "); + let splitParams = params.split(" "); + let targetClient = getPlayerFromParams(getParam(params, " ", 1)); + let reason = splitParams.slice(1).join(" "); - if(!targetClient) { - messagePlayerError(client, "That player is not connected!") - return false; - } + if(!targetClient) { + messagePlayerError(client, "That player is not connected!") + return false; + } // Prevent banning admins with really high permissions if(doesPlayerHaveStaffPermission(targetClient, "ManageServer") || doesPlayerHaveStaffPermission(targetClient, "Developer")) { messagePlayerError(client, getLocaleString(client, "CantBanPlayer")); return false; - } + } - logToConsole(LOG_WARN, `[VRR.Ban]: ${getPlayerDisplayForConsole(targetClient)} (${getPlayerData(targetClient).accountData.name})'s subaccount was banned by ${getPlayerDisplayForConsole(client)}. Reason: ${reason}`); + logToConsole(LOG_WARN, `[VRR.Ban]: ${getPlayerDisplayForConsole(targetClient)} (${getPlayerData(targetClient).accountData.name})'s subaccount was banned by ${getPlayerDisplayForConsole(client)}. Reason: ${reason}`); messageAdminAction(`{ALTCOLOUR}${getPlayerData(targetClient).currentSubAccountData.name} {MAINCOLOUR}has been character banned.`); - banSubAccount(getPlayerData(targetClient).currentSubAccountData.databaseId, getPlayerData(client).accountData.databaseId, reason); + banSubAccount(getPlayerData(targetClient).currentSubAccountData.databaseId, getPlayerData(client).accountData.databaseId, reason); - disconnectPlayer(client); + disconnectPlayer(client); } // =========================================================================== @@ -81,28 +81,28 @@ function ipBanCommand(command, params, client, fromDiscord) { if(areParamsEmpty(params)) { messagePlayerSyntax(client, getCommandSyntaxText(command)); return false; - } + } - let splitParams = params.split(" "); - let targetClient = getPlayerFromParams(getParam(params, " ", 1)); - let reason = splitParams.slice(1).join(" "); + let splitParams = params.split(" "); + let targetClient = getPlayerFromParams(getParam(params, " ", 1)); + let reason = splitParams.slice(1).join(" "); - if(!targetClient) { - messagePlayerError(client, "That player is not connected!") - return false; - } + if(!targetClient) { + messagePlayerError(client, "That player is not connected!") + return false; + } // Prevent banning admins with really high permissions if(doesPlayerHaveStaffPermission(targetClient, "ManageServer") || doesPlayerHaveStaffPermission(targetClient, "Developer")) { messagePlayerError(client, getLocaleString(client, "CantBanPlayer")); return false; - } + } - messageAdminAction(`{ALTCOLOUR}${getPlayerData(targetClient).currentSubAccountData.name} {MAINCOLOUR}has been IP banned.`); - banIPAddress(targetClient.ip, getPlayerData(client).accountData.databaseId, reason); + messageAdminAction(`{ALTCOLOUR}${getPlayerData(targetClient).currentSubAccountData.name} {MAINCOLOUR}has been IP banned.`); + banIPAddress(targetClient.ip, getPlayerData(client).accountData.databaseId, reason); - server.banIP(targetClient.ip); - targetClient.disconnect(); + server.banIP(targetClient.ip); + targetClient.disconnect(); } // =========================================================================== @@ -111,190 +111,189 @@ function subNetBanCommand(command, params, client, fromDiscord) { if(areParamsEmpty(params)) { messagePlayerSyntax(client, getCommandSyntaxText(command)); return false; - } + } - let splitParams = params.split(" "); - let targetClient = getPlayerFromParams(getParam(params, " ", 1)); - let octetAmount = Number(getParam(params, " ", 2)); - let reason = splitParams.slice(2).join(" "); + let splitParams = params.split(" "); + let targetClient = getPlayerFromParams(getParam(params, " ", 1)); + let octetAmount = Number(getParam(params, " ", 2)); + let reason = splitParams.slice(2).join(" "); - if(!targetClient) { - messagePlayerError(client, "That player is not connected!") - return false; - } + if(!targetClient) { + messagePlayerError(client, "That player is not connected!") + return false; + } // Prevent banning admins with really high permissions if(doesPlayerHaveStaffPermission(targetClient, "ManageServer") || doesPlayerHaveStaffPermission(targetClient, "Developer")) { messagePlayerError(client, getLocaleString(client, "CantBanPlayer")); return false; - } + } messageAdminAction(`{ALTCOLOUR}${getPlayerData(targetClient).currentSubAccountData.name} {MAINCOLOUR}has been subnet banned`); banSubNet(targetClient.ip, getSubNet(targetClient.ip, octetAmount), getPlayerData(client).accountData.databaseId, reason); - server.banIP(targetClient.ip); + server.banIP(targetClient.ip); } // =========================================================================== function banAccount(accountId, adminAccountId, reason) { - let dbConnection = connectToDatabase(); - if(dbConnection) { - let safeReason = dbConnection.escapetoString(reason); - let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${VRR_BANTYPE_ACCOUNT}, ${accountId}, ${adminAccountId}, '${safeReason}');`); - freeDatabaseQuery(dbQuery); - dbConnection.close(); - return true; - } + let dbConnection = connectToDatabase(); + if(dbConnection) { + let safeReason = dbConnection.escapetoString(reason); + let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${VRR_BANTYPE_ACCOUNT}, ${accountId}, ${adminAccountId}, '${safeReason}');`); + freeDatabaseQuery(dbQuery); + dbConnection.close(); + return true; + } - return false; + return false; } // =========================================================================== function banSubAccount(subAccountId, adminAccountId, reason) { - let dbConnection = connectToDatabase(); - if(dbConnection) { - let safeReason = dbConnection.escapetoString(reason); - let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${VRR_BANTYPE_SUBACCOUNT}, ${subAccountId}, ${adminAccountId}, '${safeReason}');`); - freeDatabaseQuery(dbQuery); - dbConnection.close(); - return true; - } + let dbConnection = connectToDatabase(); + if(dbConnection) { + let safeReason = dbConnection.escapetoString(reason); + let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${VRR_BANTYPE_SUBACCOUNT}, ${subAccountId}, ${adminAccountId}, '${safeReason}');`); + freeDatabaseQuery(dbQuery); + dbConnection.close(); + return true; + } - return false; + return false; } // =========================================================================== function banIPAddress(ipAddress, adminAccountId, reason) { - let dbConnection = connectToDatabase(); - if(dbConnection) { - let safeReason = dbConnection.escapetoString(reason); - let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${VRR_BANTYPE_IPADDRESS}, INET_ATON(${ipAddress}), ${adminAccountId}, '${safeReason}');`); - freeDatabaseQuery(dbQuery); - dbConnection.close(); - return true; - } + let dbConnection = connectToDatabase(); + if(dbConnection) { + let safeReason = dbConnection.escapetoString(reason); + let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${VRR_BANTYPE_IPADDRESS}, INET_ATON(${ipAddress}), ${adminAccountId}, '${safeReason}');`); + freeDatabaseQuery(dbQuery); + dbConnection.close(); + return true; + } - return false; + return false; } // =========================================================================== function banSubNet(ipAddressStart, ipAddressEnd, adminAccountId, reason) { - let dbConnection = connectToDatabase(); - if(dbConnection) { - let safeReason = dbConnection.escapetoString(reason); - let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_ip_start, ban_ip_end, ban_who_banned, ban_reason) VALUES (${VRR_BANTYPE_SUBNET}, INET_ATON(${ipAddressStart}), INET_ATON(${ipAddressEnd}), ${adminAccountId}, '${safeReason}');`); - freeDatabaseQuery(dbQuery); - dbConnection.close(); - return true; - } + let dbConnection = connectToDatabase(); + if(dbConnection) { + let safeReason = dbConnection.escapetoString(reason); + let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_ip_start, ban_ip_end, ban_who_banned, ban_reason) VALUES (${VRR_BANTYPE_SUBNET}, INET_ATON(${ipAddressStart}), INET_ATON(${ipAddressEnd}), ${adminAccountId}, '${safeReason}');`); + freeDatabaseQuery(dbQuery); + dbConnection.close(); + return true; + } - return false; + return false; } // =========================================================================== function unbanAccount(accountId, adminAccountId) { - let dbConnection = connectToDatabase(); - if(dbConnection) { - let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${VRR_BANTYPE_ACCOUNT} AND ban_detail=${accountId}`); - freeDatabaseQuery(dbQuery); - dbConnection.close(); - return true; - } + let dbConnection = connectToDatabase(); + if(dbConnection) { + let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${VRR_BANTYPE_ACCOUNT} AND ban_detail=${accountId}`); + freeDatabaseQuery(dbQuery); + dbConnection.close(); + return true; + } - return false; + return false; } // =========================================================================== function unbanSubAccount(subAccountId, adminAccountId) { - let dbConnection = connectToDatabase(); - if(dbConnection) { - let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${VRR_BANTYPE_SUBACCOUNT} AND ban_detail=${subAccountId}`); - freeDatabaseQuery(dbQuery); - dbConnection.close(); - return true; - } + let dbConnection = connectToDatabase(); + if(dbConnection) { + let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${VRR_BANTYPE_SUBACCOUNT} AND ban_detail=${subAccountId}`); + freeDatabaseQuery(dbQuery); + dbConnection.close(); + return true; + } - return false; + return false; } // =========================================================================== function unbanIPAddress(ipAddress, adminAccountId) { - let dbConnection = connectToDatabase(); - if(dbConnection) { - let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${VRR_BANTYPE_IPADDRESS} AND ban_detail=INET_ATON(${ipAddress})`); - freeDatabaseQuery(dbQuery); - dbConnection.close(); - return true; - } + let dbConnection = connectToDatabase(); + if(dbConnection) { + let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${VRR_BANTYPE_IPADDRESS} AND ban_detail=INET_ATON(${ipAddress})`); + freeDatabaseQuery(dbQuery); + dbConnection.close(); + return true; + } - return false; + return false; } // =========================================================================== function unbanSubNet(ipAddressStart, ipAddressEnd, adminAccountId) { - let dbConnection = connectToDatabase(); - if(dbConnection) { - let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${VRR_BANTYPE_SUBNET} AND ban_ip_start=INET_ATON(${ipAddressStart}) AND ban_ip_end=INET_ATON(${ipAddressEnd})`); - freeDatabaseQuery(dbQuery); - dbConnection.close(); - return true; - } + let dbConnection = connectToDatabase(); + if(dbConnection) { + let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${VRR_BANTYPE_SUBNET} AND ban_ip_start=INET_ATON(${ipAddressStart}) AND ban_ip_end=INET_ATON(${ipAddressEnd})`); + freeDatabaseQuery(dbQuery); + dbConnection.close(); + return true; + } - return false; + return false; } // =========================================================================== function isAccountBanned(accountId) { - let bans = getServerData().bans; - for(let i in bans) { - if(bans[i].type == VRR_BANTYPE_ACCOUNT) { - if(bans[i].detail == accountId) { - return true; - } - } - } + let bans = getServerData().bans; + for(let i in bans) { + if(bans[i].type == VRR_BANTYPE_ACCOUNT) { + if(bans[i].detail == accountId) { + return true; + } + } + } - return false; + return false; } // =========================================================================== function isSubAccountBanned(subAccountId) { - let bans = getServerData().bans; - for(let i in bans) { - if(bans[i].type == VRR_BANTYPE_SUBACCOUNT) { - if(bans[i].detail == subAccountId) { - return true; - } - } - } + let bans = getServerData().bans; + for(let i in bans) { + if(bans[i].type == VRR_BANTYPE_SUBACCOUNT) { + if(bans[i].detail == subAccountId) { + return true; + } + } + } - return false; + return false; } // =========================================================================== function isIpAddressBanned(ipAddress) { - let bans = getServerData().bans; - for(let i in bans) { - if(bans[i].type == VRR_BANTYPE_IPADDRESS) { - if(bans[i].detail == ipAddress) { - return true; - } - } - } + let bans = getServerData().bans; + for(let i in bans) { + if(bans[i].type == VRR_BANTYPE_IPADDRESS) { + if(bans[i].detail == ipAddress) { + return true; + } + } + } - return false; + return false; } // =========================================================================== - diff --git a/scripts/server/bitflag.js b/scripts/server/bitflag.js index b095c2e8..cf97f612 100644 --- a/scripts/server/bitflag.js +++ b/scripts/server/bitflag.js @@ -311,15 +311,15 @@ function doesPlayerHaveStaffPermission(client, requiredFlags) { } // -1 is automatic override (having -1 for staff flags is basically god mode admin level) - if(staffFlags == getStaffFlagValue("All")) { - return true; - } + if(staffFlags == getStaffFlagValue("All")) { + return true; + } - if(hasBitFlag(staffFlags, requiredFlags)) { - return true; - } + if(hasBitFlag(staffFlags, requiredFlags)) { + return true; + } - return false; + return false; } // =========================================================================== @@ -341,22 +341,22 @@ function doesPlayerHaveClanPermission(client, requiredFlags) { clanFlags = getPlayerCurrentSubAccount(client).clanFlags | getClanRankFlags(getPlayerCurrentSubAccount(client).clanRank); // -1 is automatic override (having -1 for staff flags is basically god mode admin level) - if(clanFlags == getClanFlagValue("All")) { - return true; - } + if(clanFlags == getClanFlagValue("All")) { + return true; + } - if(hasBitFlag(clanFlags, requiredFlags)) { - return true; - } + if(hasBitFlag(clanFlags, requiredFlags)) { + return true; + } - return false; + return false; } // =========================================================================== function getStaffFlagValue(flagName) { - if(flagName == "All") { - return -1; + if(flagName == "All") { + return -1; } if(typeof serverBitFlags.staffFlags[flagName] == "undefined") { @@ -369,8 +369,8 @@ function getStaffFlagValue(flagName) { // =========================================================================== function getClanFlagValue(flagName) { - if(flagName == "All") { - return -1; + if(flagName == "All") { + return -1; } if(typeof getServerBitFlags().clanFlags[flagName] == "undefined") { @@ -383,8 +383,8 @@ function getClanFlagValue(flagName) { // =========================================================================== function getAccountSettingsFlagValue(flagName) { - if(flagName == "All") { - return -1; + if(flagName == "All") { + return -1; } if(typeof serverBitFlags.accountSettingsFlags[flagName] == "undefined") { @@ -397,8 +397,8 @@ function getAccountSettingsFlagValue(flagName) { // =========================================================================== function getModerationFlagValue(flagName) { - if(flagName == "All") { - return -1; + if(flagName == "All") { + return -1; } if(typeof serverBitFlags.moderationFlags[flagName] == "undefined") { @@ -411,8 +411,8 @@ function getModerationFlagValue(flagName) { // =========================================================================== function getServerSettingsFlagValue(flagName) { - if(flagName == "All") { - return -1; + if(flagName == "All") { + return -1; } if(typeof serverBitFlags.serverSettings[flagName] == "undefined") { diff --git a/scripts/server/business.js b/scripts/server/business.js index cfaccd8e..35ca8d37 100644 --- a/scripts/server/business.js +++ b/scripts/server/business.js @@ -1251,9 +1251,9 @@ function saveAllBusinessesToDatabase() { function saveBusinessToDatabase(businessId) { let tempBusinessData = getServerData().businesses[businessId]; - if(!tempBusinessData.needsSaved) { - return false; - } + if(!tempBusinessData.needsSaved) { + return false; + } logToConsole(LOG_DEBUG, `[VRR.Business]: Saving business '${tempBusinessData.name}' to database ...`); let dbConnection = connectToDatabase(); @@ -1344,7 +1344,7 @@ function createAllBusinessBlips() { // =========================================================================== -function createBusinessEntrancePickup(businessId) { +function createBusinessEntrancePickup(businessId) { if(!getServerConfig().createBusinessPickups) { return false; } @@ -1357,7 +1357,7 @@ function createBusinessEntrancePickup(businessId) { } logToConsole(LOG_VERBOSE, `[VRR.Job]: Creating entrance pickup for business ${getBusinessData(businessId).name} (model ${pickupModelId})`); - + if(areServerElementsSupported()) { getBusinessData(businessId).entrancePickup = createGamePickup(pickupModelId, getBusinessData(businessId).entrancePosition, getGameConfig().pickupTypes[getServerGame()].business); setElementOnAllDimensions(getBusinessData(businessId).entrancePickup, false); @@ -1389,7 +1389,7 @@ function createBusinessEntranceBlip(businessId) { } logToConsole(LOG_VERBOSE, `[VRR.Job]: Creating entrance blip for business ${getBusinessData(businessId).name} (model ${blipModelId})`); - + if(areServerElementsSupported()) { getBusinessData(businessId).entranceBlip = createGameBlip(getBusinessData(businessId).entrancePosition, blipModelId, 1, getColourByName("businessBlue")); setElementOnAllDimensions(getBusinessData(businessId).entranceBlip, false); @@ -1417,7 +1417,7 @@ function createBusinessExitPickup(businessId) { } logToConsole(LOG_VERBOSE, `[VRR.Job]: Creating exit pickup for business ${getBusinessData(businessId).name} (model ${pickupModelId})`); - + if(areServerElementsSupported()) { getBusinessData(businessId).exitPickup = createGamePickup(pickupModelId, getBusinessData(businessId).exitPosition, getGameConfig().pickupTypes[getServerGame()].business); setElementDimension(getBusinessData(businessId).exitPickup, getBusinessData(businessId).exitDimension); @@ -2214,17 +2214,17 @@ function getBusinessFromParams(params) { // =========================================================================== function deleteAllBusinessBlips() { - for(let i in getServerData().businesses) { - deleteBusinessBlips(i); - } + for(let i in getServerData().businesses) { + deleteBusinessBlips(i); + } } // =========================================================================== function deleteAllBusinessPickups() { - for(let i in getServerData().businesses) { - deleteBusinessPickups(i); - } + for(let i in getServerData().businesses) { + deleteBusinessPickups(i); + } } // =========================================================================== \ No newline at end of file diff --git a/scripts/server/business/casino.js b/scripts/server/business/casino.js index 7317cf7f..a9cd5d43 100644 --- a/scripts/server/business/casino.js +++ b/scripts/server/business/casino.js @@ -8,60 +8,60 @@ // =========================================================================== let deckCards = [ - DeckCardData("deckCardSpadeAce", VRR_DECKCARD_SUIT_SPADE, 1), - DeckCardData("deckCardSpade2", VRR_DECKCARD_SUIT_SPADE, 2), - DeckCardData("deckCardSpade3", VRR_DECKCARD_SUIT_SPADE, 3), - DeckCardData("deckCardSpade4", VRR_DECKCARD_SUIT_SPADE, 4), - DeckCardData("deckCardSpade5", VRR_DECKCARD_SUIT_SPADE, 5), - DeckCardData("deckCardSpade6", VRR_DECKCARD_SUIT_SPADE, 6), - DeckCardData("deckCardSpade7", VRR_DECKCARD_SUIT_SPADE, 7), - DeckCardData("deckCardSpade8", VRR_DECKCARD_SUIT_SPADE, 8), - DeckCardData("deckCardSpade9", VRR_DECKCARD_SUIT_SPADE, 9), - DeckCardData("deckCardSpade10", VRR_DECKCARD_SUIT_SPADE, 10), - DeckCardData("deckCardSpadeJack", VRR_DECKCARD_SUIT_SPADE, 11), - DeckCardData("deckCardSpadeQueen", VRR_DECKCARD_SUIT_SPADE, 12), - DeckCardData("deckCardSpadeKing", VRR_DECKCARD_SUIT_SPADE, 13), - DeckCardData("deckCardClubAce", VRR_DECKCARD_SUIT_CLUB, 1), - DeckCardData("deckCardClub2", VRR_DECKCARD_SUIT_CLUB, 2), - DeckCardData("deckCardClub3", VRR_DECKCARD_SUIT_CLUB, 3), - DeckCardData("deckCardClub4", VRR_DECKCARD_SUIT_CLUB, 4), - DeckCardData("deckCardClub5", VRR_DECKCARD_SUIT_CLUB, 5), - DeckCardData("deckCardClub6", VRR_DECKCARD_SUIT_CLUB, 6), - DeckCardData("deckCardClub7", VRR_DECKCARD_SUIT_CLUB, 7), - DeckCardData("deckCardClub8", VRR_DECKCARD_SUIT_CLUB, 8), - DeckCardData("deckCardClub9", VRR_DECKCARD_SUIT_CLUB, 9), - DeckCardData("deckCardClub10", VRR_DECKCARD_SUIT_CLUB, 10), - DeckCardData("deckCardClubJack", VRR_DECKCARD_SUIT_CLUB, 11), - DeckCardData("deckCardClubQueen", VRR_DECKCARD_SUIT_CLUB, 12), - DeckCardData("deckCardClubKing", VRR_DECKCARD_SUIT_CLUB, 13), - DeckCardData("deckCardHeartAce", VRR_DECKCARD_SUIT_HEART, 1), - DeckCardData("deckCardHeart2", VRR_DECKCARD_SUIT_HEART, 2), - DeckCardData("deckCardHeart3", VRR_DECKCARD_SUIT_HEART, 3), - DeckCardData("deckCardHeart4", VRR_DECKCARD_SUIT_HEART, 4), - DeckCardData("deckCardHeart5", VRR_DECKCARD_SUIT_HEART, 5), - DeckCardData("deckCardHeart6", VRR_DECKCARD_SUIT_HEART, 6), - DeckCardData("deckCardHeart7", VRR_DECKCARD_SUIT_HEART, 7), - DeckCardData("deckCardHeart8", VRR_DECKCARD_SUIT_HEART, 8), - DeckCardData("deckCardHeart9", VRR_DECKCARD_SUIT_HEART, 9), - DeckCardData("deckCardHeart10", VRR_DECKCARD_SUIT_HEART, 10), - DeckCardData("deckCardHeartJack", VRR_DECKCARD_SUIT_HEART, 11), - DeckCardData("deckCardHeartQueen", VRR_DECKCARD_SUIT_HEART, 12), - DeckCardData("deckCardHeartKing", VRR_DECKCARD_SUIT_HEART, 13), - DeckCardData("deckCardDiamondAce", VRR_DECKCARD_SUIT_DIAMOND, 1), - DeckCardData("deckCardDiamond2", VRR_DECKCARD_SUIT_DIAMOND, 2), - DeckCardData("deckCardDiamond3", VRR_DECKCARD_SUIT_DIAMOND, 3), - DeckCardData("deckCardDiamond4", VRR_DECKCARD_SUIT_DIAMOND, 4), - DeckCardData("deckCardDiamond5", VRR_DECKCARD_SUIT_DIAMOND, 5), - DeckCardData("deckCardDiamond6", VRR_DECKCARD_SUIT_DIAMOND, 6), - DeckCardData("deckCardDiamond7", VRR_DECKCARD_SUIT_DIAMOND, 7), - DeckCardData("deckCardDiamond8", VRR_DECKCARD_SUIT_DIAMOND, 8), - DeckCardData("deckCardDiamond9", VRR_DECKCARD_SUIT_DIAMOND, 9), - DeckCardData( "deckCardDiamond10", VRR_DECKCARD_SUIT_DIAMOND, 10), - DeckCardData("deckCardDiamondJack", VRR_DECKCARD_SUIT_DIAMOND, 11), - DeckCardData("deckCardDiamondQueen", VRR_DECKCARD_SUIT_DIAMOND, 12), - DeckCardData("deckCardDiamondKing", VRR_DECKCARD_SUIT_DIAMOND, 13), + DeckCardData("deckCardSpadeAce", VRR_DECKCARD_SUIT_SPADE, 1), + DeckCardData("deckCardSpade2", VRR_DECKCARD_SUIT_SPADE, 2), + DeckCardData("deckCardSpade3", VRR_DECKCARD_SUIT_SPADE, 3), + DeckCardData("deckCardSpade4", VRR_DECKCARD_SUIT_SPADE, 4), + DeckCardData("deckCardSpade5", VRR_DECKCARD_SUIT_SPADE, 5), + DeckCardData("deckCardSpade6", VRR_DECKCARD_SUIT_SPADE, 6), + DeckCardData("deckCardSpade7", VRR_DECKCARD_SUIT_SPADE, 7), + DeckCardData("deckCardSpade8", VRR_DECKCARD_SUIT_SPADE, 8), + DeckCardData("deckCardSpade9", VRR_DECKCARD_SUIT_SPADE, 9), + DeckCardData("deckCardSpade10", VRR_DECKCARD_SUIT_SPADE, 10), + DeckCardData("deckCardSpadeJack", VRR_DECKCARD_SUIT_SPADE, 11), + DeckCardData("deckCardSpadeQueen", VRR_DECKCARD_SUIT_SPADE, 12), + DeckCardData("deckCardSpadeKing", VRR_DECKCARD_SUIT_SPADE, 13), + DeckCardData("deckCardClubAce", VRR_DECKCARD_SUIT_CLUB, 1), + DeckCardData("deckCardClub2", VRR_DECKCARD_SUIT_CLUB, 2), + DeckCardData("deckCardClub3", VRR_DECKCARD_SUIT_CLUB, 3), + DeckCardData("deckCardClub4", VRR_DECKCARD_SUIT_CLUB, 4), + DeckCardData("deckCardClub5", VRR_DECKCARD_SUIT_CLUB, 5), + DeckCardData("deckCardClub6", VRR_DECKCARD_SUIT_CLUB, 6), + DeckCardData("deckCardClub7", VRR_DECKCARD_SUIT_CLUB, 7), + DeckCardData("deckCardClub8", VRR_DECKCARD_SUIT_CLUB, 8), + DeckCardData("deckCardClub9", VRR_DECKCARD_SUIT_CLUB, 9), + DeckCardData("deckCardClub10", VRR_DECKCARD_SUIT_CLUB, 10), + DeckCardData("deckCardClubJack", VRR_DECKCARD_SUIT_CLUB, 11), + DeckCardData("deckCardClubQueen", VRR_DECKCARD_SUIT_CLUB, 12), + DeckCardData("deckCardClubKing", VRR_DECKCARD_SUIT_CLUB, 13), + DeckCardData("deckCardHeartAce", VRR_DECKCARD_SUIT_HEART, 1), + DeckCardData("deckCardHeart2", VRR_DECKCARD_SUIT_HEART, 2), + DeckCardData("deckCardHeart3", VRR_DECKCARD_SUIT_HEART, 3), + DeckCardData("deckCardHeart4", VRR_DECKCARD_SUIT_HEART, 4), + DeckCardData("deckCardHeart5", VRR_DECKCARD_SUIT_HEART, 5), + DeckCardData("deckCardHeart6", VRR_DECKCARD_SUIT_HEART, 6), + DeckCardData("deckCardHeart7", VRR_DECKCARD_SUIT_HEART, 7), + DeckCardData("deckCardHeart8", VRR_DECKCARD_SUIT_HEART, 8), + DeckCardData("deckCardHeart9", VRR_DECKCARD_SUIT_HEART, 9), + DeckCardData("deckCardHeart10", VRR_DECKCARD_SUIT_HEART, 10), + DeckCardData("deckCardHeartJack", VRR_DECKCARD_SUIT_HEART, 11), + DeckCardData("deckCardHeartQueen", VRR_DECKCARD_SUIT_HEART, 12), + DeckCardData("deckCardHeartKing", VRR_DECKCARD_SUIT_HEART, 13), + DeckCardData("deckCardDiamondAce", VRR_DECKCARD_SUIT_DIAMOND, 1), + DeckCardData("deckCardDiamond2", VRR_DECKCARD_SUIT_DIAMOND, 2), + DeckCardData("deckCardDiamond3", VRR_DECKCARD_SUIT_DIAMOND, 3), + DeckCardData("deckCardDiamond4", VRR_DECKCARD_SUIT_DIAMOND, 4), + DeckCardData("deckCardDiamond5", VRR_DECKCARD_SUIT_DIAMOND, 5), + DeckCardData("deckCardDiamond6", VRR_DECKCARD_SUIT_DIAMOND, 6), + DeckCardData("deckCardDiamond7", VRR_DECKCARD_SUIT_DIAMOND, 7), + DeckCardData("deckCardDiamond8", VRR_DECKCARD_SUIT_DIAMOND, 8), + DeckCardData("deckCardDiamond9", VRR_DECKCARD_SUIT_DIAMOND, 9), + DeckCardData( "deckCardDiamond10", VRR_DECKCARD_SUIT_DIAMOND, 10), + DeckCardData("deckCardDiamondJack", VRR_DECKCARD_SUIT_DIAMOND, 11), + DeckCardData("deckCardDiamondQueen", VRR_DECKCARD_SUIT_DIAMOND, 12), + DeckCardData("deckCardDiamondKing", VRR_DECKCARD_SUIT_DIAMOND, 13), ]; let deckCardBacks = [ -] \ No newline at end of file +]; \ No newline at end of file diff --git a/scripts/server/chat.js b/scripts/server/chat.js index 554dbeaa..171775f9 100644 --- a/scripts/server/chat.js +++ b/scripts/server/chat.js @@ -42,9 +42,9 @@ function processPlayerChat(client, messageText) { } else { messagePlayerNormal(null, `🛡️ (ADMIN) - ${messageText}`); } - - /* - let clients = getClients(); + + /* + let clients = getClients(); for(let i in clients) { let translatedText; translatedText = await translateMessage(messageText, getPlayerData(client).locale, getPlayerData(clients[i]).locale); @@ -52,9 +52,9 @@ function processPlayerChat(client, messageText) { let original = (getPlayerData(client).locale == getPlayerData(clients[i]).locale) ? `` : ` {ALTCOLOUR}(${messageText})`; messagePlayerNormal(clients[i], `💬 ${getCharacterFullName(client)}: [#FFFFFF]${translatedText}${original}`, clients[i], getColourByName("mediumGrey")); } - */ - - //messageDiscordChatChannel(`💬 ${getCharacterFullName(client)}: ${messageText}`); + */ + + //messageDiscordChatChannel(`💬 ${getCharacterFullName(client)}: ${messageText}`); } // =========================================================================== diff --git a/scripts/server/clan.js b/scripts/server/clan.js index 0155dd4d..375cbe6c 100644 --- a/scripts/server/clan.js +++ b/scripts/server/clan.js @@ -948,9 +948,9 @@ function saveClanToDatabase(clanId) { return false; } - if(!tempClanData.needsSaved) { - return false; - } + if(!tempClanData.needsSaved) { + return false; + } let dbConnection = connectToDatabase(); if(dbConnection) { @@ -994,41 +994,41 @@ function saveClanToDatabase(clanId) { function saveClanRankToDatabase(clanId, rankId) { let tempClanRankData = getClanRankData(clanId, rankId); - if(!tempClanRankData.needsSaved) { - return false; - } + if(!tempClanRankData.needsSaved) { + return false; + } let dbConnection = connectToDatabase(); if(dbConnection) { - let safeName = escapeDatabaseString(dbConnection, tempClanRankData.name); - let safeTag = escapeDatabaseString(dbConnection, tempClanRankData.customTag); - //let safeTitle = escapeDatabaseString(dbConnection, tempClanRankData.name); + let safeName = escapeDatabaseString(dbConnection, tempClanRankData.name); + let safeTag = escapeDatabaseString(dbConnection, tempClanRankData.customTag); + //let safeTitle = escapeDatabaseString(dbConnection, tempClanRankData.name); - let data = [ - ["clan_rank_name", safeName], - ["clan_rank_clan", tempClanRankData.clan], - ["clan_rank_custom_tag", safeTag], - //["clan_rank_title", safeTitle], - ["clan_rank_flags", tempClanRankData.flags], - ["clan_rank_level", tempClanRankData.level], - ["clan_rank_enabled", boolToInt(tempClanRankData.enabled)], - ]; + let data = [ + ["clan_rank_name", safeName], + ["clan_rank_clan", tempClanRankData.clan], + ["clan_rank_custom_tag", safeTag], + //["clan_rank_title", safeTitle], + ["clan_rank_flags", tempClanRankData.flags], + ["clan_rank_level", tempClanRankData.level], + ["clan_rank_enabled", boolToInt(tempClanRankData.enabled)], + ]; - let dbQuery = null; - if(tempClanRankData.databaseId == 0) { - let queryString = createDatabaseInsertQuery("clan_rank", data); - dbQuery = queryDatabase(dbConnection, queryString); - getClanRankData(clanId, rankId).databaseId = getDatabaseInsertId(dbConnection); - getClanRankData(clanId, rankId).needsSaved = false; - } else { - let queryString = createDatabaseUpdateQuery("clan_rank", data, `clan_rank_id=${tempClanRankData.databaseId} LIMIT 1`); - dbQuery = queryDatabase(dbConnection, queryString); - getClanRankData(clanId, rankId).needsSaved = false; - } + let dbQuery = null; + if(tempClanRankData.databaseId == 0) { + let queryString = createDatabaseInsertQuery("clan_rank", data); + dbQuery = queryDatabase(dbConnection, queryString); + getClanRankData(clanId, rankId).databaseId = getDatabaseInsertId(dbConnection); + getClanRankData(clanId, rankId).needsSaved = false; + } else { + let queryString = createDatabaseUpdateQuery("clan_rank", data, `clan_rank_id=${tempClanRankData.databaseId} LIMIT 1`); + dbQuery = queryDatabase(dbConnection, queryString); + getClanRankData(clanId, rankId).needsSaved = false; + } - freeDatabaseQuery(dbQuery); - disconnectFromDatabase(dbConnection); - return true; + freeDatabaseQuery(dbQuery); + disconnectFromDatabase(dbConnection); + return true; } return false; diff --git a/scripts/server/class.js b/scripts/server/class.js index 011ceef4..0e2bcba9 100644 --- a/scripts/server/class.js +++ b/scripts/server/class.js @@ -241,7 +241,7 @@ class ClientData { this.enteringVehicle = null; this.customDisconnectReason = ""; - + this.interiorCutscene = ""; } }; @@ -578,7 +578,7 @@ class BusinessData { this.labelHelpType = toInteger(dbAssoc["biz_label_help_type"]); this.streamingRadioStation = toInteger(dbAssoc["biz_radiostation"]); - + } }; }; @@ -1721,7 +1721,7 @@ class JobRouteData { this.pay = toInteger(dbAssoc["job_route_pay"]); this.startMessage = toString(dbAssoc["job_route_start_msg"]); this.finishMessage = toString(dbAssoc["job_route_finish_msg"]); - this.locationArriveMessage = toString(dbAssoc["job_route_loc_arrive_msg"]); + this.locationArriveMessage = toString(dbAssoc["job_route_loc_arrive_msg"]); this.locationNextMessage = toString(dbAssoc["job_route_loc_next_msg"]); this.vehicleColour1 = toInteger(dbAssoc["job_route_veh_colour1"]); this.vehicleColour2 = toInteger(dbAssoc["job_route_veh_colour2"]); @@ -1737,7 +1737,7 @@ class JobRouteLocationData { this.routeId = 0; this.enabled = false; this.index = -1; - this.jobIndex = -1; + this.jobIndex = -1; this.routeIndex = -1; this.needsSaved = false; this.position = toVector3(0.0, 0.0, 0.0); diff --git a/scripts/server/client.js b/scripts/server/client.js index 3ec3f077..9bd36a65 100644 --- a/scripts/server/client.js +++ b/scripts/server/client.js @@ -8,95 +8,95 @@ // =========================================================================== function initClientScript() { - logToConsole(LOG_DEBUG, "[VRR.Client]: Initializing client script ..."); - addAllNetworkHandlers(); - logToConsole(LOG_DEBUG, "[VRR.Client]: Client script initialized!"); + logToConsole(LOG_DEBUG, "[VRR.Client]: Initializing client script ..."); + addAllNetworkHandlers(); + logToConsole(LOG_DEBUG, "[VRR.Client]: Client script initialized!"); } // =========================================================================== function addAllNetworkHandlers() { - logToConsole(LOG_DEBUG, "[VRR.Client]: Adding network handlers ..."); + logToConsole(LOG_DEBUG, "[VRR.Client]: Adding network handlers ..."); - // KeyBind - addNetworkEventHandler("vrr.useKeyBind", playerUsedKeyBind); + // KeyBind + addNetworkEventHandler("vrr.useKeyBind", playerUsedKeyBind); - // GUI - addNetworkEventHandler("vrr.promptAnswerNo", playerPromptAnswerNo); - addNetworkEventHandler("vrr.promptAnswerYes", playerPromptAnswerYes); - addNetworkEventHandler("vrr.toggleGUI", playerToggledGUI); - addNetworkEventHandler("vrr.2fa", checkPlayerTwoFactorAuthentication); + // GUI + addNetworkEventHandler("vrr.promptAnswerNo", playerPromptAnswerNo); + addNetworkEventHandler("vrr.promptAnswerYes", playerPromptAnswerYes); + addNetworkEventHandler("vrr.toggleGUI", playerToggledGUI); + addNetworkEventHandler("vrr.2fa", checkPlayerTwoFactorAuthentication); - // AFK - addNetworkEventHandler("vrr.afk", playerChangeAFKState); + // AFK + addNetworkEventHandler("vrr.afk", playerChangeAFKState); - // Event - addNetworkEventHandler("vrr.pickup", onPlayerNearPickup); - addNetworkEventHandler("vrr.enteredSphere", onPlayerEnteredSphere); - addNetworkEventHandler("vrr.exitedSphere", onPlayerExitedSphere); - addNetworkEventHandler("vrr.playerDeath", onPlayerDeath); - addNetworkEventHandler("vrr.onPlayerEnterVehicle", onPlayerEnteredVehicle); - addNetworkEventHandler("vrr.onPlayerExitVehicle", onPlayerExitedVehicle); + // Event + addNetworkEventHandler("vrr.pickup", onPlayerNearPickup); + addNetworkEventHandler("vrr.enteredSphere", onPlayerEnteredSphere); + addNetworkEventHandler("vrr.exitedSphere", onPlayerExitedSphere); + addNetworkEventHandler("vrr.playerDeath", onPlayerDeath); + addNetworkEventHandler("vrr.onPlayerEnterVehicle", onPlayerEnteredVehicle); + addNetworkEventHandler("vrr.onPlayerExitVehicle", onPlayerExitedVehicle); - // Job - addNetworkEventHandler("vrr.arrivedAtJobRouteLocation", playerArrivedAtJobRouteLocation); + // Job + addNetworkEventHandler("vrr.arrivedAtJobRouteLocation", playerArrivedAtJobRouteLocation); - // Client - addNetworkEventHandler("vrr.clientReady", playerClientReady); - addNetworkEventHandler("vrr.guiReady", playerGUIReady); - addNetworkEventHandler("vrr.clientStarted", playerClientStarted); - addNetworkEventHandler("vrr.clientStopped", playerClientStopped); + // Client + addNetworkEventHandler("vrr.clientReady", playerClientReady); + addNetworkEventHandler("vrr.guiReady", playerGUIReady); + addNetworkEventHandler("vrr.clientStarted", playerClientStarted); + addNetworkEventHandler("vrr.clientStopped", playerClientStopped); - // Account - addNetworkEventHandler("vrr.checkLogin", checkLogin); - addNetworkEventHandler("vrr.checkRegistration", checkRegistration); - addNetworkEventHandler("vrr.checkResetPassword", checkAccountResetPasswordRequest); - addNetworkEventHandler("vrr.checkChangePassword", checkAccountChangePassword); + // Account + addNetworkEventHandler("vrr.checkLogin", checkLogin); + addNetworkEventHandler("vrr.checkRegistration", checkRegistration); + addNetworkEventHandler("vrr.checkResetPassword", checkAccountResetPasswordRequest); + addNetworkEventHandler("vrr.checkChangePassword", checkAccountChangePassword); - // Developer - addNetworkEventHandler("vrr.runCodeSuccess", clientRunCodeSuccess); - addNetworkEventHandler("vrr.runCodeFail", clientRunCodeFail); + // Developer + addNetworkEventHandler("vrr.runCodeSuccess", clientRunCodeSuccess); + addNetworkEventHandler("vrr.runCodeFail", clientRunCodeFail); - // SubAccount - addNetworkEventHandler("vrr.checkNewCharacter", checkNewCharacter); - addNetworkEventHandler("vrr.nextCharacter", checkNextCharacter); - addNetworkEventHandler("vrr.previousCharacter", checkPreviousCharacter); - addNetworkEventHandler("vrr.selectCharacter", selectCharacter); + // SubAccount + addNetworkEventHandler("vrr.checkNewCharacter", checkNewCharacter); + addNetworkEventHandler("vrr.nextCharacter", checkNextCharacter); + addNetworkEventHandler("vrr.previousCharacter", checkPreviousCharacter); + addNetworkEventHandler("vrr.selectCharacter", selectCharacter); - // Item - addNetworkEventHandler("vrr.itemActionDelayComplete", playerItemActionDelayComplete); - addNetworkEventHandler("vrr.weaponDamage", playerDamagedByPlayer); + // Item + addNetworkEventHandler("vrr.itemActionDelayComplete", playerItemActionDelayComplete); + addNetworkEventHandler("vrr.weaponDamage", playerDamagedByPlayer); - // Misc - addNetworkEventHandler("vrr.plr.pos", updatePositionInPlayerData); - addNetworkEventHandler("vrr.plr.rot", updateHeadingInPlayerData); - addNetworkEventHandler("vrr.skinSelected", playerFinishedSkinSelection); - addNetworkEventHandler("vrr.clientInfo", updateConnectionLogOnClientInfoReceive); - addNetworkEventHandler("vrr.vehBuyState", receiveVehiclePurchaseStateUpdateFromClient); - addNetworkEventHandler("vrr.playerPedId", receivePlayerPedNetworkId); + // Misc + addNetworkEventHandler("vrr.plr.pos", updatePositionInPlayerData); + addNetworkEventHandler("vrr.plr.rot", updateHeadingInPlayerData); + addNetworkEventHandler("vrr.skinSelected", playerFinishedSkinSelection); + addNetworkEventHandler("vrr.clientInfo", updateConnectionLogOnClientInfoReceive); + addNetworkEventHandler("vrr.vehBuyState", receiveVehiclePurchaseStateUpdateFromClient); + addNetworkEventHandler("vrr.playerPedId", receivePlayerPedNetworkId); } // =========================================================================== function updatePlayerNameTag(client) { - //logToConsole(LOG_DEBUG, `[VRR.Client] Sending ${getPlayerDisplayForConsole(client)}'s updated nametag to all players`); + //logToConsole(LOG_DEBUG, `[VRR.Client] Sending ${getPlayerDisplayForConsole(client)}'s updated nametag to all players`); sendNetworkEventToPlayer("vrr.nametag", null, getPlayerName(client), getPlayerNameForNameTag(client), getPlayerColour(client), getPlayerData(client).afk, getPlayerPing(client)); } // =========================================================================== function updateAllPlayerNameTags() { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending updated nametags to all players`); - let clients = getClients(); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending updated nametags to all players`); + let clients = getClients(); for(let i in clients) { - updatePlayerNameTag(clients[i]); - } + updatePlayerNameTag(clients[i]); + } } // =========================================================================== function updatePlayerPing(client) { - //logToConsole(LOG_DEBUG, `[VRR.Client] Sending ${getPlayerDisplayForConsole(client)}'s ping to all players`); + //logToConsole(LOG_DEBUG, `[VRR.Client] Sending ${getPlayerDisplayForConsole(client)}'s ping to all players`); sendNetworkEventToPlayer("vrr.ping", null, getPlayerName(client), client.ping); } @@ -114,7 +114,7 @@ function playerClientReady(client) { function playerGUIReady(client) { setEntityData(client, "vrr.guiReady", true, false); - logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)}'s client GUI is initialized and ready!`); + logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)}'s client GUI is initialized and ready!`); } // =========================================================================== @@ -130,37 +130,37 @@ function playerClientStarted(client) { // =========================================================================== function playerClientStopped(client) { - logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)}'s client resources have stopped (possibly error?). Kicking them from the server ...`); + logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)}'s client resources have stopped (possibly error?). Kicking them from the server ...`); client.disconnect(); } // =========================================================================== function showGameMessage(client, text, colour, duration) { - logToConsole(LOG_DEBUG, `[VRR.Client] Showing game message to ${getPlayerDisplayForConsole(client)} (${text}) for ${duration} milliseconds`); - sendNetworkEventToPlayer("vrr.smallGameMessage", client, text, colour, duration); + logToConsole(LOG_DEBUG, `[VRR.Client] Showing game message to ${getPlayerDisplayForConsole(client)} (${text}) for ${duration} milliseconds`); + sendNetworkEventToPlayer("vrr.smallGameMessage", client, text, colour, duration); } // =========================================================================== function enableCityAmbienceForPlayer(client, clearElements = false) { - //if(server.getCVar("civilians") == false) { - // return false; - //} + //if(server.getCVar("civilians") == false) { + // return false; + //} - //logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s city ambience to ${toUpperCase(getOnOffFromBool(false))}`); - //sendNetworkEventToPlayer("vrr.ambience", client, true); + //logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s city ambience to ${toUpperCase(getOnOffFromBool(false))}`); + //sendNetworkEventToPlayer("vrr.ambience", client, true); } // =========================================================================== function disableCityAmbienceForPlayer(client, clearElements = false) { - //if(server.getCVar("civilians") == true) { - // return false; - //} + //if(server.getCVar("civilians") == true) { + // return false; + //} - //logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s city ambience to ${toUpperCase(getOnOffFromBool(false))}`); - //sendNetworkEventToPlayer("vrr.ambience", client, false, clearElements); + //logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s city ambience to ${toUpperCase(getOnOffFromBool(false))}`); + //sendNetworkEventToPlayer("vrr.ambience", client, false, clearElements); } // =========================================================================== @@ -173,30 +173,30 @@ function clearPlayerOwnedPeds(client) { // =========================================================================== function updatePlayerSpawnedState(client, state) { - logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s spawned state ${toUpperCase(getOnOffFromBool(state))}`); - getPlayerData(client).spawned = true; - sendNetworkEventToPlayer("vrr.spawned", client, state); + logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s spawned state ${toUpperCase(getOnOffFromBool(state))}`); + getPlayerData(client).spawned = true; + sendNetworkEventToPlayer("vrr.spawned", client, state); } // =========================================================================== function setPlayerControlState(client, state) { - logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s control state ${toUpperCase(getOnOffFromBool(state))}`); - sendNetworkEventToPlayer("vrr.control", client, state, !state); + logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s control state ${toUpperCase(getOnOffFromBool(state))}`); + sendNetworkEventToPlayer("vrr.control", client, state, !state); } // =========================================================================== function updatePlayerShowLogoState(client, state) { - logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s logo state ${toUpperCase(getOnOffFromBool(state))}`); - sendNetworkEventToPlayer("vrr.logo", client, state); + logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s logo state ${toUpperCase(getOnOffFromBool(state))}`); + sendNetworkEventToPlayer("vrr.logo", client, state); } // =========================================================================== function restorePlayerCamera(client) { - logToConsole(LOG_DEBUG, `[VRR.Client] Restoring ${getPlayerDisplayForConsole(client)}'s camera`); - sendNetworkEventToPlayer("vrr.restoreCamera", client); + logToConsole(LOG_DEBUG, `[VRR.Client] Restoring ${getPlayerDisplayForConsole(client)}'s camera`); + sendNetworkEventToPlayer("vrr.restoreCamera", client); } // =========================================================================== @@ -208,484 +208,484 @@ function setPlayer2DRendering(client, hudState = false, labelState = false, smal // =========================================================================== function syncPlayerProperties(client) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to sync ${getPlayerDisplayForConsole(client)}'s player ped properties`); - sendNetworkEventToPlayer("vrr.player.sync", null, client.player); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to sync ${getPlayerDisplayForConsole(client)}'s player ped properties`); + sendNetworkEventToPlayer("vrr.player.sync", null, client.player); } // =========================================================================== function updatePlayerSnowState(client) { - if(isSnowSupported(getServerGame())) { - logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s snow state (Falling: ${toUpperCase(getOnOffFromBool(getServerConfig().fallingSnow))}, Ground: ${toUpperCase(getOnOffFromBool(getServerConfig().groundSnow))})`); - sendNetworkEventToPlayer("vrr.snow", client, getServerConfig().fallingSnow, getServerConfig().groundSnow); - } + if(isSnowSupported(getServerGame())) { + logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s snow state (Falling: ${toUpperCase(getOnOffFromBool(getServerConfig().fallingSnow))}, Ground: ${toUpperCase(getOnOffFromBool(getServerConfig().groundSnow))})`); + sendNetworkEventToPlayer("vrr.snow", client, getServerConfig().fallingSnow, getServerConfig().groundSnow); + } } // =========================================================================== function updatePlayerHotBar(client) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending updated hotbar data to ${getPlayerDisplayForConsole(client)}`); - let tempHotBarItems = []; - for(let i in getPlayerData(client).hotBarItems) { - let itemImage = ""; - let itemValue = 0; - let itemExists = false; - if(getPlayerData(client).hotBarItems[i] != -1) { - if(getItemData(getPlayerData(client).hotBarItems[i])) { - let itemData = getItemData(getPlayerData(client).hotBarItems[i]); - let itemTypeData = getItemTypeData(itemData.itemTypeIndex); - itemExists = true; - itemImage = itemTypeData.hotbarImage; - itemValue = itemData.value; - } - } - tempHotBarItems.push([i, itemExists, itemImage, itemValue]); - } - sendNetworkEventToPlayer("vrr.hotbar", client, getPlayerData(client).activeHotBarSlot, tempHotBarItems); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending updated hotbar data to ${getPlayerDisplayForConsole(client)}`); + let tempHotBarItems = []; + for(let i in getPlayerData(client).hotBarItems) { + let itemImage = ""; + let itemValue = 0; + let itemExists = false; + if(getPlayerData(client).hotBarItems[i] != -1) { + if(getItemData(getPlayerData(client).hotBarItems[i])) { + let itemData = getItemData(getPlayerData(client).hotBarItems[i]); + let itemTypeData = getItemTypeData(itemData.itemTypeIndex); + itemExists = true; + itemImage = itemTypeData.hotbarImage; + itemValue = itemData.value; + } + } + tempHotBarItems.push([i, itemExists, itemImage, itemValue]); + } + sendNetworkEventToPlayer("vrr.hotbar", client, getPlayerData(client).activeHotBarSlot, tempHotBarItems); } // =========================================================================== function setPlayerWeaponDamageEnabled(client, state) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending weapon damage state for ${getPlayerDisplayForConsole(client)} to all players`); - sendNetworkEventToPlayer("vrr.weaponDamageEnabled", null, getPlayerName(client), state); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending weapon damage state for ${getPlayerDisplayForConsole(client)} to all players`); + sendNetworkEventToPlayer("vrr.weaponDamageEnabled", null, getPlayerName(client), state); } // =========================================================================== function setPlayerWeaponDamageEvent(client, eventType) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending weapon damage event (${eventType}) for ${getPlayerDisplayForConsole(client)} to all players`); - sendNetworkEventToPlayer("vrr.weaponDamageEvent", null, getPlayerName(client), eventType); - getPlayerData(client).weaponDamageEvent = eventType; + logToConsole(LOG_DEBUG, `[VRR.Client] Sending weapon damage event (${eventType}) for ${getPlayerDisplayForConsole(client)} to all players`); + sendNetworkEventToPlayer("vrr.weaponDamageEvent", null, getPlayerName(client), eventType); + getPlayerData(client).weaponDamageEvent = eventType; } // =========================================================================== function sendJobRouteLocationToPlayer(client, position, colour) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending job route stop data to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("vrr.showJobRouteLocation", client, position, colour); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending job route stop data to ${getPlayerDisplayForConsole(client)}`); + sendNetworkEventToPlayer("vrr.showJobRouteLocation", client, position, colour); } // =========================================================================== function showPlayerChangePasswordGUI(client) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending change password GUI signal to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("vrr.changePassword", client); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending change password GUI signal to ${getPlayerDisplayForConsole(client)}`); + sendNetworkEventToPlayer("vrr.changePassword", client); } // =========================================================================== function showPlayerLoginSuccessGUI(client) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending login success GUI signal to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("vrr.loginSuccess", client); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending login success GUI signal to ${getPlayerDisplayForConsole(client)}`); + sendNetworkEventToPlayer("vrr.loginSuccess", client); } // =========================================================================== function showPlayerLoginFailedGUI(client, errorMessage) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending login failed GUI signal to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("vrr.loginFailed", client, errorMessage); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending login failed GUI signal to ${getPlayerDisplayForConsole(client)}`); + sendNetworkEventToPlayer("vrr.loginFailed", client, errorMessage); } // =========================================================================== function showPlayerRegistrationSuccessGUI(client) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending registration success GUI signal to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("vrr.registrationSuccess", client); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending registration success GUI signal to ${getPlayerDisplayForConsole(client)}`); + sendNetworkEventToPlayer("vrr.registrationSuccess", client); } // =========================================================================== function showPlayerRegistrationFailedGUI(client, errorMessage) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending registration failed GUI signal to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("vrr.registrationFailed", client, errorMessage); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending registration failed GUI signal to ${getPlayerDisplayForConsole(client)}`); + sendNetworkEventToPlayer("vrr.registrationFailed", client, errorMessage); } // =========================================================================== function sendPlayerGUIColours(client) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending GUI colours to ${getPlayerDisplayForConsole(client)}`); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending GUI colours to ${getPlayerDisplayForConsole(client)}`); sendNetworkEventToPlayer("vrr.guiColour", client, getServerConfig().guiColourPrimary[0], getServerConfig().guiColourPrimary[1], getServerConfig().guiColourPrimary[2], getServerConfig().guiColourSecondary[0], getServerConfig().guiColourSecondary[1], getServerConfig().guiColourSecondary[2], getServerConfig().guiTextColourPrimary[0], getServerConfig().guiTextColourPrimary[1], getServerConfig().guiTextColourPrimary[2]); } // =========================================================================== function sendPlayerGUIInit(client) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending GUI init signal to ${getPlayerDisplayForConsole(client)}`); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending GUI init signal to ${getPlayerDisplayForConsole(client)}`); sendNetworkEventToPlayer("vrr.guiInit", client); } // =========================================================================== function showPlayerLoginGUI(client, errorMessage = "") { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending show login GUI signal to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("vrr.showLogin", client); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending show login GUI signal to ${getPlayerDisplayForConsole(client)}`); + sendNetworkEventToPlayer("vrr.showLogin", client); } // =========================================================================== function showPlayerRegistrationGUI(client, errorMessage = "") { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending show registration GUI signal to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("vrr.showRegistration", client); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending show registration GUI signal to ${getPlayerDisplayForConsole(client)}`); + sendNetworkEventToPlayer("vrr.showRegistration", client); } // =========================================================================== function showPlayerNewCharacterGUI(client) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending show new character GUI signal to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("vrr.showNewCharacter", client); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending show new character GUI signal to ${getPlayerDisplayForConsole(client)}`); + sendNetworkEventToPlayer("vrr.showNewCharacter", client); } // =========================================================================== function showPlayerChangePasswordGUI(client, errorMessage = "") { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending show change password GUI signal to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("vrr.showChangePassword", client); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending show change password GUI signal to ${getPlayerDisplayForConsole(client)}`); + sendNetworkEventToPlayer("vrr.showChangePassword", client); } // =========================================================================== function showPlayerResetPasswordCodeInputGUI(client) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending show reset password GUI signal to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("vrr.showResetPasswordCodeInput", client); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending show reset password GUI signal to ${getPlayerDisplayForConsole(client)}`); + sendNetworkEventToPlayer("vrr.showResetPasswordCodeInput", client); } // =========================================================================== function showPlayerCharacterSelectGUI(client, firstName, lastName, cash, clan, lastPlayed, skin) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending character select GUI signal to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("vrr.showCharacterSelect", client, firstName, lastName, cash, clan, lastPlayed, skin); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending character select GUI signal to ${getPlayerDisplayForConsole(client)}`); + sendNetworkEventToPlayer("vrr.showCharacterSelect", client, firstName, lastName, cash, clan, lastPlayed, skin); } // =========================================================================== function updatePlayerCharacterSelectGUI(client, firstName, lastName, cash, clan, lastPlayed, skin) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending update character select GUI signal to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("vrr.switchCharacterSelect", client, firstName, lastName, cash, clan, lastPlayed, skin); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending update character select GUI signal to ${getPlayerDisplayForConsole(client)}`); + sendNetworkEventToPlayer("vrr.switchCharacterSelect", client, firstName, lastName, cash, clan, lastPlayed, skin); } // =========================================================================== function showPlayerCharacterSelectSuccessGUI(client) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending character select success GUI signal to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("vrr.characterSelectSuccess", client); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending character select success GUI signal to ${getPlayerDisplayForConsole(client)}`); + sendNetworkEventToPlayer("vrr.characterSelectSuccess", client); } // =========================================================================== function showPlayerCharacterSelectFailedGUI(client) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending character select failed GUI signal to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("vrr.characterSelectFailed", client); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending character select failed GUI signal to ${getPlayerDisplayForConsole(client)}`); + sendNetworkEventToPlayer("vrr.characterSelectFailed", client); } // =========================================================================== function showPlayerPromptGUI(client, promptMessage, promptTitle, yesButtonText, noButtonText) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending show prompt GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${promptTitle}, Message: ${promptMessage})`); - sendNetworkEventToPlayer("vrr.showPrompt", client, promptMessage, promptTitle, yesButtonText, noButtonText); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending show prompt GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${promptTitle}, Message: ${promptMessage})`); + sendNetworkEventToPlayer("vrr.showPrompt", client, promptMessage, promptTitle, yesButtonText, noButtonText); } // =========================================================================== function showPlayerInfoGUI(client, infoMessage, infoTitle, buttonText = "OK") { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending show info GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${infoTitle}, Message: ${infoMessage})`); - sendNetworkEventToPlayer("vrr.showInfo", client, infoMessage, infoTitle, buttonText); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending show info GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${infoTitle}, Message: ${infoMessage})`); + sendNetworkEventToPlayer("vrr.showInfo", client, infoMessage, infoTitle, buttonText); } // =========================================================================== function showPlayerErrorGUI(client, errorMessage, errorTitle, buttonText = "OK") { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending show error GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${errorTitle}, Message: ${errorMessage})`); - sendNetworkEventToPlayer("vrr.showInfo", client, errorMessage, errorTitle, buttonText); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending show error GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${errorTitle}, Message: ${errorMessage})`); + sendNetworkEventToPlayer("vrr.showInfo", client, errorMessage, errorTitle, buttonText); } // =========================================================================== function sendRunCodeToClient(client, code, returnTo) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending runcode to ${getPlayerDisplayForConsole(client)} (returnTo: ${getPlayerDisplayForConsole(getClientFromIndex(returnTo))}, Code: ${code})`); - sendNetworkEventToPlayer("vrr.runCode", client, code, returnTo); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending runcode to ${getPlayerDisplayForConsole(client)} (returnTo: ${getPlayerDisplayForConsole(getClientFromIndex(returnTo))}, Code: ${code})`); + sendNetworkEventToPlayer("vrr.runCode", client, code, returnTo); } // =========================================================================== function sendPlayerWorkingState(client, state) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending working state (${toUpperCase(getYesNoFromBool(state))}) to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("vrr.working", client, state); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending working state (${toUpperCase(getYesNoFromBool(state))}) to ${getPlayerDisplayForConsole(client)}`); + sendNetworkEventToPlayer("vrr.working", client, state); } // =========================================================================== function sendPlayerJobType(client, jobType) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending job type (${jobType}) to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("vrr.jobType", client, jobType); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending job type (${jobType}) to ${getPlayerDisplayForConsole(client)}`); + sendNetworkEventToPlayer("vrr.jobType", client, jobType); } // =========================================================================== function sendPlayerStopJobRoute(client) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to abort job route to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("vrr.hideJobRouteLocation", client); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to abort job route to ${getPlayerDisplayForConsole(client)}`); + sendNetworkEventToPlayer("vrr.hideJobRouteLocation", client); } // =========================================================================== function sendPlayerMouseCameraToggle(client) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to toggle mouse camera ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("vrr.mouseCamera", client); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to toggle mouse camera ${getPlayerDisplayForConsole(client)}`); + sendNetworkEventToPlayer("vrr.mouseCamera", client); } // =========================================================================== function setPlayerMouseCameraState(client, state) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to toggle mouse camera ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("vrr.mouseCameraForce", client, state); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to toggle mouse camera ${getPlayerDisplayForConsole(client)}`); + sendNetworkEventToPlayer("vrr.mouseCameraForce", client, state); } // =========================================================================== function sendPlayerMouseCursorToggle(client) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to toggle mouse cursor ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("vrr.mouseCursor", client); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to toggle mouse cursor ${getPlayerDisplayForConsole(client)}`); + sendNetworkEventToPlayer("vrr.mouseCursor", client); } // =========================================================================== function sendAddAccountKeyBindToClient(client, key, keyState) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending added keybind to ${getPlayerDisplayForConsole(client)} (Key: ${toUpperCase(getKeyNameFromId(key))}, State: ${(keyState) ? "down" : "up"})`); - sendNetworkEventToPlayer("vrr.addKeyBind", client, toInteger(key), (keyState) ? KEYSTATE_DOWN : KEYSTATE_UP); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending added keybind to ${getPlayerDisplayForConsole(client)} (Key: ${toUpperCase(getKeyNameFromId(key))}, State: ${(keyState) ? "down" : "up"})`); + sendNetworkEventToPlayer("vrr.addKeyBind", client, toInteger(key), (keyState) ? KEYSTATE_DOWN : KEYSTATE_UP); } // =========================================================================== function sendClearKeyBindsToClient(client, key, keyState) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending added keybind to ${getPlayerDisplayForConsole(client)} (Key: ${toUpperCase(getKeyNameFromId(key))}, State: ${(keyState) ? "down" : "up"})`); - sendNetworkEventToPlayer("vrr.clearKeyBinds", client); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending added keybind to ${getPlayerDisplayForConsole(client)} (Key: ${toUpperCase(getKeyNameFromId(key))}, State: ${(keyState) ? "down" : "up"})`); + sendNetworkEventToPlayer("vrr.clearKeyBinds", client); } // =========================================================================== function sendRemoveAccountKeyBindToClient(client, key) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending deleted keybind to ${getPlayerDisplayForConsole(client)} (Key: ${toUpperCase(getKeyNameFromId(key))})`); - sendNetworkEventToPlayer("vrr.delKeyBind", client, toInteger(key)); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending deleted keybind to ${getPlayerDisplayForConsole(client)} (Key: ${toUpperCase(getKeyNameFromId(key))})`); + sendNetworkEventToPlayer("vrr.delKeyBind", client, toInteger(key)); } // =========================================================================== function sendPlayerSetPosition(client, position) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending set position signal to ${getPlayerDisplayForConsole(client)} (Position: ${position.x}, ${position.y}, ${position.z})`); - sendNetworkEventToPlayer("vrr.position", client, position); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending set position signal to ${getPlayerDisplayForConsole(client)} (Position: ${position.x}, ${position.y}, ${position.z})`); + sendNetworkEventToPlayer("vrr.position", client, position); } // =========================================================================== function sendPlayerSetHeading(client, heading) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending set heading signal to ${getPlayerDisplayForConsole(client)} (Heading: ${heading})`); - sendNetworkEventToPlayer("vrr.heading", client, heading); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending set heading signal to ${getPlayerDisplayForConsole(client)} (Heading: ${heading})`); + sendNetworkEventToPlayer("vrr.heading", client, heading); } // =========================================================================== function sendPlayerSetInterior(client, interior) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending set interior signal to ${getPlayerDisplayForConsole(client)} (Interior: ${interior})`); - sendNetworkEventToPlayer("vrr.interior", client, interior); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending set interior signal to ${getPlayerDisplayForConsole(client)} (Interior: ${interior})`); + sendNetworkEventToPlayer("vrr.interior", client, interior); } // =========================================================================== function sendPlayerFrozenState(client, state) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending set frozen signal to ${getPlayerDisplayForConsole(client)} (State: ${toUpperCase(getYesNoFromBool(state))})`); - sendNetworkEventToPlayer("vrr.frozen", client, state); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending set frozen signal to ${getPlayerDisplayForConsole(client)} (State: ${toUpperCase(getYesNoFromBool(state))})`); + sendNetworkEventToPlayer("vrr.frozen", client, state); } // =========================================================================== function clearPlayerWeapons(client) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to ${getPlayerDisplayForConsole(client)} to clear weapons`); - sendNetworkEventToPlayer("vrr.clearWeapons", client); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to ${getPlayerDisplayForConsole(client)} to clear weapons`); + sendNetworkEventToPlayer("vrr.clearWeapons", client); } // =========================================================================== function showPlayerNewCharacterFailedGUI(client, errorMessage) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending new character failed GUI signal to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("vrr.newCharacterFailed", client, errorMessage); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending new character failed GUI signal to ${getPlayerDisplayForConsole(client)}`); + sendNetworkEventToPlayer("vrr.newCharacterFailed", client, errorMessage); } // =========================================================================== function sendPlayerRemoveFromVehicle(client) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending remove from vehicle signal to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("vrr.removeFromVehicle", client); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending remove from vehicle signal to ${getPlayerDisplayForConsole(client)}`); + sendNetworkEventToPlayer("vrr.removeFromVehicle", client); } // =========================================================================== function sendChatBoxMessageToPlayer(client, messageText, colour) { - messageClient(messageText, client, colour); + messageClient(messageText, client, colour); } // =========================================================================== function showPlayerItemTakeDelay(client, itemId) { - if(getItemData(itemId)) { - let delay = getItemTypeData(getItemData(itemId).itemTypeIndex).pickupDelay; - if(delay > 0) { - logToConsole(LOG_DEBUG, `[VRR.Client] Showing item TAKE delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`); - sendNetworkEventToPlayer("vrr.showItemActionDelay", client, delay); - } else { - logToConsole(LOG_DEBUG, `[VRR.Client] Showing item TAKE delay to ${getPlayerDisplayForConsole(client)} (instant)`); - playerItemActionDelayComplete(client); - } - } + if(getItemData(itemId)) { + let delay = getItemTypeData(getItemData(itemId).itemTypeIndex).pickupDelay; + if(delay > 0) { + logToConsole(LOG_DEBUG, `[VRR.Client] Showing item TAKE delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`); + sendNetworkEventToPlayer("vrr.showItemActionDelay", client, delay); + } else { + logToConsole(LOG_DEBUG, `[VRR.Client] Showing item TAKE delay to ${getPlayerDisplayForConsole(client)} (instant)`); + playerItemActionDelayComplete(client); + } + } } // =========================================================================== function showPlayerItemUseDelay(client, itemSlot) { - if(getItemData(getPlayerData(client).hotBarItems[itemSlot])) { - let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).useDelay; - if(delay > 0) { - logToConsole(LOG_DEBUG, `[VRR.Client] Showing item USE delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`); - sendNetworkEventToPlayer("vrr.showItemActionDelay", client, delay); - } else { - logToConsole(LOG_DEBUG, `[VRR.Client] Showing item USE delay to ${getPlayerDisplayForConsole(client)} (instant)`); - playerItemActionDelayComplete(client); - } - } + if(getItemData(getPlayerData(client).hotBarItems[itemSlot])) { + let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).useDelay; + if(delay > 0) { + logToConsole(LOG_DEBUG, `[VRR.Client] Showing item USE delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`); + sendNetworkEventToPlayer("vrr.showItemActionDelay", client, delay); + } else { + logToConsole(LOG_DEBUG, `[VRR.Client] Showing item USE delay to ${getPlayerDisplayForConsole(client)} (instant)`); + playerItemActionDelayComplete(client); + } + } } // =========================================================================== function showPlayerItemDropDelay(client, itemSlot) { - if(getItemData(getPlayerData(client).hotBarItems[itemSlot])) { - let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).dropDelay; - if(delay > 0) { - logToConsole(LOG_DEBUG, `[VRR.Client] Showing item DROP delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`); - sendNetworkEventToPlayer("vrr.showItemActionDelay", client, delay); - } else { - logToConsole(LOG_DEBUG, `[VRR.Client] Showing item DROP delay to ${getPlayerDisplayForConsole(client)} (instant)`); - playerItemActionDelayComplete(client); - } - } + if(getItemData(getPlayerData(client).hotBarItems[itemSlot])) { + let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).dropDelay; + if(delay > 0) { + logToConsole(LOG_DEBUG, `[VRR.Client] Showing item DROP delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`); + sendNetworkEventToPlayer("vrr.showItemActionDelay", client, delay); + } else { + logToConsole(LOG_DEBUG, `[VRR.Client] Showing item DROP delay to ${getPlayerDisplayForConsole(client)} (instant)`); + playerItemActionDelayComplete(client); + } + } } // =========================================================================== function showPlayerItemPickupDelay(client, itemId) { - if(getItemData(itemId)) { - let delay = getItemTypeData(getItemData(itemId).itemTypeIndex).pickupDelay; - if(delay > 0) { - logToConsole(LOG_DEBUG, `[VRR.Client] Showing item PICKUP delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`); - sendNetworkEventToPlayer("vrr.showItemActionDelay", client, delay); - } else { - logToConsole(LOG_DEBUG, `[VRR.Client] Showing item PICKUP delay to ${getPlayerDisplayForConsole(client)} (instant)`); - playerItemActionDelayComplete(client); - } - } + if(getItemData(itemId)) { + let delay = getItemTypeData(getItemData(itemId).itemTypeIndex).pickupDelay; + if(delay > 0) { + logToConsole(LOG_DEBUG, `[VRR.Client] Showing item PICKUP delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`); + sendNetworkEventToPlayer("vrr.showItemActionDelay", client, delay); + } else { + logToConsole(LOG_DEBUG, `[VRR.Client] Showing item PICKUP delay to ${getPlayerDisplayForConsole(client)} (instant)`); + playerItemActionDelayComplete(client); + } + } } // =========================================================================== function showPlayerItemPutDelay(client, itemSlot) { - if(getItemData(getPlayerData(client).hotBarItems[itemSlot])) { - let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).putDelay; - if(delay > 0) { - logToConsole(LOG_DEBUG, `[VRR.Client] Showing item PUT delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`); - sendNetworkEventToPlayer("vrr.showItemActionDelay", client, delay); - } else { - logToConsole(LOG_DEBUG, `[VRR.Client] Showing item PUT delay to ${getPlayerDisplayForConsole(client)} (instant)`); - playerItemActionDelayComplete(client); - } - } + if(getItemData(getPlayerData(client).hotBarItems[itemSlot])) { + let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).putDelay; + if(delay > 0) { + logToConsole(LOG_DEBUG, `[VRR.Client] Showing item PUT delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`); + sendNetworkEventToPlayer("vrr.showItemActionDelay", client, delay); + } else { + logToConsole(LOG_DEBUG, `[VRR.Client] Showing item PUT delay to ${getPlayerDisplayForConsole(client)} (instant)`); + playerItemActionDelayComplete(client); + } + } } // =========================================================================== function showPlayerItemSwitchDelay(client, itemSlot) { - if(itemSlot != -1) { - if(getPlayerData(client).hotBarItems[itemSlot] != -1) { - let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).switchDelay; - if(delay > 0) { - logToConsole(LOG_DEBUG, `[VRR.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`); - sendNetworkEventToPlayer("vrr.showItemActionDelay", client, delay); - } else{ - logToConsole(LOG_DEBUG, `[VRR.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (instant)`); - playerItemActionDelayComplete(client); - } - } else { - logToConsole(LOG_DEBUG, `[VRR.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (instant)`); - playerItemActionDelayComplete(client); - } - } else { - logToConsole(LOG_DEBUG, `[VRR.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (instant)`); - playerSwitchItem(client, itemSlot); - } + if(itemSlot != -1) { + if(getPlayerData(client).hotBarItems[itemSlot] != -1) { + let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).switchDelay; + if(delay > 0) { + logToConsole(LOG_DEBUG, `[VRR.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`); + sendNetworkEventToPlayer("vrr.showItemActionDelay", client, delay); + } else{ + logToConsole(LOG_DEBUG, `[VRR.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (instant)`); + playerItemActionDelayComplete(client); + } + } else { + logToConsole(LOG_DEBUG, `[VRR.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (instant)`); + playerItemActionDelayComplete(client); + } + } else { + logToConsole(LOG_DEBUG, `[VRR.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (instant)`); + playerSwitchItem(client, itemSlot); + } } // =========================================================================== function sendPlayerDrunkEffect(client, amount, duration) { - logToConsole(LOG_DEBUG, `[VRR.Client] Setting drunk effect for ${getPlayerDisplayForConsole(client)} to ${amount} for ${duration} milliseconds`); - sendNetworkEventToPlayer("vrr.drunkEffect", client, amount, duration); + logToConsole(LOG_DEBUG, `[VRR.Client] Setting drunk effect for ${getPlayerDisplayForConsole(client)} to ${amount} for ${duration} milliseconds`); + sendNetworkEventToPlayer("vrr.drunkEffect", client, amount, duration); } // =========================================================================== function sendPlayerClearPedState(client) { - logToConsole(LOG_DEBUG, `[VRR.Client] Clearing ped state for ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("vrr.clearPedState", client); + logToConsole(LOG_DEBUG, `[VRR.Client] Clearing ped state for ${getPlayerDisplayForConsole(client)}`); + sendNetworkEventToPlayer("vrr.clearPedState", client); } // =========================================================================== function playerDamagedByPlayer(client, damagerEntityName, weaponId, pedPiece, healthLoss) { - let damagerEntity = getPlayerFromParams(damagerEntityName); + let damagerEntity = getPlayerFromParams(damagerEntityName); - if(isNull(damagerEntity)) { - logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager entity from ID is null`); - return false; - } + if(isNull(damagerEntity)) { + logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager entity from ID is null`); + return false; + } - logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)} was damaged by ${damagerEntity}`); + logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)} was damaged by ${damagerEntity}`); - if(isNull(damagerEntity)) { - logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager client is INVALID`); - return false; - } + if(isNull(damagerEntity)) { + logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager client is INVALID`); + return false; + } - if(!getPlayerData(damagerEntity) || !getPlayerData(client)) { - logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager's client data is INVALID`); - return false; - } + if(!getPlayerData(damagerEntity) || !getPlayerData(client)) { + logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager's client data is INVALID`); + return false; + } - logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager is ${getPlayerDisplayForConsole(damagerEntity)}`); + logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager is ${getPlayerDisplayForConsole(damagerEntity)}`); - switch(getPlayerData(damagerEntity).weaponDamageEvent) { - case VRR_WEAPON_DAMAGE_EVENT_TAZER: - logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager ${getPlayerDisplayForConsole(damagerEntity)} is using a tazer`); - if(!isPlayerTazed(client) && !isPlayerHandCuffed(client) && !isPlayerInAnyVehicle(client)) { - logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)} was not previously tazed, binded, or in a vehicle. Taze successful`); - meActionToNearbyPlayers(damagerEntity, `electrifies ${getCharacterFullName(client)} with their tazer`); - tazePlayer(client); - } - break; + switch(getPlayerData(damagerEntity).weaponDamageEvent) { + case VRR_WEAPON_DAMAGE_EVENT_TAZER: + logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager ${getPlayerDisplayForConsole(damagerEntity)} is using a tazer`); + if(!isPlayerTazed(client) && !isPlayerHandCuffed(client) && !isPlayerInAnyVehicle(client)) { + logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)} was not previously tazed, binded, or in a vehicle. Taze successful`); + meActionToNearbyPlayers(damagerEntity, `electrifies ${getCharacterFullName(client)} with their tazer`); + tazePlayer(client); + } + break; - case VRR_WEAPON_DAMAGE_EVENT_EXTINGUISH: - break; + case VRR_WEAPON_DAMAGE_EVENT_EXTINGUISH: + break; - case VRR_WEAPON_DAMAGE_EVENT_MACE: - break; + case VRR_WEAPON_DAMAGE_EVENT_MACE: + break; - case VRR_WEAPON_DAMAGE_EVENT_NORMAL: - logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager ${getPlayerDisplayForConsole(damagerEntity)} caused ${healthLoss} damage (damage reduction makes it ${(healthLoss*getPlayerData(client).incomingDamageMultiplier)})`); - setPlayerHealth(client, getPlayerHealth(client)-(healthLoss*getPlayerData(client).incomingDamageMultiplier)); - break; + case VRR_WEAPON_DAMAGE_EVENT_NORMAL: + logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager ${getPlayerDisplayForConsole(damagerEntity)} caused ${healthLoss} damage (damage reduction makes it ${(healthLoss*getPlayerData(client).incomingDamageMultiplier)})`); + setPlayerHealth(client, getPlayerHealth(client)-(healthLoss*getPlayerData(client).incomingDamageMultiplier)); + break; - default: - logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager ${getPlayerDisplayForConsole(damagerEntity)} caused ${healthLoss} damage (damage reduction makes it ${(healthLoss*getPlayerData(client).incomingDamageMultiplier)})`); - setPlayerHealth(client, getPlayerHealth(client)-(healthLoss*getPlayerData(client).incomingDamageMultiplier)); - break; - } + default: + logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager ${getPlayerDisplayForConsole(damagerEntity)} caused ${healthLoss} damage (damage reduction makes it ${(healthLoss*getPlayerData(client).incomingDamageMultiplier)})`); + setPlayerHealth(client, getPlayerHealth(client)-(healthLoss*getPlayerData(client).incomingDamageMultiplier)); + break; + } } // =========================================================================== @@ -703,44 +703,44 @@ function sendTimeMinuteDurationToPlayer(client, minuteDuration) { // =========================================================================== function updatePositionInPlayerData(client, position) { - getPlayerData(client).syncPosition = position; + getPlayerData(client).syncPosition = position; } // =========================================================================== function updateHeadingInPlayerData(client, heading) { - getPlayerData(client).syncHeading = heading; + getPlayerData(client).syncHeading = heading; } // =========================================================================== function updatePositionInVehicleData(client, vehicle, position) { - getVehicleData(vehicle).syncPosition = position; + getVehicleData(vehicle).syncPosition = position; } // =========================================================================== function updateHeadingInVehicleData(client, vehicle, heading) { - getVehicleData(vehicle).syncHeading = heading; + getVehicleData(vehicle).syncHeading = heading; } // =========================================================================== function forcePlayerIntoSkinSelect(client) { - if(getGameConfig().skinChangePosition[getServerGame()].length > 0) { - getPlayerData(client).returnToPosition = getPlayerPosition(client); - getPlayerData(client).returnToHeading = getPlayerHeading(client); - getPlayerData(client).returnToInterior = getPlayerInterior(client); - getPlayerData(client).returnToDimension = getPlayerDimension(client); - getPlayerData(client).returnToType = VRR_RETURNTO_TYPE_SKINSELECT; + if(getGameConfig().skinChangePosition[getServerGame()].length > 0) { + getPlayerData(client).returnToPosition = getPlayerPosition(client); + getPlayerData(client).returnToHeading = getPlayerHeading(client); + getPlayerData(client).returnToInterior = getPlayerInterior(client); + getPlayerData(client).returnToDimension = getPlayerDimension(client); + getPlayerData(client).returnToType = VRR_RETURNTO_TYPE_SKINSELECT; - setPlayerPosition(client, getGameConfig().skinChangePosition[getServerGame()][0]); - setPlayerHeading(client, getGameConfig().skinChangePosition[getServerGame()][1]); - setPlayerInterior(client, getGameConfig().skinChangePosition[getServerGame()][2]); - setPlayerDimension(client, client.index+500); - } + setPlayerPosition(client, getGameConfig().skinChangePosition[getServerGame()][0]); + setPlayerHeading(client, getGameConfig().skinChangePosition[getServerGame()][1]); + setPlayerInterior(client, getGameConfig().skinChangePosition[getServerGame()][2]); + setPlayerDimension(client, client.index+500); + } - sendNetworkEventToPlayer("vrr.skinSelect", client, true); + sendNetworkEventToPlayer("vrr.skinSelect", client, true); } // =========================================================================== @@ -866,315 +866,321 @@ function sendAllFuelStationBlips(client) { // =========================================================================== function sendPlayerSetHealth(client, health) { - sendNetworkEventToPlayer("vrr.health", client, health); + sendNetworkEventToPlayer("vrr.health", client, health); } // =========================================================================== function sendPlayerSetArmour(client, armour) { - sendNetworkEventToPlayer("vrr.armour", client, armour); + sendNetworkEventToPlayer("vrr.armour", client, armour); } // =========================================================================== function playerFinishedSkinSelection(client, allowedSkinIndex) { - sendNetworkEventToPlayer("vrr.skinSelect", client, false); - if(allowedSkinIndex == -1) { - messagePlayerAlert(client, "You canceled the skin change."); - restorePlayerCamera(client); + sendNetworkEventToPlayer("vrr.skinSelect", client, false); + if(allowedSkinIndex == -1) { + messagePlayerAlert(client, "You canceled the skin change."); + restorePlayerCamera(client); - if(getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == VRR_RETURNTO_TYPE_SKINSELECT) { - setPlayerPosition(client, getPlayerData(client).returnToPosition); - setPlayerHeading(client, getPlayerData(client).returnToHeading); - setPlayerInterior(client, getPlayerData(client).returnToInterior); - setPlayerDimension(client, getPlayerData(client).returnToDimension); + if(getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == VRR_RETURNTO_TYPE_SKINSELECT) { + setPlayerPosition(client, getPlayerData(client).returnToPosition); + setPlayerHeading(client, getPlayerData(client).returnToHeading); + setPlayerInterior(client, getPlayerData(client).returnToInterior); + setPlayerDimension(client, getPlayerData(client).returnToDimension); - getPlayerData(client).returnToPosition = null; - getPlayerData(client).returnToHeading = null; - getPlayerData(client).returnToInterior = null; - getPlayerData(client).returnToDimension = null; - } - return false; - } else { - getPlayerCurrentSubAccount(client).skin = getSkinIndexFromModel(allowedSkins[allowedSkinIndex][0]); - if(isPlayerWorking(client)) { - messagePlayerAlert(client, "Your new skin has been saved but won't be shown until you stop working."); - setPlayerSkin(client, getJobData(getPlayerCurrentSubAccount(client).job).uniforms[getPlayerData(client).jobUniform].skinId); - } else { - setPlayerSkin(client, getPlayerCurrentSubAccount(client).skin); - } + getPlayerData(client).returnToPosition = null; + getPlayerData(client).returnToHeading = null; + getPlayerData(client).returnToInterior = null; + getPlayerData(client).returnToDimension = null; + } + return false; + } else { + getPlayerCurrentSubAccount(client).skin = getSkinIndexFromModel(allowedSkins[allowedSkinIndex][0]); + if(isPlayerWorking(client)) { + messagePlayerAlert(client, "Your new skin has been saved but won't be shown until you stop working."); + setPlayerSkin(client, getJobData(getPlayerCurrentSubAccount(client).job).uniforms[getPlayerData(client).jobUniform].skinId); + } else { + setPlayerSkin(client, getPlayerCurrentSubAccount(client).skin); + } - if(getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == VRR_RETURNTO_TYPE_SKINSELECT) { - setPlayerPosition(client, getPlayerData(client).returnToPosition); - setPlayerHeading(client, getPlayerData(client).returnToHeading); - setPlayerInterior(client, getPlayerData(client).returnToInterior); - setPlayerDimension(client, getPlayerData(client).returnToDimension); + if(getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == VRR_RETURNTO_TYPE_SKINSELECT) { + setPlayerPosition(client, getPlayerData(client).returnToPosition); + setPlayerHeading(client, getPlayerData(client).returnToHeading); + setPlayerInterior(client, getPlayerData(client).returnToInterior); + setPlayerDimension(client, getPlayerData(client).returnToDimension); - getPlayerData(client).returnToPosition = null; - getPlayerData(client).returnToHeading = null; - getPlayerData(client).returnToInterior = null; - getPlayerData(client).returnToDimension = null; - } + getPlayerData(client).returnToPosition = null; + getPlayerData(client).returnToHeading = null; + getPlayerData(client).returnToInterior = null; + getPlayerData(client).returnToDimension = null; + } - restorePlayerCamera(client); - setPlayerControlState(client, true); + restorePlayerCamera(client); + setPlayerControlState(client, true); - deleteItem(getPlayerData(client).itemActionItem); - switchPlayerActiveHotBarSlot(client, -1); - cachePlayerHotBarItems(client); + deleteItem(getPlayerData(client).itemActionItem); + switchPlayerActiveHotBarSlot(client, -1); + cachePlayerHotBarItems(client); - meActionToNearbyPlayers(client, `changes their skin to ${allowedSkins[allowedSkinIndex][1]}`); - } + meActionToNearbyPlayers(client, `changes their skin to ${allowedSkins[allowedSkinIndex][1]}`); + } } // =========================================================================== function sendPlayerChatScrollLines(client, amount) { - sendNetworkEventToPlayer("vrr.chatScrollLines", client, amount); + sendNetworkEventToPlayer("vrr.chatScrollLines", client, amount); } // =========================================================================== function playRadioStreamForPlayer(client, streamURL, loop = true, volume = 0, element = false) { - logToConsole(LOG_DEBUG, `[VRR.Client] Forcing ${getPlayerDisplayForConsole(client)} to stream ${streamURL}`); - sendNetworkEventToPlayer("vrr.radioStream", client, streamURL, loop, volume, element); + logToConsole(LOG_DEBUG, `[VRR.Client] Forcing ${getPlayerDisplayForConsole(client)} to stream ${streamURL}`); + sendNetworkEventToPlayer("vrr.radioStream", client, streamURL, loop, volume, element); } // =========================================================================== function playAudioFileForPlayer(client, audioName, loop = true, volume = 0, element = false) { - logToConsole(LOG_DEBUG, `[VRR.Client] Forcing ${getPlayerDisplayForConsole(client)} to play audio ${audioName}`); - sendNetworkEventToPlayer("vrr.audioFileStream", client, audioName, loop, volume); + logToConsole(LOG_DEBUG, `[VRR.Client] Forcing ${getPlayerDisplayForConsole(client)} to play audio ${audioName}`); + sendNetworkEventToPlayer("vrr.audioFileStream", client, audioName, loop, volume); } // =========================================================================== function stopRadioStreamForPlayer(client) { - logToConsole(LOG_DEBUG, `[VRR.Client] Forcing ${getPlayerDisplayForConsole(client)} to stop their radio stream`); - sendNetworkEventToPlayer("vrr.stopRadioStream", client); + logToConsole(LOG_DEBUG, `[VRR.Client] Forcing ${getPlayerDisplayForConsole(client)} to stop their radio stream`); + sendNetworkEventToPlayer("vrr.stopRadioStream", client); } // =========================================================================== function setPlayerStreamingRadioVolume(client, volumeLevel, elementId = false) { - getPlayerData(client).accountData.streamingRadioVolume = volumeLevel; - getPlayerData(client).streamingRadioElement = elementId; - sendNetworkEventToPlayer("vrr.radioVolume", client, volumeLevel, elementId); + getPlayerData(client).accountData.streamingRadioVolume = volumeLevel; + getPlayerData(client).streamingRadioElement = elementId; + sendNetworkEventToPlayer("vrr.radioVolume", client, volumeLevel, elementId); } // =========================================================================== function setVehicleLightsState(vehicle, state) { setEntityData(vehicle, "vrr.lights", getVehicleData(vehicle).lights); - sendNetworkEventToPlayer("vrr.veh.lights", null, vehicle.id, state); + sendNetworkEventToPlayer("vrr.veh.lights", null, vehicle.id, state); } // =========================================================================== function sendPlayerEnterPropertyKey(client, key) { - sendNetworkEventToPlayer("vrr.enterPropertyKey", client, key); + sendNetworkEventToPlayer("vrr.enterPropertyKey", client, key); } // =========================================================================== function makePedPlayAnimation(ped, animationSlot, positionOffset) { - let animationData = getAnimationData(animationSlot); - let freezePlayer = false; - //if(animationData[9] != VRR_ANIMMOVE_NONE) { - switch(animationData[9]) { - case VRR_ANIMMOVE_FORWARD: - setElementCollisionsEnabled(ped, false); - setElementPosition(ped, getPosInFrontOfPos(getElementPosition(ped), fixAngle(getElementHeading(ped)), positionOffset)); - freezePlayer = true; - break; + let animationData = getAnimationData(animationSlot); + let freezePlayer = false; + //if(animationData[9] != VRR_ANIMMOVE_NONE) { + switch(animationData[9]) { + case VRR_ANIMMOVE_FORWARD: + setElementCollisionsEnabled(ped, false); + setElementPosition(ped, getPosInFrontOfPos(getElementPosition(ped), fixAngle(getElementHeading(ped)), positionOffset)); + freezePlayer = true; + break; - case VRR_ANIMMOVE_BACK: - setElementCollisionsEnabled(ped, false); - setElementPosition(ped, getPosBehindPos(getElementPosition(ped), fixAngle(getElementHeading(ped)), positionOffset)); - freezePlayer = true; - break; + case VRR_ANIMMOVE_BACK: + setElementCollisionsEnabled(ped, false); + setElementPosition(ped, getPosBehindPos(getElementPosition(ped), fixAngle(getElementHeading(ped)), positionOffset)); + freezePlayer = true; + break; - case VRR_ANIMMOVE_LEFT: - setElementCollisionsEnabled(ped, false); - setElementPosition(ped, getPosToLeftOfPos(getElementPosition(ped), fixAngle(getElementHeading(ped)), positionOffset)); - freezePlayer = true; - break; + case VRR_ANIMMOVE_LEFT: + setElementCollisionsEnabled(ped, false); + setElementPosition(ped, getPosToLeftOfPos(getElementPosition(ped), fixAngle(getElementHeading(ped)), positionOffset)); + freezePlayer = true; + break; - case VRR_ANIMMOVE_RIGHT: - setElementCollisionsEnabled(ped, false); - setElementPosition(ped, getPosToRightOfPos(getElementPosition(ped), fixAngle(getElementHeading(ped)), positionOffset)); - freezePlayer = true; - break; - } - //} - sendNetworkEventToPlayer("vrr.pedAnim", null, ped.id, animationData[1], animationData[2], animationData[3], animationData[4], animationData[5], positionOffset, freezePlayer); + case VRR_ANIMMOVE_RIGHT: + setElementCollisionsEnabled(ped, false); + setElementPosition(ped, getPosToRightOfPos(getElementPosition(ped), fixAngle(getElementHeading(ped)), positionOffset)); + freezePlayer = true; + break; + } + //} + sendNetworkEventToPlayer("vrr.pedAnim", null, ped.id, animationData[1], animationData[2], animationData[3], animationData[4], animationData[5], positionOffset, freezePlayer); } // =========================================================================== function makePedStopAnimation(pedId) { - sendNetworkEventToPlayer("vrr.pedStopAnim", null, pedId); + sendNetworkEventToPlayer("vrr.pedStopAnim", null, pedId); } // =========================================================================== function forcePedAnimation(ped, animationSlot) { - let animationData = getAnimationData(animationSlot); + let animationData = getAnimationData(animationSlot); - sendNetworkEventToPlayer("vrr.forcePedAnim", null, ped.id, animationData[1], animationData[2], animationData[3], animationData[4]); + sendNetworkEventToPlayer("vrr.forcePedAnim", null, ped.id, animationData[1], animationData[2], animationData[3], animationData[4]); } // =========================================================================== function hideAllPlayerGUI(client) { - sendNetworkEventToPlayer("vrr.hideAllGUI", client); + sendNetworkEventToPlayer("vrr.hideAllGUI", client); } // =========================================================================== function requestClientInfo(client) { - sendNetworkEventToPlayer("vrr.clientInfo", client); + sendNetworkEventToPlayer("vrr.clientInfo", client); } // =========================================================================== function updateInteriorLightsForPlayer(client, state) { - sendNetworkEventToPlayer("vrr.interiorLights", client, state); + sendNetworkEventToPlayer("vrr.interiorLights", client, state); } // =========================================================================== function forcePlayerToSyncElementProperties(client, element) { - sendNetworkEventToPlayer("vrr.syncElement", client, element.id); + sendNetworkEventToPlayer("vrr.syncElement", client, element.id); } // =========================================================================== function sendPlayerPedPartsAndProps(client) { - let bodyParts = getPlayerCurrentSubAccount(client).bodyParts; - let bodyProps = getPlayerCurrentSubAccount(client).bodyProps; + let bodyParts = getPlayerCurrentSubAccount(client).bodyParts; + let bodyProps = getPlayerCurrentSubAccount(client).bodyProps; - sendNetworkEventToPlayer("vrr.ped", client, [bodyParts.hair, bodyParts.head, bodyParts.upper, bodyParts.lower], [bodyProps.hair, bodyProps.eyes, bodyProps.head, bodyProps.leftHand, bodyProps.rightHand, bodyProps.leftWrist, bodyProps.rightWrist, bodyParts.hip, bodyProps.leftFoot, bodyProps.rightFoot]); + sendNetworkEventToPlayer("vrr.ped", client, [bodyParts.hair, bodyParts.head, bodyParts.upper, bodyParts.lower], [bodyProps.hair, bodyProps.eyes, bodyProps.head, bodyProps.leftHand, bodyProps.rightHand, bodyProps.leftWrist, bodyProps.rightWrist, bodyParts.hip, bodyProps.leftFoot, bodyProps.rightFoot]); } // =========================================================================== function forcePlayerWantedLevel(client, wantedLevel) { - sendNetworkEventToPlayer("vrr.wantedLevel", client, wantedLevel); - return true; + sendNetworkEventToPlayer("vrr.wantedLevel", client, wantedLevel); + return true; } // =========================================================================== function onPlayerNearPickup(client, pickupId) { - getPlayerData(client).currentPickup = getElementFromId(pickupId); + getPlayerData(client).currentPickup = getElementFromId(pickupId); } // =========================================================================== function updateAllInteriorVehiclesForPlayer(client, interior, dimension) { - for(let i in getServerData().vehicles) { - if(getServerData().vehicles[i].vehicle != false) { - if(getServerData().vehicles[i].interior == interior && getServerData().vehicles[i].dimension == dimension) { - forcePlayerToSyncElementProperties(client, getServerData().vehicles[i].vehicle); - } - } - } + for(let i in getServerData().vehicles) { + if(getServerData().vehicles[i].vehicle != false) { + if(getServerData().vehicles[i].interior == interior && getServerData().vehicles[i].dimension == dimension) { + forcePlayerToSyncElementProperties(client, getServerData().vehicles[i].vehicle); + } + } + } } // =========================================================================== function setPlayerBuyingVehicleState(client, state, vehicleId, position) { - if(getGlobalConfig().useServerSideVehiclePurchaseCheck == false) { - sendNetworkEventToPlayer("vrr.vehBuyState", client, state, vehicleId, position); - } + if(getGlobalConfig().useServerSideVehiclePurchaseCheck == false) { + sendNetworkEventToPlayer("vrr.vehBuyState", client, state, vehicleId, position); + } } // ========================================================================== function receiveVehiclePurchaseStateUpdateFromClient(client, state) { - if(getGlobalConfig().useServerSideVehiclePurchaseCheck == false) { - checkVehicleBuying(client); - } + if(getGlobalConfig().useServerSideVehiclePurchaseCheck == false) { + checkVehicleBuying(client); + } } // =========================================================================== function sendPlayerLogLevel(client, tempLogLevel = logLevel) { - sendNetworkEventToPlayer("vrr.logLevel", client, tempLogLevel); + sendNetworkEventToPlayer("vrr.logLevel", client, tempLogLevel); } // ========================================================================== function setPlayerInfiniteRun(client, state) { - sendNetworkEventToPlayer("vrr.infiniteRun", client, state); + sendNetworkEventToPlayer("vrr.infiniteRun", client, state); } // ========================================================================== function sendBusinessToPlayer(client, businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems) { - sendNetworkEventToPlayer("vrr.business", client, businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems); + sendNetworkEventToPlayer("vrr.business", client, businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems); } // ========================================================================== function sendHouseToPlayer(client, houseId, entrancePosition, blipModel, pickupModel, hasInterior) { - sendNetworkEventToPlayer("vrr.house", client, houseId, entrancePosition, blipModel, pickupModel, hasInterior); + sendNetworkEventToPlayer("vrr.house", client, houseId, entrancePosition, blipModel, pickupModel, hasInterior); } // ========================================================================== function sendAllBusinessesToPlayer(client) { - let businesses = getServerData().businesses; - for(let i in businesses) { - sendBusinessToPlayer(client, businesses[i].index, businesses[i].name, businesses[i].entrancePosition, businesses[i].entranceBlipModel, businesses[i].entrancePickupModel, businesses[i].hasInterior, false); - } + let businesses = getServerData().businesses; + for(let i in businesses) { + sendBusinessToPlayer(client, businesses[i].index, businesses[i].name, businesses[i].entrancePosition, businesses[i].entranceBlipModel, businesses[i].entrancePickupModel, businesses[i].hasInterior, false); + } } // ========================================================================== function sendAllHousesToPlayer(client) { - let houses = getServerData().houses; - for(let i in houses) { - sendHouseToPlayer(client, houses[i].index, houses[i].entrancePosition, houses[i].entranceBlipModel, houses[i].entrancePickupModel, houses[i].hasInterior); - } + let houses = getServerData().houses; + for(let i in houses) { + sendHouseToPlayer(client, houses[i].index, houses[i].entrancePosition, houses[i].entranceBlipModel, houses[i].entrancePickupModel, houses[i].hasInterior); + } } // ========================================================================== function sendAllJobsToPlayer(client) { - //let jobs = getServerData().jobs; - //for(let i in jobs) { - // for(let j in jobs[i].locations) { - // sendJobToPlayer(client, jobs[i].index, jobs[i].name, jobs[i].locations[j].position, jobs[i].blipModel); - // } - //} + //let jobs = getServerData().jobs; + //for(let i in jobs) { + // for(let j in jobs[i].locations) { + // sendJobToPlayer(client, jobs[i].index, jobs[i].name, jobs[i].locations[j].position, jobs[i].blipModel); + // } + //} } // ========================================================================== function makePlayerHoldObjectModel(client, modelIndex) { - sendNetworkEventToPlayer("vrr.holdObject", client, getPlayerData(client).ped, modelIndex); + sendNetworkEventToPlayer("vrr.holdObject", client, getPlayerData(client).ped, modelIndex); } // ========================================================================== function receivePlayerPedNetworkId(client, pedId) { - getPlayerData(client).ped = pedId; + getPlayerData(client).ped = pedId; } // ========================================================================== function requestPlayerPedNetworkId(client) { - sendNetworkEventToPlayer("vrr.playerPedId", client); + sendNetworkEventToPlayer("vrr.playerPedId", client); } // ========================================================================== function setPlayerInCutsceneInterior(client, cutsceneName) { - getPlayerData(client).interiorCutscene = cutsceneName; - sendNetworkEventToPlayer("vrr.cutsceneInterior", client, cutsceneName); + getPlayerData(client).interiorCutscene = cutsceneName; + sendNetworkEventToPlayer("vrr.cutsceneInterior", client, cutsceneName); +} + +// ========================================================================== + +function makePlayerPedSpeak(client, pedSpeechName) { + sendNetworkEventToPlayer("vrr.pedSpeak", client, pedSpeechName); } // ========================================================================== \ No newline at end of file diff --git a/scripts/server/command.js b/scripts/server/command.js index c577d396..673c4fed 100644 --- a/scripts/server/command.js +++ b/scripts/server/command.js @@ -12,581 +12,581 @@ let serverCommands = []; // =========================================================================== let builtInCommands = [ - "refresh", - "restart", - "stop", - "start", - "reconnect", - "setname", - "connect", - "disconnect", - "say", - "dumpdoc", + "refresh", + "restart", + "stop", + "start", + "reconnect", + "setname", + "connect", + "disconnect", + "say", + "dumpdoc", ]; // =========================================================================== function initCommandScript() { - logToConsole(LOG_INFO, "[VRR.Command]: Initializing commands script ..."); - serverCommands = loadCommands(); - //addAllCommandHandlers(); - logToConsole(LOG_INFO, "[VRR.Command]: Initialized commands script!"); + logToConsole(LOG_INFO, "[VRR.Command]: Initializing commands script ..."); + serverCommands = loadCommands(); + //addAllCommandHandlers(); + logToConsole(LOG_INFO, "[VRR.Command]: Initialized commands script!"); } // =========================================================================== function loadCommands() { - let tempCommands = { - accent: [ - commandData("accent", setAccentCommand, "", getStaffFlagValue("None"), false, false, "Sets your character's accent"), - commandData("accents", listAccentsCommand, "", getStaffFlagValue("None"), false, false, "Shows a list of all available accents"), - commandData("accentlist", listAccentsCommand, "", getStaffFlagValue("None"), false, false, "Shows a list of all available accents"), - ], - account: [ - commandData("login", loginCommand, "", getStaffFlagValue("None"), false, false, "Login to an account"), - commandData("register", registerCommand, "", getStaffFlagValue("None"), false, false, "Creates an account"), - commandData("changepass", changeAccountPasswordCommand, " ", getStaffFlagValue("None"), true, false, "Change an account password"), - commandData("iplogin", toggleAutoLoginByIPCommand, "", getStaffFlagValue("None"), true, false, "Toggle whether to automatically login if you join with the same IP as your last join"), - commandData("autolastchar", toggleAutoSelectLastCharacterCommand, "", getStaffFlagValue("None"), true, false, "Toggle whether to automatically spawn with the last character you played as"), - commandData("gui", toggleAccountGUICommand, "", getStaffFlagValue("None"), false, false, "Toggle whether to use GUI. If GUI is disabled on the server, it won't show even if you have GUI enabled."), - commandData("2fa", toggleAccountTwoFactorAuthCommand, "", getStaffFlagValue("None"), true, false, "Set up and use two-factor authentication."), - commandData("setemail", setAccountEmailCommand, "", getStaffFlagValue("None"), true, false, "Sets your email. To reset your password, you must have a valid email set and verified."), - commandData("verifyemail", verifyAccountEmailCommand, "", getStaffFlagValue("None"), true, false, "Confirms/verifies your email."), - //commandData("setdiscord", setAccountDiscordCommand, "", getStaffFlagValue("None"), true, false, "Set up the integration for discord. Allows you to see info and use in-game commands on discord."), - commandData("notips", toggleNoRandomTipsCommand, "", getStaffFlagValue("None"), true, false, "Turn on and off random tips"), - commandData("loginalert", toggleAccountLoginAttemptNotificationsCommand, "", getStaffFlagValue("None"), true, false, "Turn on and off email notifications for attempts to login to your account"), - commandData("scrolllines", setAccountChatScrollLinesCommand, "", getStaffFlagValue("None"), true, false, "Sets how many chatbox lines to scroll at a time when using pageup/pagedown"), + let tempCommands = { + accent: [ + commandData("accent", setAccentCommand, "", getStaffFlagValue("None"), false, false, "Sets your character's accent"), + commandData("accents", listAccentsCommand, "", getStaffFlagValue("None"), false, false, "Shows a list of all available accents"), + commandData("accentlist", listAccentsCommand, "", getStaffFlagValue("None"), false, false, "Shows a list of all available accents"), + ], + account: [ + commandData("login", loginCommand, "", getStaffFlagValue("None"), false, false, "Login to an account"), + commandData("register", registerCommand, "", getStaffFlagValue("None"), false, false, "Creates an account"), + commandData("changepass", changeAccountPasswordCommand, " ", getStaffFlagValue("None"), true, false, "Change an account password"), + commandData("iplogin", toggleAutoLoginByIPCommand, "", getStaffFlagValue("None"), true, false, "Toggle whether to automatically login if you join with the same IP as your last join"), + commandData("autolastchar", toggleAutoSelectLastCharacterCommand, "", getStaffFlagValue("None"), true, false, "Toggle whether to automatically spawn with the last character you played as"), + commandData("gui", toggleAccountGUICommand, "", getStaffFlagValue("None"), false, false, "Toggle whether to use GUI. If GUI is disabled on the server, it won't show even if you have GUI enabled."), + commandData("2fa", toggleAccountTwoFactorAuthCommand, "", getStaffFlagValue("None"), true, false, "Set up and use two-factor authentication."), + commandData("setemail", setAccountEmailCommand, "", getStaffFlagValue("None"), true, false, "Sets your email. To reset your password, you must have a valid email set and verified."), + commandData("verifyemail", verifyAccountEmailCommand, "", getStaffFlagValue("None"), true, false, "Confirms/verifies your email."), + //commandData("setdiscord", setAccountDiscordCommand, "", getStaffFlagValue("None"), true, false, "Set up the integration for discord. Allows you to see info and use in-game commands on discord."), + commandData("notips", toggleNoRandomTipsCommand, "", getStaffFlagValue("None"), true, false, "Turn on and off random tips"), + commandData("loginalert", toggleAccountLoginAttemptNotificationsCommand, "", getStaffFlagValue("None"), true, false, "Turn on and off email notifications for attempts to login to your account"), + commandData("scrolllines", setAccountChatScrollLinesCommand, "", getStaffFlagValue("None"), true, false, "Sets how many chatbox lines to scroll at a time when using pageup/pagedown"), - ], - ammunation: [], - animation: [ - commandData("anim", playPlayerAnimationCommand, "", getStaffFlagValue("None"), true, true, "Makes your player ped use an animation"), - commandData("an", playPlayerAnimationCommand, "", getStaffFlagValue("None"), true, true, "Makes your player ped use an animation"), - commandData("e", playPlayerAnimationCommand, "", getStaffFlagValue("None"), true, true, "Makes your player ped use an animation"), - commandData("anims", showAnimationListCommand, "", getStaffFlagValue("None"), true, true, "Shows a list of animations"), - commandData("animlist", showAnimationListCommand, "", getStaffFlagValue("None"), true, true, "Shows a list of animations"), - commandData("stopanim", stopPlayerAnimationCommand, "", getStaffFlagValue("None"), true, true, "Stops your current animation"), - ], - antiCheat: [ - //commandData("setac", toggleGlobalAntiCheatCommand, "<0/1 state>", getStaffFlagValue("Developer"), true, true), - //commandData("ac", getGlobalAntiCheatStatusCommand, "<0/1 state>", getStaffFlagValue("Developer"), true, true), - ], - ban: [ - commandData("aban", accountBanCommand, " ", getStaffFlagValue("BasicModeration"), true, true, "Bans a player's account."), - commandData("acctban", accountBanCommand, " ", getStaffFlagValue("BasicModeration"), true, true, "Bans a player's account."), - commandData("cban", subAccountBanCommand, " ", getStaffFlagValue("BasicModeration"), true, true, "Bans a player's character."), - commandData("charban", subAccountBanCommand, " ", getStaffFlagValue("BasicModeration"), true, true, "Bans a player's character."), - commandData("saban", subAccountBanCommand, " ", getStaffFlagValue("BasicModeration"), true, true, "Bans a player's character (subaccount)."), - commandData("ipban", ipBanCommand, " ", getStaffFlagValue("BasicModeration"), true, true, "Bans a player's IP."), - commandData("subnetban", subNetBanCommand, " ", getStaffFlagValue("BasicModeration"), true, true, "Bans a player's subnet."), - ], - bitFlag: [], - business: [ - commandData("addbiz", createBusinessCommand, "", getStaffFlagValue("ManageBusinesses"), true, false, "Creates a business"), - commandData("delbiz", deleteBusinessCommand, "[id]", getStaffFlagValue("ManageBusinesses"), true, true, "Deletes a business"), - //commandData("addbizloc", createBusinessLocationCommand, " ", getStaffFlagValue("ManageBusinesses"), true, false), - //commandData("delbizloc", deleteBusinessLocationCommand, "[id]", getStaffFlagValue("ManageBusinesses"), true, false), - commandData("bizreloadall", reloadAllBusinessesCommand, "", getStaffFlagValue("ManageBusinesses"), true, false, "Reloads all businesses from the database"), + ], + ammunation: [], + animation: [ + commandData("anim", playPlayerAnimationCommand, "", getStaffFlagValue("None"), true, true, "Makes your player ped use an animation"), + commandData("an", playPlayerAnimationCommand, "", getStaffFlagValue("None"), true, true, "Makes your player ped use an animation"), + commandData("e", playPlayerAnimationCommand, "", getStaffFlagValue("None"), true, true, "Makes your player ped use an animation"), + commandData("anims", showAnimationListCommand, "", getStaffFlagValue("None"), true, true, "Shows a list of animations"), + commandData("animlist", showAnimationListCommand, "", getStaffFlagValue("None"), true, true, "Shows a list of animations"), + commandData("stopanim", stopPlayerAnimationCommand, "", getStaffFlagValue("None"), true, true, "Stops your current animation"), + ], + antiCheat: [ + //commandData("setac", toggleGlobalAntiCheatCommand, "<0/1 state>", getStaffFlagValue("Developer"), true, true), + //commandData("ac", getGlobalAntiCheatStatusCommand, "<0/1 state>", getStaffFlagValue("Developer"), true, true), + ], + ban: [ + commandData("aban", accountBanCommand, " ", getStaffFlagValue("BasicModeration"), true, true, "Bans a player's account."), + commandData("acctban", accountBanCommand, " ", getStaffFlagValue("BasicModeration"), true, true, "Bans a player's account."), + commandData("cban", subAccountBanCommand, " ", getStaffFlagValue("BasicModeration"), true, true, "Bans a player's character."), + commandData("charban", subAccountBanCommand, " ", getStaffFlagValue("BasicModeration"), true, true, "Bans a player's character."), + commandData("saban", subAccountBanCommand, " ", getStaffFlagValue("BasicModeration"), true, true, "Bans a player's character (subaccount)."), + commandData("ipban", ipBanCommand, " ", getStaffFlagValue("BasicModeration"), true, true, "Bans a player's IP."), + commandData("subnetban", subNetBanCommand, " ", getStaffFlagValue("BasicModeration"), true, true, "Bans a player's subnet."), + ], + bitFlag: [], + business: [ + commandData("addbiz", createBusinessCommand, "", getStaffFlagValue("ManageBusinesses"), true, false, "Creates a business"), + commandData("delbiz", deleteBusinessCommand, "[id]", getStaffFlagValue("ManageBusinesses"), true, true, "Deletes a business"), + //commandData("addbizloc", createBusinessLocationCommand, " ", getStaffFlagValue("ManageBusinesses"), true, false), + //commandData("delbizloc", deleteBusinessLocationCommand, "[id]", getStaffFlagValue("ManageBusinesses"), true, false), + commandData("bizreloadall", reloadAllBusinessesCommand, "", getStaffFlagValue("ManageBusinesses"), true, false, "Reloads all businesses from the database"), - commandData("bizlock", lockUnlockBusinessCommand, "", getStaffFlagValue("None"), true, true, "Locks a business"), - commandData("bizlights", toggleBusinessInteriorLightsCommand, "", getStaffFlagValue("None"), true, true, "Turns on/off a business's interior lights"), - commandData("bizbuy", buyBusinessCommand, "", getStaffFlagValue("None"), true, true, "Purchases a business"), - commandData("bizfee", setBusinessEntranceFeeCommand, "", getStaffFlagValue("None"), true, true, "Sets a fee to charge players when they enter the business."), - commandData("biztill", viewBusinessTillAmountCommand, "", getStaffFlagValue("None"), true, true, "Shows the business's till (cash register) amount"), - commandData("bizbalance", viewBusinessTillAmountCommand, "", getStaffFlagValue("None"), true, true, "Shows the business's till (cash register) amount"), - commandData("bizwithdraw", withdrawFromBusinessCommand, "", getStaffFlagValue("None"), true, true, "Take money out of the business till (cash register)"), - commandData("bizdeposit", depositIntoBusinessCommand, "", getStaffFlagValue("None"), true, true, "Put money into the business till (cash register)"), - commandData("buy", buyFromBusinessCommand, " [amount]", getStaffFlagValue("None"), true, true, "Buy items from a business"), - commandData("bizstock", stockItemOnBusinessFloorCommand, " ", getStaffFlagValue("None"), true, true, "Uses storage items to restock the business with."), - commandData("bizstore", storeItemInBusinessStorageCommand, " ", getStaffFlagValue("None"), true, true, "Moves items from the business to the business storage"), - commandData("bizorder", orderItemForBusinessCommand, " ", getStaffFlagValue("None"), true, true, "Orders items to sell from a business"), - commandData("bizitemprice", setBusinessItemSellPriceCommand, " ", getStaffFlagValue("None"), true, true, "Sets the purchase price of a business item"), - commandData("bizname", setBusinessNameCommand, "", getStaffFlagValue("None"), true, true, "Changes a business name"), - commandData("bizowner", setBusinessOwnerCommand, "", getStaffFlagValue("None"), true, true, "Changes the owner of a business"), - commandData("bizdelowner", removeBusinessOwnerCommand, "", getStaffFlagValue("ManageBusinesses"), true, true, "Removes the owner of a business"), - commandData("bizpublic", setBusinessPublicCommand, "", getStaffFlagValue("ManageBusinesses"), true, true, "Changes a business to public (city hall, govt buildings, etc)"), - commandData("bizjob", setBusinessJobCommand, "", getStaffFlagValue("ManageBusinesses"), true, true, "Changes the owner of a business to a job"), - commandData("bizrank", setBusinessRankCommand, "", getStaffFlagValue("None"), true, true, "Changes the job/clan rank required to use the business"), - commandData("bizclan", setBusinessClanCommand, "", getStaffFlagValue("None"), true, true, "Changes the owner of a business to a clan"), - commandData("bizbuyprice", setBusinessBuyPriceCommand, "", getStaffFlagValue("None"), true, true, "Changes the price to buy the business"), - commandData("bizblip", setBusinessBlipCommand, "", getStaffFlagValue("ManageBusinesses"), true, true, "Sets the business blip display"), - commandData("bizpickup", setBusinessPickupCommand, "", getStaffFlagValue("ManageBusinesses"), true, true, "Sets the business pickup display"), - commandData("bizinfo", getBusinessInfoCommand, "[business id]", getStaffFlagValue("None"), true, true, "Shows business information"), - commandData("bizflooritems", getBusinessFloorItemsCommand, "[business id]", getStaffFlagValue("None"), true, true, "Shows all business floor items (for sale) to a player"), - commandData("bizflooritems", getBusinessStorageItemsCommand, "[business id]", getStaffFlagValue("None"), true, true, "Shows all business storage items (i.e. back room) to a player"), - commandData("bizentrance", moveBusinessEntranceCommand, "", getStaffFlagValue("ManageBusinesses"), true, true, "Moves the entrance (exterior point) of the business"), - commandData("bizexit", moveBusinessExitCommand, "", getStaffFlagValue("ManageBusinesses"), true, true, "Moves the exit (interior point) of the business"), - commandData("bizinttype", setBusinessInteriorTypeCommand, "", getStaffFlagValue("ManageBusinesses"), true, true, "Changes the business interior"), - commandData("bizdefaultitems", giveDefaultItemsToBusinessCommand, "", getStaffFlagValue("ManageItems"), true, true, "Gives the business the default items based on template name"), - commandData("bizdelflooritems", deleteBusinessFloorItemsCommand, "", getStaffFlagValue("ManageItems"), true, true, "Destroys all items on the business floor (for-sale items)"), - commandData("bizdelstorageitems", deleteBusinessStorageItemsCommand, "", getStaffFlagValue("ManageItems"), true, true, "Destroys all items in the business's storage"), - commandData("bizdealership", setBusinessEntranceLabelToDealershipCommand, "", getStaffFlagValue("ManageBusinesses"), true, true, "Sets the business's door label to vehicle dealership"), - ], - chat: [ - commandData("me", meActionCommand, "", getStaffFlagValue("None"), true, false, "Shows a custom action message in chat"), - commandData("do", doActionCommand, "", getStaffFlagValue("None"), true, false, "Shows a custom action description in chat"), - commandData("s", shoutCommand, "", getStaffFlagValue("None"), true, false, "Shout a message to others in the area"), - commandData("shout", shoutCommand, "", getStaffFlagValue("None"), true, false, "Shout a message to others in the area"), - commandData("talk", talkCommand, "", getStaffFlagValue("None"), true, false, "Say a message to others nearby"), - commandData("local", talkCommand, "", getStaffFlagValue("None"), true, false, "Say a message to others nearby"), - commandData("l", talkCommand, "", getStaffFlagValue("None"), true, false, "Say a message to others nearby"), - commandData("w", whisperCommand, "", getStaffFlagValue("None"), true, false, "Whisper a message to players very close to you"), - commandData("whisper", whisperCommand, "", getStaffFlagValue("None"), true, false, "Whisper a message to players very close to you"), - commandData("clanchat", clanChatCommand, "", getStaffFlagValue("None"), true, false, "Sends an OOC chat message to members in your clan"), - commandData("clan", clanChatCommand, "", getStaffFlagValue("None"), true, false, "Sends an OOC chat message to members in your clan"), - commandData("c", clanChatCommand, "", getStaffFlagValue("None"), true, false, "Sends an OOC chat message to members in your clan"), - commandData("adminchat", adminChatCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Sends an OOC chat message to other admins"), - commandData("a", adminChatCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Sends an OOC chat message to other admins"), - commandData("achat", adminChatCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Sends an OOC chat message to other admins"), - commandData("m", megaphoneChatCommand, "", getStaffFlagValue("None"), true, true, "Shouts a message over a megaphone (portable bullhorn/loudspeaker)"), - ], - clan: [ - commandData("clans", listClansCommand, "[search text]", getStaffFlagValue("None"), true, true, "List clans (search by partial name, if provided)"), - commandData("clanranks", listClanRanksCommand, "[clan name]", getStaffFlagValue("None"), true, true, "Shows a list of a clan's ranks"), - commandData("clanflags", showClanFlagListCommand, "", getStaffFlagValue("None"), true, true, "Shows a list of clan permission flags"), + commandData("bizlock", lockUnlockBusinessCommand, "", getStaffFlagValue("None"), true, true, "Locks a business"), + commandData("bizlights", toggleBusinessInteriorLightsCommand, "", getStaffFlagValue("None"), true, true, "Turns on/off a business's interior lights"), + commandData("bizbuy", buyBusinessCommand, "", getStaffFlagValue("None"), true, true, "Purchases a business"), + commandData("bizfee", setBusinessEntranceFeeCommand, "", getStaffFlagValue("None"), true, true, "Sets a fee to charge players when they enter the business."), + commandData("biztill", viewBusinessTillAmountCommand, "", getStaffFlagValue("None"), true, true, "Shows the business's till (cash register) amount"), + commandData("bizbalance", viewBusinessTillAmountCommand, "", getStaffFlagValue("None"), true, true, "Shows the business's till (cash register) amount"), + commandData("bizwithdraw", withdrawFromBusinessCommand, "", getStaffFlagValue("None"), true, true, "Take money out of the business till (cash register)"), + commandData("bizdeposit", depositIntoBusinessCommand, "", getStaffFlagValue("None"), true, true, "Put money into the business till (cash register)"), + commandData("buy", buyFromBusinessCommand, " [amount]", getStaffFlagValue("None"), true, true, "Buy items from a business"), + commandData("bizstock", stockItemOnBusinessFloorCommand, " ", getStaffFlagValue("None"), true, true, "Uses storage items to restock the business with."), + commandData("bizstore", storeItemInBusinessStorageCommand, " ", getStaffFlagValue("None"), true, true, "Moves items from the business to the business storage"), + commandData("bizorder", orderItemForBusinessCommand, " ", getStaffFlagValue("None"), true, true, "Orders items to sell from a business"), + commandData("bizitemprice", setBusinessItemSellPriceCommand, " ", getStaffFlagValue("None"), true, true, "Sets the purchase price of a business item"), + commandData("bizname", setBusinessNameCommand, "", getStaffFlagValue("None"), true, true, "Changes a business name"), + commandData("bizowner", setBusinessOwnerCommand, "", getStaffFlagValue("None"), true, true, "Changes the owner of a business"), + commandData("bizdelowner", removeBusinessOwnerCommand, "", getStaffFlagValue("ManageBusinesses"), true, true, "Removes the owner of a business"), + commandData("bizpublic", setBusinessPublicCommand, "", getStaffFlagValue("ManageBusinesses"), true, true, "Changes a business to public (city hall, govt buildings, etc)"), + commandData("bizjob", setBusinessJobCommand, "", getStaffFlagValue("ManageBusinesses"), true, true, "Changes the owner of a business to a job"), + commandData("bizrank", setBusinessRankCommand, "", getStaffFlagValue("None"), true, true, "Changes the job/clan rank required to use the business"), + commandData("bizclan", setBusinessClanCommand, "", getStaffFlagValue("None"), true, true, "Changes the owner of a business to a clan"), + commandData("bizbuyprice", setBusinessBuyPriceCommand, "", getStaffFlagValue("None"), true, true, "Changes the price to buy the business"), + commandData("bizblip", setBusinessBlipCommand, "", getStaffFlagValue("ManageBusinesses"), true, true, "Sets the business blip display"), + commandData("bizpickup", setBusinessPickupCommand, "", getStaffFlagValue("ManageBusinesses"), true, true, "Sets the business pickup display"), + commandData("bizinfo", getBusinessInfoCommand, "[business id]", getStaffFlagValue("None"), true, true, "Shows business information"), + commandData("bizflooritems", getBusinessFloorItemsCommand, "[business id]", getStaffFlagValue("None"), true, true, "Shows all business floor items (for sale) to a player"), + commandData("bizflooritems", getBusinessStorageItemsCommand, "[business id]", getStaffFlagValue("None"), true, true, "Shows all business storage items (i.e. back room) to a player"), + commandData("bizentrance", moveBusinessEntranceCommand, "", getStaffFlagValue("ManageBusinesses"), true, true, "Moves the entrance (exterior point) of the business"), + commandData("bizexit", moveBusinessExitCommand, "", getStaffFlagValue("ManageBusinesses"), true, true, "Moves the exit (interior point) of the business"), + commandData("bizinttype", setBusinessInteriorTypeCommand, "", getStaffFlagValue("ManageBusinesses"), true, true, "Changes the business interior"), + commandData("bizdefaultitems", giveDefaultItemsToBusinessCommand, "", getStaffFlagValue("ManageItems"), true, true, "Gives the business the default items based on template name"), + commandData("bizdelflooritems", deleteBusinessFloorItemsCommand, "", getStaffFlagValue("ManageItems"), true, true, "Destroys all items on the business floor (for-sale items)"), + commandData("bizdelstorageitems", deleteBusinessStorageItemsCommand, "", getStaffFlagValue("ManageItems"), true, true, "Destroys all items in the business's storage"), + commandData("bizdealership", setBusinessEntranceLabelToDealershipCommand, "", getStaffFlagValue("ManageBusinesses"), true, true, "Sets the business's door label to vehicle dealership"), + ], + chat: [ + commandData("me", meActionCommand, "", getStaffFlagValue("None"), true, false, "Shows a custom action message in chat"), + commandData("do", doActionCommand, "", getStaffFlagValue("None"), true, false, "Shows a custom action description in chat"), + commandData("s", shoutCommand, "", getStaffFlagValue("None"), true, false, "Shout a message to others in the area"), + commandData("shout", shoutCommand, "", getStaffFlagValue("None"), true, false, "Shout a message to others in the area"), + commandData("talk", talkCommand, "", getStaffFlagValue("None"), true, false, "Say a message to others nearby"), + commandData("local", talkCommand, "", getStaffFlagValue("None"), true, false, "Say a message to others nearby"), + commandData("l", talkCommand, "", getStaffFlagValue("None"), true, false, "Say a message to others nearby"), + commandData("w", whisperCommand, "", getStaffFlagValue("None"), true, false, "Whisper a message to players very close to you"), + commandData("whisper", whisperCommand, "", getStaffFlagValue("None"), true, false, "Whisper a message to players very close to you"), + commandData("clanchat", clanChatCommand, "", getStaffFlagValue("None"), true, false, "Sends an OOC chat message to members in your clan"), + commandData("clan", clanChatCommand, "", getStaffFlagValue("None"), true, false, "Sends an OOC chat message to members in your clan"), + commandData("c", clanChatCommand, "", getStaffFlagValue("None"), true, false, "Sends an OOC chat message to members in your clan"), + commandData("adminchat", adminChatCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Sends an OOC chat message to other admins"), + commandData("a", adminChatCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Sends an OOC chat message to other admins"), + commandData("achat", adminChatCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Sends an OOC chat message to other admins"), + commandData("m", megaphoneChatCommand, "", getStaffFlagValue("None"), true, true, "Shouts a message over a megaphone (portable bullhorn/loudspeaker)"), + ], + clan: [ + commandData("clans", listClansCommand, "[search text]", getStaffFlagValue("None"), true, true, "List clans (search by partial name, if provided)"), + commandData("clanranks", listClanRanksCommand, "[clan name]", getStaffFlagValue("None"), true, true, "Shows a list of a clan's ranks"), + commandData("clanflags", showClanFlagListCommand, "", getStaffFlagValue("None"), true, true, "Shows a list of clan permission flags"), - commandData("addclan", createClanCommand, "", getStaffFlagValue("ManageClans"), true, true, "Creates an new empty, unowned clan."), - commandData("delclan", deleteClanCommand, "", getStaffFlagValue("ManageClans"), true, true, "Deletes a clan by ID or name"), + commandData("addclan", createClanCommand, "", getStaffFlagValue("ManageClans"), true, true, "Creates an new empty, unowned clan."), + commandData("delclan", deleteClanCommand, "", getStaffFlagValue("ManageClans"), true, true, "Deletes a clan by ID or name"), - commandData("clanaddrank", createClanRankCommand, " ", getStaffFlagValue("None"), true, true, "Adds a clan rank"), - commandData("clandelrank", deleteClanRankCommand, "", getStaffFlagValue("None"), true, true, "Removes a clan rank"), + commandData("clanaddrank", createClanRankCommand, " ", getStaffFlagValue("None"), true, true, "Adds a clan rank"), + commandData("clandelrank", deleteClanRankCommand, "", getStaffFlagValue("None"), true, true, "Removes a clan rank"), - commandData("clansetrank", setClanMemberRankCommand, " ", getStaffFlagValue("None"), true, true, "Sets the rank of a clan member"), + commandData("clansetrank", setClanMemberRankCommand, " ", getStaffFlagValue("None"), true, true, "Sets the rank of a clan member"), - commandData("clanowner", setClanOwnerCommand, "", getStaffFlagValue("None"), true, true, "Gives ownership of the clan to a player"), - commandData("clantag", setClanTagCommand, "", getStaffFlagValue("None"), true, true, "Sets a clan's main tag"), - commandData("clanranktag", setClanRankTagCommand, " ", getStaffFlagValue("None"), true, true, "Sets a clan rank's custom tag"), - commandData("clanmembertag", setClanMemberTagCommand, " ", getStaffFlagValue("None"), true, true, "Sets a clan members's custom tag"), - commandData("clanrankname", setClanRankTitleCommand, " ", getStaffFlagValue("None"), true, true, "Sets a clan rank's title"), - commandData("clanranklevel", setClanRankLevelCommand, " ", getStaffFlagValue("None"), true, true, "Sets a clan rank's level"), - //commandData("clanrankenabled", toggleClanRankEnabledCommand, "", getStaffFlagValue("None"), true, true, "Enables/disables a clan rank"), - commandData("clanmembertitle", setClanMemberTitleCommand, " ", getStaffFlagValue("None"), true, true, "Sets a clan members's custom title"), - commandData("clanaddrankflag", addClanRankFlagCommand, "<rank name/id> <flag name>", getStaffFlagValue("None"), true, true, "Gives a clan rank a clan permission."), - commandData("clanrankflags", showClanRankFlagsCommand, "<rank name/id>", getStaffFlagValue("None"), true, true, "Lists a clan rank's permission flags"), - commandData("clandelrankflag", removeClanRankFlagCommand, "<rank name/id> <flag name>", getStaffFlagValue("None"), true, true, "Takes a clan permission from a clan rank"), - commandData("clanaddmemberflag", addClanMemberFlagCommand, "<player name/id> <flag name>", getStaffFlagValue("None"), true, true, "Gives a clan member a clan permission"), - commandData("clandelmemberflag", removeClanMemberFlagCommand, "<player name/id> <flag name>", getStaffFlagValue("None"), true, true, "Takes a clan permission from a clan member"), - ], - class: [], - client: [], - colour: [], - command: [ - commandData("cmdenabletype", enableAllCommandsByType, "<type>", getStaffFlagValue("Developer"), true, true, "Enables all commands by type."), - commandData("cmddisabletype", disableAllCommandsByType, "<type>", getStaffFlagValue("Developer"), true, true, "Disables all commands by type."), - commandData("cmdenable", enableCommand, "<command>", getStaffFlagValue("Developer"), true, true, "Enable a specific command"), - commandData("cmddisable", disableCommand, "<command>", getStaffFlagValue("Developer"), true, true, "Disables a specific command"), - ], - config: [ - commandData("settime", setTimeCommand, "<hour> [minute]", getStaffFlagValue("ManageWorld"), true, true, "Sets the time. Hours are required, minute is optional and will default to 0"), - commandData("setminuteduration", setMinuteDurationCommand, "<time in ms>", getStaffFlagValue("ManageWorld"), true, true, "Sets how long a minute lasts in milliseconds. 60000 is real time."), - commandData("setweather", setWeatherCommand, "<weather id/name>", getStaffFlagValue("ManageWorld"), true, true, "Change the weather to specified type."), - commandData("setsnow", setSnowingCommand, "<falling snow> <ground snow>", getStaffFlagValue("ManageWorld"), true, true, "Toggles winter/snow"), - commandData("setlogo", toggleServerLogoCommand, "<0/1 state>", getStaffFlagValue("ManageServer"), true, true, "Toggles the corner server logo display on/off"), - commandData("setgui", toggleServerGUICommand, "<0/1 state>", getStaffFlagValue("ManageServer"), true, true, "Toggles server GUI on/off"), - commandData("setguicolours", setServerGUIColoursCommand, "<red> <green> <blue>", getStaffFlagValue("ManageServer"), true, true), - commandData("newcharspawn", setNewCharacterSpawnPositionCommand, "", getStaffFlagValue("ManageServer"), true, true, "Sets the starting spawn position for new characters"), - commandData("newcharcash", setNewCharacterMoneyCommand, "<amount>", getStaffFlagValue("ManageServer"), true, true, "Sets the starting money for new characters"), - commandData("newcharskin", setNewCharacterSkinCommand, "[skin id]", getStaffFlagValue("ManageServer"), true, true, "Sets the default skin for new characters"), - commandData("reloadcfg", reloadServerConfigurationCommand, "", getStaffFlagValue("ManageServer"), true, true, "Loads and applies the server configuration"), - commandData("reloademailcfg", reloadEmailConfigurationCommand, "", getStaffFlagValue("Developer"), true, true, "Loads and applies the email configuration"), - commandData("reloaddbcfg", reloadDatabaseConfigurationCommand, "", getStaffFlagValue("Developer"), true, true, "Loads and applies the database configuration"), - commandData("reloadlocalecfg", reloadLocaleConfigurationCommand, "", getStaffFlagValue("Developer"), true, true, "Loads and applies the locale configuration and texts"), - commandData("reloadaccentcfg", reloadAccentConfigurationCommand, "", getStaffFlagValue("Developer"), true, true, "Loads and applies the accent configuration and texts"), + commandData("clanowner", setClanOwnerCommand, "<player name/id>", getStaffFlagValue("None"), true, true, "Gives ownership of the clan to a player"), + commandData("clantag", setClanTagCommand, "<tag>", getStaffFlagValue("None"), true, true, "Sets a clan's main tag"), + commandData("clanranktag", setClanRankTagCommand, "<rank name/id> <tag>", getStaffFlagValue("None"), true, true, "Sets a clan rank's custom tag"), + commandData("clanmembertag", setClanMemberTagCommand, "<player name/id> <tag>", getStaffFlagValue("None"), true, true, "Sets a clan members's custom tag"), + commandData("clanrankname", setClanRankTitleCommand, "<rank name/id> <new name>", getStaffFlagValue("None"), true, true, "Sets a clan rank's title"), + commandData("clanranklevel", setClanRankLevelCommand, "<rank name/id> <new level>", getStaffFlagValue("None"), true, true, "Sets a clan rank's level"), + //commandData("clanrankenabled", toggleClanRankEnabledCommand, "<rank name/id>", getStaffFlagValue("None"), true, true, "Enables/disables a clan rank"), + commandData("clanmembertitle", setClanMemberTitleCommand, "<player name/id> <title>", getStaffFlagValue("None"), true, true, "Sets a clan members's custom title"), + commandData("clanaddrankflag", addClanRankFlagCommand, "<rank name/id> <flag name>", getStaffFlagValue("None"), true, true, "Gives a clan rank a clan permission."), + commandData("clanrankflags", showClanRankFlagsCommand, "<rank name/id>", getStaffFlagValue("None"), true, true, "Lists a clan rank's permission flags"), + commandData("clandelrankflag", removeClanRankFlagCommand, "<rank name/id> <flag name>", getStaffFlagValue("None"), true, true, "Takes a clan permission from a clan rank"), + commandData("clanaddmemberflag", addClanMemberFlagCommand, "<player name/id> <flag name>", getStaffFlagValue("None"), true, true, "Gives a clan member a clan permission"), + commandData("clandelmemberflag", removeClanMemberFlagCommand, "<player name/id> <flag name>", getStaffFlagValue("None"), true, true, "Takes a clan permission from a clan member"), + ], + class: [], + client: [], + colour: [], + command: [ + commandData("cmdenabletype", enableAllCommandsByType, "<type>", getStaffFlagValue("Developer"), true, true, "Enables all commands by type."), + commandData("cmddisabletype", disableAllCommandsByType, "<type>", getStaffFlagValue("Developer"), true, true, "Disables all commands by type."), + commandData("cmdenable", enableCommand, "<command>", getStaffFlagValue("Developer"), true, true, "Enable a specific command"), + commandData("cmddisable", disableCommand, "<command>", getStaffFlagValue("Developer"), true, true, "Disables a specific command"), + ], + config: [ + commandData("settime", setTimeCommand, "<hour> [minute]", getStaffFlagValue("ManageWorld"), true, true, "Sets the time. Hours are required, minute is optional and will default to 0"), + commandData("setminuteduration", setMinuteDurationCommand, "<time in ms>", getStaffFlagValue("ManageWorld"), true, true, "Sets how long a minute lasts in milliseconds. 60000 is real time."), + commandData("setweather", setWeatherCommand, "<weather id/name>", getStaffFlagValue("ManageWorld"), true, true, "Change the weather to specified type."), + commandData("setsnow", setSnowingCommand, "<falling snow> <ground snow>", getStaffFlagValue("ManageWorld"), true, true, "Toggles winter/snow"), + commandData("setlogo", toggleServerLogoCommand, "<0/1 state>", getStaffFlagValue("ManageServer"), true, true, "Toggles the corner server logo display on/off"), + commandData("setgui", toggleServerGUICommand, "<0/1 state>", getStaffFlagValue("ManageServer"), true, true, "Toggles server GUI on/off"), + commandData("setguicolours", setServerGUIColoursCommand, "<red> <green> <blue>", getStaffFlagValue("ManageServer"), true, true), + commandData("newcharspawn", setNewCharacterSpawnPositionCommand, "", getStaffFlagValue("ManageServer"), true, true, "Sets the starting spawn position for new characters"), + commandData("newcharcash", setNewCharacterMoneyCommand, "<amount>", getStaffFlagValue("ManageServer"), true, true, "Sets the starting money for new characters"), + commandData("newcharskin", setNewCharacterSkinCommand, "[skin id]", getStaffFlagValue("ManageServer"), true, true, "Sets the default skin for new characters"), + commandData("reloadcfg", reloadServerConfigurationCommand, "", getStaffFlagValue("ManageServer"), true, true, "Loads and applies the server configuration"), + commandData("reloademailcfg", reloadEmailConfigurationCommand, "", getStaffFlagValue("Developer"), true, true, "Loads and applies the email configuration"), + commandData("reloaddbcfg", reloadDatabaseConfigurationCommand, "", getStaffFlagValue("Developer"), true, true, "Loads and applies the database configuration"), + commandData("reloadlocalecfg", reloadLocaleConfigurationCommand, "", getStaffFlagValue("Developer"), true, true, "Loads and applies the locale configuration and texts"), + commandData("reloadaccentcfg", reloadAccentConfigurationCommand, "", getStaffFlagValue("Developer"), true, true, "Loads and applies the accent configuration and texts"), - commandData("setbizblips", toggleServerBusinessBlipsCommand, "<0/1 state>", getStaffFlagValue("ManageServer"), true, true, "Toggles all business blips on/off"), - commandData("sethouseblips", toggleServerHouseBlipsCommand, "<0/1 state>", getStaffFlagValue("ManageServer"), true, true, "Toggles all house blips on/off"), - commandData("setjobblips", toggleServerJobBlipsCommand, "<0/1 state>", getStaffFlagValue("ManageServer"), true, true, "Toggles all job blips on/off"), - commandData("setbizpickups", toggleServerBusinessPickupsCommand, "<0/1 state>", getStaffFlagValue("ManageServer"), true, true, "Toggles all business pickups on/off"), - commandData("sethousepickups", toggleServerHousePickupsCommand, "<0/1 state>", getStaffFlagValue("ManageServer"), true, true, "Toggles all house pickups on/off"), - commandData("setjobpickups", toggleServerJobPickupsCommand, "<0/1 state>", getStaffFlagValue("ManageServer"), true, true, "Toggles all job pickups on/off"), - ], - core: [], - database: [ - commandData("dbquery", executeDatabaseQueryCommand, "<query>", getStaffFlagValue("Developer"), true, true), - //commandData("dbinfo", getDatabaseInfoCommand, "", getStaffFlagValue("Developer"), true, true), - ], - developer: [ - commandData("scode", executeServerCodeCommand, "<code>", getStaffFlagValue("Developer"), true, true), - commandData("ccode", executeClientCodeCommand, "<code>", getStaffFlagValue("Developer"), true, true), - commandData("gmx", restartGameModeCommand, "", getStaffFlagValue("Developer"), true, true), - commandData("saveall", saveAllServerDataCommand, "", getStaffFlagValue("Developer"), true, true), - commandData("docmd", simulateCommandForPlayerCommand, "<player name/id> <command> [params]", getStaffFlagValue("Developer"), true, true), - commandData("docmdall", simulateCommandForAllPlayersCommand, "<command> [params]", getStaffFlagValue("Developer"), true, true), - commandData("addloglvl", addLogLevelCommand, "<log level name>", getStaffFlagValue("Developer"), true, true), - commandData("delloglvl", removeLogLevelCommand, "<log level name>", getStaffFlagValue("Developer"), true, true), - commandData("loglvl", getLogLevelCommand, "<log level name>", getStaffFlagValue("Developer"), true, true), + commandData("setbizblips", toggleServerBusinessBlipsCommand, "<0/1 state>", getStaffFlagValue("ManageServer"), true, true, "Toggles all business blips on/off"), + commandData("sethouseblips", toggleServerHouseBlipsCommand, "<0/1 state>", getStaffFlagValue("ManageServer"), true, true, "Toggles all house blips on/off"), + commandData("setjobblips", toggleServerJobBlipsCommand, "<0/1 state>", getStaffFlagValue("ManageServer"), true, true, "Toggles all job blips on/off"), + commandData("setbizpickups", toggleServerBusinessPickupsCommand, "<0/1 state>", getStaffFlagValue("ManageServer"), true, true, "Toggles all business pickups on/off"), + commandData("sethousepickups", toggleServerHousePickupsCommand, "<0/1 state>", getStaffFlagValue("ManageServer"), true, true, "Toggles all house pickups on/off"), + commandData("setjobpickups", toggleServerJobPickupsCommand, "<0/1 state>", getStaffFlagValue("ManageServer"), true, true, "Toggles all job pickups on/off"), + ], + core: [], + database: [ + commandData("dbquery", executeDatabaseQueryCommand, "<query>", getStaffFlagValue("Developer"), true, true), + //commandData("dbinfo", getDatabaseInfoCommand, "", getStaffFlagValue("Developer"), true, true), + ], + developer: [ + commandData("scode", executeServerCodeCommand, "<code>", getStaffFlagValue("Developer"), true, true), + commandData("ccode", executeClientCodeCommand, "<code>", getStaffFlagValue("Developer"), true, true), + commandData("gmx", restartGameModeCommand, "", getStaffFlagValue("Developer"), true, true), + commandData("saveall", saveAllServerDataCommand, "", getStaffFlagValue("Developer"), true, true), + commandData("docmd", simulateCommandForPlayerCommand, "<player name/id> <command> [params]", getStaffFlagValue("Developer"), true, true), + commandData("docmdall", simulateCommandForAllPlayersCommand, "<command> [params]", getStaffFlagValue("Developer"), true, true), + commandData("addloglvl", addLogLevelCommand, "<log level name>", getStaffFlagValue("Developer"), true, true), + commandData("delloglvl", removeLogLevelCommand, "<log level name>", getStaffFlagValue("Developer"), true, true), + commandData("loglvl", getLogLevelCommand, "<log level name>", getStaffFlagValue("Developer"), true, true), - commandData("nosave", togglePauseSavingToDatabaseCommand, "", getStaffFlagValue("Developer"), true, true), - commandData("streamurlall", streamAudioURLToAllPlayersCommand, "<url> <volume>", getStaffFlagValue("Developer"), true, true), - commandData("streamnameall", streamAudioNameToAllPlayersCommand, "<name> <volume>", getStaffFlagValue("Developer"), true, true), + commandData("nosave", togglePauseSavingToDatabaseCommand, "", getStaffFlagValue("Developer"), true, true), + commandData("streamurlall", streamAudioURLToAllPlayersCommand, "<url> <volume>", getStaffFlagValue("Developer"), true, true), + commandData("streamnameall", streamAudioNameToAllPlayersCommand, "<name> <volume>", getStaffFlagValue("Developer"), true, true), - commandData("forceresetpass", forceAccountPasswordResetCommand, "<account name>", getStaffFlagValue("Developer"), true, true), - commandData("fixblips", fixAllServerBlipsCommand, "", getStaffFlagValue("Developer"), true, true), - commandData("fixpickups", fixAllServerPickupsCommand, "", getStaffFlagValue("Developer"), true, true), - commandData("resetambience", resetAllServerAmbienceElementsCommand, "", getStaffFlagValue("ManageWorld"), true, true), - ], - discord: [], - economy: [ - commandData("tax", taxInfoCommand, "", getStaffFlagValue("None"), true, true), - commandData("wealth", wealthInfoCommand, "", getStaffFlagValue("None"), true, true), - commandData("forcepayday", forcePlayerPayDayCommand, "<player name/id>", getStaffFlagValue("ManageServer"), true, true, "Gives a player an instant payday."), - ], - email: [ - commandData("testemail", testEmailCommand, "<email address>", getStaffFlagValue("Developer"), true, true), - ], - help: [ - commandData("help", helpCommand, "", getStaffFlagValue("None"), false, false), - commandData("commands", helpCommand, "", getStaffFlagValue("None"), false, false), - commandData("cmds", helpCommand, "", getStaffFlagValue("None"), false, false), - commandData("info", helpCommand, "", getStaffFlagValue("None"), false, false), - commandData("veh", helpGetCarCommand, "", getStaffFlagValue("None"), false, false), - commandData("v", helpGetCarCommand, "", getStaffFlagValue("None"), false, false), - commandData("car", helpGetCarCommand, "", getStaffFlagValue("None"), false, false), - commandData("cars", helpGetCarCommand, "", getStaffFlagValue("None"), false, false), - commandData("spawncar", helpGetCarCommand, "", getStaffFlagValue("None"), false, false), - commandData("spawnveh", helpGetCarCommand, "", getStaffFlagValue("None"), false, false), - commandData("skin", helpGetSkinCommand, "", getStaffFlagValue("None"), false, false), - commandData("skins", helpGetSkinCommand, "", getStaffFlagValue("None"), false, false), - commandData("clothes", helpGetSkinCommand, "", getStaffFlagValue("None"), false, false), - //commandData("setskin", helpGetSkinCommand, "", getStaffFlagValue("None"), false, false), - commandData("changeskin", helpGetSkinCommand, "", getStaffFlagValue("None"), false, false), - ], - house: [ - commandData("addhouse", createHouseCommand, "<description>", getStaffFlagValue("ManageHouses"), true, false), - commandData("delhouse", deleteHouseCommand, "", getStaffFlagValue("ManageHouses"), true, false), - commandData("housereloadall", reloadAllHousesCommand, "", getStaffFlagValue("ManageHouses"), true, false), + commandData("forceresetpass", forceAccountPasswordResetCommand, "<account name>", getStaffFlagValue("Developer"), true, true), + commandData("fixblips", fixAllServerBlipsCommand, "", getStaffFlagValue("Developer"), true, true), + commandData("fixpickups", fixAllServerPickupsCommand, "", getStaffFlagValue("Developer"), true, true), + commandData("resetambience", resetAllServerAmbienceElementsCommand, "", getStaffFlagValue("ManageWorld"), true, true), + ], + discord: [], + economy: [ + commandData("tax", taxInfoCommand, "", getStaffFlagValue("None"), true, true), + commandData("wealth", wealthInfoCommand, "", getStaffFlagValue("None"), true, true), + commandData("forcepayday", forcePlayerPayDayCommand, "<player name/id>", getStaffFlagValue("ManageServer"), true, true, "Gives a player an instant payday."), + ], + email: [ + commandData("testemail", testEmailCommand, "<email address>", getStaffFlagValue("Developer"), true, true), + ], + help: [ + commandData("help", helpCommand, "", getStaffFlagValue("None"), false, false), + commandData("commands", helpCommand, "", getStaffFlagValue("None"), false, false), + commandData("cmds", helpCommand, "", getStaffFlagValue("None"), false, false), + commandData("info", helpCommand, "", getStaffFlagValue("None"), false, false), + commandData("veh", helpGetCarCommand, "", getStaffFlagValue("None"), false, false), + commandData("v", helpGetCarCommand, "", getStaffFlagValue("None"), false, false), + commandData("car", helpGetCarCommand, "", getStaffFlagValue("None"), false, false), + commandData("cars", helpGetCarCommand, "", getStaffFlagValue("None"), false, false), + commandData("spawncar", helpGetCarCommand, "", getStaffFlagValue("None"), false, false), + commandData("spawnveh", helpGetCarCommand, "", getStaffFlagValue("None"), false, false), + commandData("skin", helpGetSkinCommand, "", getStaffFlagValue("None"), false, false), + commandData("skins", helpGetSkinCommand, "", getStaffFlagValue("None"), false, false), + commandData("clothes", helpGetSkinCommand, "", getStaffFlagValue("None"), false, false), + //commandData("setskin", helpGetSkinCommand, "", getStaffFlagValue("None"), false, false), + commandData("changeskin", helpGetSkinCommand, "", getStaffFlagValue("None"), false, false), + ], + house: [ + commandData("addhouse", createHouseCommand, "<description>", getStaffFlagValue("ManageHouses"), true, false), + commandData("delhouse", deleteHouseCommand, "", getStaffFlagValue("ManageHouses"), true, false), + commandData("housereloadall", reloadAllHousesCommand, "", getStaffFlagValue("ManageHouses"), true, false), - commandData("houseinfo", getHouseInfoCommand, "", getStaffFlagValue("None"), true, false), - commandData("housebuy", buyHouseCommand, "", getStaffFlagValue("None"), true, false), - commandData("houseclan", setHouseClanCommand, "", getStaffFlagValue("None"), true, false), - commandData("housedesc", setHouseDescriptionCommand, "", getStaffFlagValue("ManageHouses"), true, false), - commandData("houselock", lockUnlockHouseCommand, "", getStaffFlagValue("None"), true, false), - commandData("houselights", toggleHouseInteriorLightsCommand, "", getStaffFlagValue("None"), true, false), - commandData("houseowner", setHouseOwnerCommand, "", getStaffFlagValue("None"), true, false), - commandData("housebuyprice", setHouseBuyPriceCommand, "", getStaffFlagValue("None"), true, false), - commandData("houserentprice", setHouseRentPriceCommand, "", getStaffFlagValue("None"), true, false), - commandData("houseblip", setHouseBlipCommand, "<type name/model id>", getStaffFlagValue("ManageHouses"), true, true), - commandData("housepickup", setHousePickupCommand, "<type name/model id>", getStaffFlagValue("ManageHouses"), true, true), - commandData("houseentrance", moveHouseEntranceCommand, "", getStaffFlagValue("ManageHouses"), true, true), - commandData("houseexit", moveHouseExitCommand, "", getStaffFlagValue("ManageHouses"), true, true), - commandData("houseinttype", setHouseInteriorTypeCommand, "<interior template name/business id>", getStaffFlagValue("ManageHouses"), true, true), - ], - item: [ - commandData("i", playerSwitchHotBarSlotCommand, "<slot id>", getStaffFlagValue("None"), true, false, "Switches to the item in the specified slot of your inventory."), - commandData("item", playerSwitchHotBarSlotCommand, "<slot id>", getStaffFlagValue("None"), true, false, "Switches to the item in the specified slot of your inventory."), - commandData("addgrounditem", createGroundItemCommand, "<item name/id>", getStaffFlagValue("ManageItems"), true, false, "Spawns a new item on the ground at your position."), - commandData("additem", createItemCommand, "<item name/id>", getStaffFlagValue("ManageItems"), true, false, "Spawns a new item in your hotbar inventory."), - commandData("delgrounditem", deleteGroundItemCommand, "", getStaffFlagValue("ManageItems"), true, false, "Destroys the nearest item on the ground."), - commandData("pickup", pickupItemCommand, "", getStaffFlagValue("None"), true, false, "Picks up the nearest item."), - commandData("drop", dropItemCommand, "[slot]", getStaffFlagValue("None"), true, false, "Drops your currently equipped item or the item in the specified slot"), - commandData("put", putItemCommand, "[slot]", getStaffFlagValue("None"), true, false, "Puts an item from your inventory into the nearest item place (vehicle trunk/dash, house, business, etc)"), - commandData("take", takeItemCommand, "[slot]", getStaffFlagValue("None"), true, false, "Takes an item from the nearest item place (vehicle trunk, dash, house, business, etc)"), - commandData("use", useItemCommand, "", getStaffFlagValue("None"), true, false, "Uses the currently equipped item"), - commandData("inv", listPlayerInventoryCommand, "", getStaffFlagValue("None"), true, false, "Shows the items in your inventory"), - commandData("inventory", listPlayerInventoryCommand, "", getStaffFlagValue("None"), true, false, "Shows the items in your inventory"), + commandData("houseinfo", getHouseInfoCommand, "", getStaffFlagValue("None"), true, false), + commandData("housebuy", buyHouseCommand, "", getStaffFlagValue("None"), true, false), + commandData("houseclan", setHouseClanCommand, "", getStaffFlagValue("None"), true, false), + commandData("housedesc", setHouseDescriptionCommand, "", getStaffFlagValue("ManageHouses"), true, false), + commandData("houselock", lockUnlockHouseCommand, "", getStaffFlagValue("None"), true, false), + commandData("houselights", toggleHouseInteriorLightsCommand, "", getStaffFlagValue("None"), true, false), + commandData("houseowner", setHouseOwnerCommand, "", getStaffFlagValue("None"), true, false), + commandData("housebuyprice", setHouseBuyPriceCommand, "", getStaffFlagValue("None"), true, false), + commandData("houserentprice", setHouseRentPriceCommand, "", getStaffFlagValue("None"), true, false), + commandData("houseblip", setHouseBlipCommand, "<type name/model id>", getStaffFlagValue("ManageHouses"), true, true), + commandData("housepickup", setHousePickupCommand, "<type name/model id>", getStaffFlagValue("ManageHouses"), true, true), + commandData("houseentrance", moveHouseEntranceCommand, "", getStaffFlagValue("ManageHouses"), true, true), + commandData("houseexit", moveHouseExitCommand, "", getStaffFlagValue("ManageHouses"), true, true), + commandData("houseinttype", setHouseInteriorTypeCommand, "<interior template name/business id>", getStaffFlagValue("ManageHouses"), true, true), + ], + item: [ + commandData("i", playerSwitchHotBarSlotCommand, "<slot id>", getStaffFlagValue("None"), true, false, "Switches to the item in the specified slot of your inventory."), + commandData("item", playerSwitchHotBarSlotCommand, "<slot id>", getStaffFlagValue("None"), true, false, "Switches to the item in the specified slot of your inventory."), + commandData("addgrounditem", createGroundItemCommand, "<item name/id>", getStaffFlagValue("ManageItems"), true, false, "Spawns a new item on the ground at your position."), + commandData("additem", createItemCommand, "<item name/id>", getStaffFlagValue("ManageItems"), true, false, "Spawns a new item in your hotbar inventory."), + commandData("delgrounditem", deleteGroundItemCommand, "", getStaffFlagValue("ManageItems"), true, false, "Destroys the nearest item on the ground."), + commandData("pickup", pickupItemCommand, "", getStaffFlagValue("None"), true, false, "Picks up the nearest item."), + commandData("drop", dropItemCommand, "[slot]", getStaffFlagValue("None"), true, false, "Drops your currently equipped item or the item in the specified slot"), + commandData("put", putItemCommand, "[slot]", getStaffFlagValue("None"), true, false, "Puts an item from your inventory into the nearest item place (vehicle trunk/dash, house, business, etc)"), + commandData("take", takeItemCommand, "[slot]", getStaffFlagValue("None"), true, false, "Takes an item from the nearest item place (vehicle trunk, dash, house, business, etc)"), + commandData("use", useItemCommand, "", getStaffFlagValue("None"), true, false, "Uses the currently equipped item"), + commandData("inv", listPlayerInventoryCommand, "", getStaffFlagValue("None"), true, false, "Shows the items in your inventory"), + commandData("inventory", listPlayerInventoryCommand, "", getStaffFlagValue("None"), true, false, "Shows the items in your inventory"), - commandData("items", listItemInventoryCommand, "", getStaffFlagValue("None"), true, false, "Shows the items in your inventory"), - commandData("houseitems", listHouseInventoryCommand, "", getStaffFlagValue("None"), true, false, "Shows the items in the house's storage"), - commandData("bizstorage", listBusinessStorageInventoryCommand, "", getStaffFlagValue("None"), true, false, "Shows the items in the business's extra storage (not buyable)"), - commandData("bizfloor", listBusinessFloorInventoryCommand, "", getStaffFlagValue("None"), true, false, "Shows the items that can be bought from the business"), - commandData("buylist", listBusinessFloorInventoryCommand, "", getStaffFlagValue("None"), true, false, "Shows the items that can be bought from the business"), + commandData("items", listItemInventoryCommand, "", getStaffFlagValue("None"), true, false, "Shows the items in your inventory"), + commandData("houseitems", listHouseInventoryCommand, "", getStaffFlagValue("None"), true, false, "Shows the items in the house's storage"), + commandData("bizstorage", listBusinessStorageInventoryCommand, "", getStaffFlagValue("None"), true, false, "Shows the items in the business's extra storage (not buyable)"), + commandData("bizfloor", listBusinessFloorInventoryCommand, "", getStaffFlagValue("None"), true, false, "Shows the items that can be bought from the business"), + commandData("buylist", listBusinessFloorInventoryCommand, "", getStaffFlagValue("None"), true, false, "Shows the items that can be bought from the business"), - commandData("power", toggleItemEnabledCommand, "", getStaffFlagValue("None"), true, false), - commandData("freq", setWalkieTalkieFrequencyCommand, "[frequncy number]", getStaffFlagValue("None"), true, false), - //commandData("call", callWithPhoneCommand, "[number]", getStaffFlagValue("None"), true, false), - //commandData("speakerphone", togglePhoneSpeakerCommand, "", getStaffFlagValue("None"), true, false), - commandData("radio", walkieTalkieChatCommand, "", getStaffFlagValue("None"), true, false), - commandData("r", walkieTalkieChatCommand, "", getStaffFlagValue("None"), true, false), + commandData("power", toggleItemEnabledCommand, "", getStaffFlagValue("None"), true, false), + commandData("freq", setWalkieTalkieFrequencyCommand, "[frequncy number]", getStaffFlagValue("None"), true, false), + //commandData("call", callWithPhoneCommand, "[number]", getStaffFlagValue("None"), true, false), + //commandData("speakerphone", togglePhoneSpeakerCommand, "", getStaffFlagValue("None"), true, false), + commandData("radio", walkieTalkieChatCommand, "", getStaffFlagValue("None"), true, false), + commandData("r", walkieTalkieChatCommand, "", getStaffFlagValue("None"), true, false), - commandData("additemtype", createItemTypeCommand, "<name>", getStaffFlagValue("ManageItems"), true, false), - commandData("itemtypeusetype", setItemTypeUseTypeCommand, "<item type> <use type>", getStaffFlagValue("ManageItems"), true, false), - commandData("itemtypeuseval", setItemTypeUseValueCommand, "<item type> <use value>", getStaffFlagValue("ManageItems"), true, false), - commandData("itemtypeorderprice", setItemTypeOrderPriceCommand, "<item type> <price>", getStaffFlagValue("ManageItems"), true, false), - commandData("itemtyperiskmult", setItemTypeRiskMultiplierCommand, "<item type> <risk multiplier>", getStaffFlagValue("ManageItems"), true, false), - commandData("itemtypeenabled", toggleItemTypeEnabledCommand, "<item type>", getStaffFlagValue("ManageItems"), true, false), + commandData("additemtype", createItemTypeCommand, "<name>", getStaffFlagValue("ManageItems"), true, false), + commandData("itemtypeusetype", setItemTypeUseTypeCommand, "<item type> <use type>", getStaffFlagValue("ManageItems"), true, false), + commandData("itemtypeuseval", setItemTypeUseValueCommand, "<item type> <use value>", getStaffFlagValue("ManageItems"), true, false), + commandData("itemtypeorderprice", setItemTypeOrderPriceCommand, "<item type> <price>", getStaffFlagValue("ManageItems"), true, false), + commandData("itemtyperiskmult", setItemTypeRiskMultiplierCommand, "<item type> <risk multiplier>", getStaffFlagValue("ManageItems"), true, false), + commandData("itemtypeenabled", toggleItemTypeEnabledCommand, "<item type>", getStaffFlagValue("ManageItems"), true, false), - commandData("delplritem", deleteItemInPlayerInventoryCommand, "<player name/id> <item slot>", getStaffFlagValue("ManageItems"), true, false), - commandData("delplritems", deleteAllItemsInPlayerInventoryCommand, "<player name/id>", getStaffFlagValue("ManageItems"), true, false), - ], - job: [ - commandData("takejob", takeJobCommand, "", getStaffFlagValue("None"), true, false), - commandData("startwork", startWorkingCommand, "", getStaffFlagValue("None"), true, false), - commandData("stopwork", stopWorkingCommand, "", getStaffFlagValue("None"), true, false), - commandData("startjob", startWorkingCommand, "", getStaffFlagValue("None"), true, false), - commandData("stopjob", stopWorkingCommand, "", getStaffFlagValue("None"), true, false), - commandData("quitjob", quitJobCommand, "", getStaffFlagValue("None"), true, false), - commandData("uniform", jobUniformCommand, "[uniform]", getStaffFlagValue("None"), true, false), - commandData("equip", jobEquipmentCommand, "[equipment]", getStaffFlagValue("None"), true, false), + commandData("delplritem", deleteItemInPlayerInventoryCommand, "<player name/id> <item slot>", getStaffFlagValue("ManageItems"), true, false), + commandData("delplritems", deleteAllItemsInPlayerInventoryCommand, "<player name/id>", getStaffFlagValue("ManageItems"), true, false), + ], + job: [ + commandData("takejob", takeJobCommand, "", getStaffFlagValue("None"), true, false), + commandData("startwork", startWorkingCommand, "", getStaffFlagValue("None"), true, false), + commandData("stopwork", stopWorkingCommand, "", getStaffFlagValue("None"), true, false), + commandData("startjob", startWorkingCommand, "", getStaffFlagValue("None"), true, false), + commandData("stopjob", stopWorkingCommand, "", getStaffFlagValue("None"), true, false), + commandData("quitjob", quitJobCommand, "", getStaffFlagValue("None"), true, false), + commandData("uniform", jobUniformCommand, "[uniform]", getStaffFlagValue("None"), true, false), + commandData("equip", jobEquipmentCommand, "[equipment]", getStaffFlagValue("None"), true, false), - commandData("department", jobDepartmentRadioCommand, "", getStaffFlagValue("None"), true, false), - commandData("d", jobDepartmentRadioCommand, "", getStaffFlagValue("None"), true, false), + commandData("department", jobDepartmentRadioCommand, "", getStaffFlagValue("None"), true, false), + commandData("d", jobDepartmentRadioCommand, "", getStaffFlagValue("None"), true, false), - // Taxi - commandData("fare", taxiSetFareCommand, "", getStaffFlagValue("None"), true, false), + // Taxi + commandData("fare", taxiSetFareCommand, "", getStaffFlagValue("None"), true, false), - // Police - commandData("detain", policeDetainCommand, "", getStaffFlagValue("None"), true, false), - commandData("drag", policeDragCommand, "", getStaffFlagValue("None"), true, false), - commandData("search", policeSearchCommand, "", getStaffFlagValue("None"), true, false), + // Police + commandData("detain", policeDetainCommand, "", getStaffFlagValue("None"), true, false), + commandData("drag", policeDragCommand, "", getStaffFlagValue("None"), true, false), + commandData("search", policeSearchCommand, "", getStaffFlagValue("None"), true, false), - // Routes - commandData("startroute", jobStartRouteCommand, "", getStaffFlagValue("None"), true, false), - commandData("stoproute", jobStopRouteCommand, "", getStaffFlagValue("None"), true, false), + // Routes + commandData("startroute", jobStartRouteCommand, "", getStaffFlagValue("None"), true, false), + commandData("stoproute", jobStopRouteCommand, "", getStaffFlagValue("None"), true, false), - // Admin Job Stuff - commandData("addjob", createJobCommand, "<name>", getStaffFlagValue("ManageJobs"), true, false), - commandData("addjobloc", createJobLocationCommand, "<job name/id>", getStaffFlagValue("ManageJobs"), true, false), - commandData("deljobloc", deleteJobLocationCommand, "", getStaffFlagValue("ManageJobs"), true, false), - commandData("addjobroute", createJobRouteCommand, "<name>", getStaffFlagValue("ManageJobs"), true, false), - commandData("addjobrouteloc", createJobRouteLocationCommand, "<name>", getStaffFlagValue("ManageJobs"), true, false), - commandData("deljobroute", deleteJobRouteCommand, "", getStaffFlagValue("ManageJobs"), true, false), - commandData("deljobrouteloc", deleteJobRouteLocationCommand, "", getStaffFlagValue("ManageJobs"), true, false), - commandData("jobroutename", setJobRouteNameCommand, "<name>", getStaffFlagValue("ManageJobs"), true, false), - commandData("jobroutepay", setJobRoutePayCommand, "<amount>", getStaffFlagValue("ManageJobs"), true, false), - commandData("jobroutestartmsg", setJobRouteStartMessageCommand, "<new message>", getStaffFlagValue("ManageJobs"), true, false), - commandData("jobroutefinishmsg", setJobRouteFinishMessageCommand, "<new message>", getStaffFlagValue("ManageJobs"), true, false), - commandData("jobroutelocarrivemsg", setJobRouteLocationArriveMessageCommand, "<new message>", getStaffFlagValue("ManageJobs"), true, false), - commandData("jobroutelocnextmsg", setJobRouteLocationNextMessageCommand, "<new message>", getStaffFlagValue("ManageJobs"), true, false), - commandData("jobrouteenabled", toggleJobRouteEnabledCommand, "", getStaffFlagValue("ManageJobs"), true, false), - commandData("jobroutevehcolours", setJobRouteVehicleColoursCommand, "<colour 1> <colour 2>", getStaffFlagValue("ManageJobs"), true, false), - commandData("jobroutedelays", setJobRouteAllLocationDelaysCommand, "<time in milliseconds>", getStaffFlagValue("ManageJobs"), true, false), + // Admin Job Stuff + commandData("addjob", createJobCommand, "<name>", getStaffFlagValue("ManageJobs"), true, false), + commandData("addjobloc", createJobLocationCommand, "<job name/id>", getStaffFlagValue("ManageJobs"), true, false), + commandData("deljobloc", deleteJobLocationCommand, "", getStaffFlagValue("ManageJobs"), true, false), + commandData("addjobroute", createJobRouteCommand, "<name>", getStaffFlagValue("ManageJobs"), true, false), + commandData("addjobrouteloc", createJobRouteLocationCommand, "<name>", getStaffFlagValue("ManageJobs"), true, false), + commandData("deljobroute", deleteJobRouteCommand, "", getStaffFlagValue("ManageJobs"), true, false), + commandData("deljobrouteloc", deleteJobRouteLocationCommand, "", getStaffFlagValue("ManageJobs"), true, false), + commandData("jobroutename", setJobRouteNameCommand, "<name>", getStaffFlagValue("ManageJobs"), true, false), + commandData("jobroutepay", setJobRoutePayCommand, "<amount>", getStaffFlagValue("ManageJobs"), true, false), + commandData("jobroutestartmsg", setJobRouteStartMessageCommand, "<new message>", getStaffFlagValue("ManageJobs"), true, false), + commandData("jobroutefinishmsg", setJobRouteFinishMessageCommand, "<new message>", getStaffFlagValue("ManageJobs"), true, false), + commandData("jobroutelocarrivemsg", setJobRouteLocationArriveMessageCommand, "<new message>", getStaffFlagValue("ManageJobs"), true, false), + commandData("jobroutelocnextmsg", setJobRouteLocationNextMessageCommand, "<new message>", getStaffFlagValue("ManageJobs"), true, false), + commandData("jobrouteenabled", toggleJobRouteEnabledCommand, "", getStaffFlagValue("ManageJobs"), true, false), + commandData("jobroutevehcolours", setJobRouteVehicleColoursCommand, "<colour 1> <colour 2>", getStaffFlagValue("ManageJobs"), true, false), + commandData("jobroutedelays", setJobRouteAllLocationDelaysCommand, "<time in milliseconds>", getStaffFlagValue("ManageJobs"), true, false), - commandData("jobcolour", setJobColourCommand, "<job id/name> <red> <green> <blue>", getStaffFlagValue("ManageJobs"), true, false), - commandData("jobblip", setJobBlipCommand, "<job id/name> <blip id/name>", getStaffFlagValue("ManageJobs"), true, false), - commandData("jobpickup", setJobPickupCommand, "<job id/name> <pickup id/name>", getStaffFlagValue("ManageJobs"), true, false), - commandData("jobwl", toggleJobWhiteListCommand, "[job id]", getStaffFlagValue("ManageJobs"), true, false), - commandData("jobwhitelist", toggleJobWhiteListCommand, "[job id]", getStaffFlagValue("ManageJobs"), true, false), - commandData("jobblacklist", toggleJobBlackListCommand, "[job id]", getStaffFlagValue("ManageJobs"), true, false), - commandData("jobbl", toggleJobBlackListCommand, "[job id]", getStaffFlagValue("ManageJobs"), true, false), - commandData("jobtoggle", toggleJobEnabledCommand, "[job id]", getStaffFlagValue("ManageJobs"), true, false), - commandData("jobaddplayerwl", addPlayerToJobWhiteListCommand, "<player name/id> [job id]", getStaffFlagValue("ManageJobs"), true, false), - commandData("jobaddplayerbl", addPlayerToJobBlackListCommand, "<player name/id> [job id]", getStaffFlagValue("ManageJobs"), true, false), - commandData("jobdelplayerbl", removePlayerFromJobBlackListCommand, "<player name/id> [job id]", getStaffFlagValue("ManageJobs"), true, false), - commandData("jobdelplayerbl", removePlayerFromJobWhiteListCommand, "<player name/id> [job id]", getStaffFlagValue("ManageJobs"), true, false), - commandData("jobreloadall", reloadAllJobsCommand, "", getStaffFlagValue("ManageJobs"), true, false), + commandData("jobcolour", setJobColourCommand, "<job id/name> <red> <green> <blue>", getStaffFlagValue("ManageJobs"), true, false), + commandData("jobblip", setJobBlipCommand, "<job id/name> <blip id/name>", getStaffFlagValue("ManageJobs"), true, false), + commandData("jobpickup", setJobPickupCommand, "<job id/name> <pickup id/name>", getStaffFlagValue("ManageJobs"), true, false), + commandData("jobwl", toggleJobWhiteListCommand, "[job id]", getStaffFlagValue("ManageJobs"), true, false), + commandData("jobwhitelist", toggleJobWhiteListCommand, "[job id]", getStaffFlagValue("ManageJobs"), true, false), + commandData("jobblacklist", toggleJobBlackListCommand, "[job id]", getStaffFlagValue("ManageJobs"), true, false), + commandData("jobbl", toggleJobBlackListCommand, "[job id]", getStaffFlagValue("ManageJobs"), true, false), + commandData("jobtoggle", toggleJobEnabledCommand, "[job id]", getStaffFlagValue("ManageJobs"), true, false), + commandData("jobaddplayerwl", addPlayerToJobWhiteListCommand, "<player name/id> [job id]", getStaffFlagValue("ManageJobs"), true, false), + commandData("jobaddplayerbl", addPlayerToJobBlackListCommand, "<player name/id> [job id]", getStaffFlagValue("ManageJobs"), true, false), + commandData("jobdelplayerbl", removePlayerFromJobBlackListCommand, "<player name/id> [job id]", getStaffFlagValue("ManageJobs"), true, false), + commandData("jobdelplayerbl", removePlayerFromJobWhiteListCommand, "<player name/id> [job id]", getStaffFlagValue("ManageJobs"), true, false), + commandData("jobreloadall", reloadAllJobsCommand, "", getStaffFlagValue("ManageJobs"), true, false), - commandData("jobinfo", getJobInfoCommand, "", getStaffFlagValue("None"), true, true, "Get info for nearest or specified job"), - commandData("joblocinfo", getJobLocationInfoCommand, "", getStaffFlagValue("None"), true, true, "Get info for nearest or specified job location"), - ], - keybind: [ - commandData("bindkey", addKeyBindCommand, "<key id/name> <command> [params]", getStaffFlagValue("None"), true, false, "Binds a key to a command and optional parameters"), - commandData("unbindkey", removeKeyBindCommand, "<key id/name>", getStaffFlagValue("None"), true, false, "Removes an existing keybind from your account"), - commandData("keybinds", showKeyBindListCommand, "", getStaffFlagValue("None"), true, false, "Shows a list of all your current keybinds"), - ], - locale: [ - commandData("lang", setLocaleCommand, "<language name>", getStaffFlagValue("None"), true, false, "Sets your language"), - commandData("language", setLocaleCommand, "<language name>", getStaffFlagValue("None"), true, false, "Sets your language"), - commandData("locale", setLocaleCommand, "<language name>", getStaffFlagValue("None"), true, false, "Sets your language"), - commandData("setlang", setLocaleCommand, "<language name>", getStaffFlagValue("None"), true, false, "Sets your language"), - ], - messaging: [], - misc: [ - commandData("pos", getPositionCommand, "", getStaffFlagValue("BasicModeration"), true, false, "Shows your current coordinates"), - commandData("idea", submitIdeaCommand, "<message>", getStaffFlagValue("None"), true, true, "Sends an suggestion/idea to the developers"), - commandData("bug", submitBugReportCommand, "<message>", getStaffFlagValue("None"), true, true, "Submits a bug report"), - commandData("enter", enterExitPropertyCommand, "", getStaffFlagValue("None"), true, true, "Enters or exists a house/business"), - commandData("cursor", toggleMouseCursorCommand, "", getStaffFlagValue("None"), true, false, "Toggles cursor visibility"), - commandData("mousecam", toggleMouseCameraCommand, "", getStaffFlagValue("None"), true, false, "Toggles vehicle mouse camera for games that don't have it"), - commandData("yes", playerPromptAnswerYesCommand, "", getStaffFlagValue("None"), true, false, "Answers a prompt with YES"), - commandData("no", playerPromptAnswerNoCommand, "", getStaffFlagValue("None"), true, false, "Answers a prompt with NO"), - commandData("admins", listOnlineAdminsCommand, "", getStaffFlagValue("None"), true, false, "Shows a list of online admins"), - commandData("stuck", stuckPlayerCommand, "", getStaffFlagValue("None"), true, false, "Fixes your position and virtual world if bugged"), - commandData("gps", gpsCommand, "[item or place name]", getStaffFlagValue("None"), true, false, "Shows you locations for special places or where to buy items"), - ], - radio: [ - commandData("radiostation", playStreamingRadioCommand, "<radio station id>", getStaffFlagValue("None"), true, false, "Plays a radio station in your vehicle, house, or business (depending on which one you're in)"), - commandData("radiostations", showRadioStationListCommand, "", getStaffFlagValue("None"), true, false, "Shows a list of all available radio stations"), - commandData("radiovolume", setStreamingRadioVolumeCommand, "<volume level>", getStaffFlagValue("None"), true, false, "Sets the radio streaming volume (for your game only)."), - commandData("radioreloadall", reloadAllRadioStationsCommand, "", getStaffFlagValue("ManageServer"), true, false, "Reloads all radio stations from database (use after making changes)"), - ], - security: [], - staff: [ - commandData("kick", kickClientCommand, "<player name/id> [reason]", getStaffFlagValue("BasicModeration"), true, true, "Kicks a player from the server"), - commandData("mute", muteClientCommand, "<player name/id> [reason]", getStaffFlagValue("BasicModeration"), true, true, "Mutes a player, preventing them from using any chat."), - commandData("freeze", freezeClientCommand, "<player name/id> [reason]", getStaffFlagValue("BasicModeration"), true, true, "Freeze a player, preventing them from moving."), - commandData("unmute", unMuteClientCommand, "<player name/id> [reason]", getStaffFlagValue("BasicModeration"), true, true, "Unmutes a player, allowing them to chat again."), - commandData("unfreeze", unFreezeClientCommand, "<player name/id> [reason]", getStaffFlagValue("BasicModeration"), true, true, "Unfreezes a player, allowing them to move again."), - commandData("goto", gotoPlayerCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to a player."), - commandData("gethere", getPlayerCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Teleports a player to you."), - commandData("getveh", getVehicleCommand, "<vehicle id>", getStaffFlagValue("BasicModeration"), true, true, "Teleports a vehicle to you."), - commandData("warpinveh", warpIntoVehicleCommand, "[vehicle id]", getStaffFlagValue("ManageVehicles"), true, false), - commandData("returnplr", returnPlayerCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Returns a player to their previous position."), - commandData("gotopos", gotoPositionCommand, "<x> <y> <z> [int] [vw]", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to specific coordinates with optional interior and dimension."), - commandData("gotoveh", gotoVehicleCommand, "<vehicle id>", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to a vehicle by ID."), - commandData("gotobiz", gotoBusinessCommand, "<business id/name>", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to a business by ID or name."), - commandData("gotohouse", gotoHouseCommand, "<house id/name>", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to a house by ID or description."), - commandData("gotojob", gotoJobLocationCommand, "<job id/name> <location id>", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to a job location by name and location ID."), - commandData("gotoloc", gotoGameLocationCommand, "<location name>", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to a game location by name."), - commandData("gotospawn", gotoNewPlayerSpawnCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to the new player spawn location"), - commandData("fr", teleportForwardCommand, "[distance in meters]", getStaffFlagValue("BasicModeration"), true, true, "Teleports you forward a certain distance in meters."), - commandData("ba", teleportBackwardCommand, "[distance in meters]", getStaffFlagValue("BasicModeration"), true, true, "Teleports you backward a certain distance in meters."), - commandData("lt", teleportLeftCommand, "[distance in meters]", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to the left a certain distance in meters."), - commandData("rt", teleportRightCommand, "[distance in meters]", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to the right a certain distance in meters."), - commandData("up", teleportUpCommand, "[distance in meters]", getStaffFlagValue("BasicModeration"), true, true, "Teleports you upward a certain distance in meters."), - commandData("dn", teleportDownCommand, "[distance in meters]", getStaffFlagValue("BasicModeration"), true, true, "Teleports you downward a certain distance in meters."), - commandData("int", playerInteriorCommand, "<player name/id> [interior id]", getStaffFlagValue("BasicModeration"), true, true, "Gets or sets a player's game interior."), - commandData("vw", playerVirtualWorldCommand, "<player name/id> [virtual world id]", getStaffFlagValue("BasicModeration"), true, true, "Gets or sets a player's virtual world/dimension."), - commandData("addstaffflag", addStaffFlagCommand, "<player name/id> <flag name>", getStaffFlagValue("ManageAdmins"), true, true, "Gives a player a staff flag by name (this server only)."), - commandData("delstaffflag", takeStaffFlagCommand, "<player name/id> <flag name>", getStaffFlagValue("ManageAdmins"), true, true, "Takes a player's staff flag by name (this server only)."), - commandData("getstaffflags", getStaffFlagsCommand, "<player name/id>", getStaffFlagValue("ManageAdmins"), true, true, "Shows a list of all staff flags a player has (this server only)."), - commandData("clearstaffflags", clearStaffFlagsCommand, "<player name/id>", getStaffFlagValue("ManageAdmins"), true, true, "Removes all staff flags for a player (this server only)."), - commandData("staffflags", allStaffFlagsCommand, "", getStaffFlagValue("ManageAdmins"), true, true, "Shows a list of all valid staff flag names."), - commandData("givemoney", givePlayerMoneyCommand, "<player name/id> <amount>", getStaffFlagValue("serverManager"), true, true), - commandData("nonrpname", forceCharacterNameChangeCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Forces a player to change their current character's name."), - commandData("setname", forceCharacterNameCommand, "<player name/id> <first name> <last name>", getStaffFlagValue("BasicModeration"), true, true, "Changes a character's name directly."), - commandData("setskin", forcePlayerSkinCommand, "<player name/id> <skin id/name>", getStaffFlagValue("BasicModeration"), true, true, "Changes a character's skin."), - commandData("setaccent", forcePlayerAccentCommand, "<player name/id> <accent name>", getStaffFlagValue("BasicModeration"), true, true, "Changes a character's accent."), - commandData("setfightstyle", forceFightStyleCommand, "<player name/id> <fight style name>", getStaffFlagValue("BasicModeration"), true, true, "Changes a character's fight style."), - commandData("setstars", forcePlayerWantedLevelCommand, "<player name/id> <wanted level>", getStaffFlagValue("BasicModeration"), true, true, "Forces a player to have a wanted level"), - commandData("plrinfo", getPlayerInfoCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Shows basic info about the specified player"), - commandData("getplrhouse", getAllHousesOwnedByPlayerCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Shows a list of all houses owned by the player"), - commandData("getplrbiz", getAllBusinessesOwnedByPlayerCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Shows a list of all businesses owned by the player"), - commandData("getplrveh", getAllVehiclesOwnedByPlayerCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Shows a list of all vehicles owned by the player"), - commandData("geoip", getPlayerGeoIPInformationCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Retrieves GeoIP information on a player (country & city)"), - commandData("ip", getPlayerIPInformationCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Retrieves IP information on a player"), - commandData("plrsync", toggleSyncForElementsSpawnedByPlayer, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Sets whether elements spawned by a player are synced (traffic, peds, etc)"), - commandData("health", setPlayerHealthCommand, "<player name/id> <health", getStaffFlagValue("BasicModeration"), true, true, "Sets a player's health"), - commandData("armour", setPlayerArmourCommand, "<player name/id> <armour>", getStaffFlagValue("BasicModeration"), true, true, "Sets a player's armour"), - commandData("infiniterun", setPlayerInfiniteRunCommand, "<player name/id> <state>", getStaffFlagValue("BasicModeration"), true, true, "Toggles a player's infinite sprint"), - ], - startup: [], - subAccount: [ - commandData("switchchar", switchCharacterCommand, "", getStaffFlagValue("None"), true, false), - commandData("newchar", newCharacterCommand, "<first name> <last name>", getStaffFlagValue("None"), true, false), - commandData("usechar", useCharacterCommand, "<character id>", getStaffFlagValue("None"), true, false), - ], - translate: [], - trigger: [ - commandData("addtrig", createTriggerCommand, "<trigger name>", getStaffFlagValue("ManageServer"), true, false), - commandData("deltrig", deleteTriggerCommand, "<trigger id>", getStaffFlagValue("ManageServer"), true, false), - commandData("addtrigcond", addTriggerConditionCommand, "<trigger id> <condition name>", getStaffFlagValue("ManageServer"), true, false), - commandData("deltrigcond", removeTriggerConditionCommand, "<trigger id> <condition id>", getStaffFlagValue("ManageServer"), true, false), - commandData("addtrigresp", addTriggerResponseCommand, "<trigger id> <response name>", getStaffFlagValue("ManageServer"), true, false), - commandData("deltrigresp", removeTriggerResponseCommand, "<trigger id> <response name>", getStaffFlagValue("ManageServer"), true, false), - commandData("triggers", listTriggersCommand, "[search value]", getStaffFlagValue("ManageServer"), true, false), - commandData("trigcond", listTriggerConditionsCommand, "<trigger id>", getStaffFlagValue("ManageServer"), true, false), - commandData("trigresp", listTriggerResponsesCommand, "<trigger id>", getStaffFlagValue("ManageServer"), true, false), - commandData("trigtoggle", toggleTriggerEnabledCommand, "<trigger id> [0/1 state]", getStaffFlagValue("ManageServer"), true, false), - ], - utilities: [], - vehicle: [ - commandData("addveh", createVehicleCommand, "<model id/name>", getStaffFlagValue("ManageVehicles"), true, false), - commandData("tempveh", createTemporaryVehicleCommand, "<model id/name>", getStaffFlagValue("ManageVehicles"), true, false), - commandData("delveh", deleteVehicleCommand, "", getStaffFlagValue("ManageVehicles"), true, false), - commandData("nearveh", getNearbyVehiclesCommand, "", getStaffFlagValue("None"), true, false), + commandData("jobinfo", getJobInfoCommand, "", getStaffFlagValue("None"), true, true, "Get info for nearest or specified job"), + commandData("joblocinfo", getJobLocationInfoCommand, "", getStaffFlagValue("None"), true, true, "Get info for nearest or specified job location"), + ], + keybind: [ + commandData("bindkey", addKeyBindCommand, "<key id/name> <command> [params]", getStaffFlagValue("None"), true, false, "Binds a key to a command and optional parameters"), + commandData("unbindkey", removeKeyBindCommand, "<key id/name>", getStaffFlagValue("None"), true, false, "Removes an existing keybind from your account"), + commandData("keybinds", showKeyBindListCommand, "", getStaffFlagValue("None"), true, false, "Shows a list of all your current keybinds"), + ], + locale: [ + commandData("lang", setLocaleCommand, "<language name>", getStaffFlagValue("None"), true, false, "Sets your language"), + commandData("language", setLocaleCommand, "<language name>", getStaffFlagValue("None"), true, false, "Sets your language"), + commandData("locale", setLocaleCommand, "<language name>", getStaffFlagValue("None"), true, false, "Sets your language"), + commandData("setlang", setLocaleCommand, "<language name>", getStaffFlagValue("None"), true, false, "Sets your language"), + ], + messaging: [], + misc: [ + commandData("pos", getPositionCommand, "", getStaffFlagValue("BasicModeration"), true, false, "Shows your current coordinates"), + commandData("idea", submitIdeaCommand, "<message>", getStaffFlagValue("None"), true, true, "Sends an suggestion/idea to the developers"), + commandData("bug", submitBugReportCommand, "<message>", getStaffFlagValue("None"), true, true, "Submits a bug report"), + commandData("enter", enterExitPropertyCommand, "", getStaffFlagValue("None"), true, true, "Enters or exists a house/business"), + commandData("cursor", toggleMouseCursorCommand, "", getStaffFlagValue("None"), true, false, "Toggles cursor visibility"), + commandData("mousecam", toggleMouseCameraCommand, "", getStaffFlagValue("None"), true, false, "Toggles vehicle mouse camera for games that don't have it"), + commandData("yes", playerPromptAnswerYesCommand, "", getStaffFlagValue("None"), true, false, "Answers a prompt with YES"), + commandData("no", playerPromptAnswerNoCommand, "", getStaffFlagValue("None"), true, false, "Answers a prompt with NO"), + commandData("admins", listOnlineAdminsCommand, "", getStaffFlagValue("None"), true, false, "Shows a list of online admins"), + commandData("stuck", stuckPlayerCommand, "", getStaffFlagValue("None"), true, false, "Fixes your position and virtual world if bugged"), + commandData("gps", gpsCommand, "[item or place name]", getStaffFlagValue("None"), true, false, "Shows you locations for special places or where to buy items"), + ], + radio: [ + commandData("radiostation", playStreamingRadioCommand, "<radio station id>", getStaffFlagValue("None"), true, false, "Plays a radio station in your vehicle, house, or business (depending on which one you're in)"), + commandData("radiostations", showRadioStationListCommand, "", getStaffFlagValue("None"), true, false, "Shows a list of all available radio stations"), + commandData("radiovolume", setStreamingRadioVolumeCommand, "<volume level>", getStaffFlagValue("None"), true, false, "Sets the radio streaming volume (for your game only)."), + commandData("radioreloadall", reloadAllRadioStationsCommand, "", getStaffFlagValue("ManageServer"), true, false, "Reloads all radio stations from database (use after making changes)"), + ], + security: [], + staff: [ + commandData("kick", kickClientCommand, "<player name/id> [reason]", getStaffFlagValue("BasicModeration"), true, true, "Kicks a player from the server"), + commandData("mute", muteClientCommand, "<player name/id> [reason]", getStaffFlagValue("BasicModeration"), true, true, "Mutes a player, preventing them from using any chat."), + commandData("freeze", freezeClientCommand, "<player name/id> [reason]", getStaffFlagValue("BasicModeration"), true, true, "Freeze a player, preventing them from moving."), + commandData("unmute", unMuteClientCommand, "<player name/id> [reason]", getStaffFlagValue("BasicModeration"), true, true, "Unmutes a player, allowing them to chat again."), + commandData("unfreeze", unFreezeClientCommand, "<player name/id> [reason]", getStaffFlagValue("BasicModeration"), true, true, "Unfreezes a player, allowing them to move again."), + commandData("goto", gotoPlayerCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to a player."), + commandData("gethere", getPlayerCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Teleports a player to you."), + commandData("getveh", getVehicleCommand, "<vehicle id>", getStaffFlagValue("BasicModeration"), true, true, "Teleports a vehicle to you."), + commandData("warpinveh", warpIntoVehicleCommand, "[vehicle id]", getStaffFlagValue("ManageVehicles"), true, false), + commandData("returnplr", returnPlayerCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Returns a player to their previous position."), + commandData("gotopos", gotoPositionCommand, "<x> <y> <z> [int] [vw]", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to specific coordinates with optional interior and dimension."), + commandData("gotoveh", gotoVehicleCommand, "<vehicle id>", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to a vehicle by ID."), + commandData("gotobiz", gotoBusinessCommand, "<business id/name>", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to a business by ID or name."), + commandData("gotohouse", gotoHouseCommand, "<house id/name>", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to a house by ID or description."), + commandData("gotojob", gotoJobLocationCommand, "<job id/name> <location id>", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to a job location by name and location ID."), + commandData("gotoloc", gotoGameLocationCommand, "<location name>", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to a game location by name."), + commandData("gotospawn", gotoNewPlayerSpawnCommand, "", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to the new player spawn location"), + commandData("fr", teleportForwardCommand, "[distance in meters]", getStaffFlagValue("BasicModeration"), true, true, "Teleports you forward a certain distance in meters."), + commandData("ba", teleportBackwardCommand, "[distance in meters]", getStaffFlagValue("BasicModeration"), true, true, "Teleports you backward a certain distance in meters."), + commandData("lt", teleportLeftCommand, "[distance in meters]", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to the left a certain distance in meters."), + commandData("rt", teleportRightCommand, "[distance in meters]", getStaffFlagValue("BasicModeration"), true, true, "Teleports you to the right a certain distance in meters."), + commandData("up", teleportUpCommand, "[distance in meters]", getStaffFlagValue("BasicModeration"), true, true, "Teleports you upward a certain distance in meters."), + commandData("dn", teleportDownCommand, "[distance in meters]", getStaffFlagValue("BasicModeration"), true, true, "Teleports you downward a certain distance in meters."), + commandData("int", playerInteriorCommand, "<player name/id> [interior id]", getStaffFlagValue("BasicModeration"), true, true, "Gets or sets a player's game interior."), + commandData("vw", playerVirtualWorldCommand, "<player name/id> [virtual world id]", getStaffFlagValue("BasicModeration"), true, true, "Gets or sets a player's virtual world/dimension."), + commandData("addstaffflag", addStaffFlagCommand, "<player name/id> <flag name>", getStaffFlagValue("ManageAdmins"), true, true, "Gives a player a staff flag by name (this server only)."), + commandData("delstaffflag", takeStaffFlagCommand, "<player name/id> <flag name>", getStaffFlagValue("ManageAdmins"), true, true, "Takes a player's staff flag by name (this server only)."), + commandData("getstaffflags", getStaffFlagsCommand, "<player name/id>", getStaffFlagValue("ManageAdmins"), true, true, "Shows a list of all staff flags a player has (this server only)."), + commandData("clearstaffflags", clearStaffFlagsCommand, "<player name/id>", getStaffFlagValue("ManageAdmins"), true, true, "Removes all staff flags for a player (this server only)."), + commandData("staffflags", allStaffFlagsCommand, "", getStaffFlagValue("ManageAdmins"), true, true, "Shows a list of all valid staff flag names."), + commandData("givemoney", givePlayerMoneyCommand, "<player name/id> <amount>", getStaffFlagValue("serverManager"), true, true), + commandData("nonrpname", forceCharacterNameChangeCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Forces a player to change their current character's name."), + commandData("setname", forceCharacterNameCommand, "<player name/id> <first name> <last name>", getStaffFlagValue("BasicModeration"), true, true, "Changes a character's name directly."), + commandData("setskin", forcePlayerSkinCommand, "<player name/id> <skin id/name>", getStaffFlagValue("BasicModeration"), true, true, "Changes a character's skin."), + commandData("setaccent", forcePlayerAccentCommand, "<player name/id> <accent name>", getStaffFlagValue("BasicModeration"), true, true, "Changes a character's accent."), + commandData("setfightstyle", forceFightStyleCommand, "<player name/id> <fight style name>", getStaffFlagValue("BasicModeration"), true, true, "Changes a character's fight style."), + commandData("setstars", forcePlayerWantedLevelCommand, "<player name/id> <wanted level>", getStaffFlagValue("BasicModeration"), true, true, "Forces a player to have a wanted level"), + commandData("plrinfo", getPlayerInfoCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Shows basic info about the specified player"), + commandData("getplrhouse", getAllHousesOwnedByPlayerCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Shows a list of all houses owned by the player"), + commandData("getplrbiz", getAllBusinessesOwnedByPlayerCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Shows a list of all businesses owned by the player"), + commandData("getplrveh", getAllVehiclesOwnedByPlayerCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Shows a list of all vehicles owned by the player"), + commandData("geoip", getPlayerGeoIPInformationCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Retrieves GeoIP information on a player (country & city)"), + commandData("ip", getPlayerIPInformationCommand, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Retrieves IP information on a player"), + commandData("plrsync", toggleSyncForElementsSpawnedByPlayer, "<player name/id>", getStaffFlagValue("BasicModeration"), true, true, "Sets whether elements spawned by a player are synced (traffic, peds, etc)"), + commandData("health", setPlayerHealthCommand, "<player name/id> <health", getStaffFlagValue("BasicModeration"), true, true, "Sets a player's health"), + commandData("armour", setPlayerArmourCommand, "<player name/id> <armour>", getStaffFlagValue("BasicModeration"), true, true, "Sets a player's armour"), + commandData("infiniterun", setPlayerInfiniteRunCommand, "<player name/id> <state>", getStaffFlagValue("BasicModeration"), true, true, "Toggles a player's infinite sprint"), + ], + startup: [], + subAccount: [ + commandData("switchchar", switchCharacterCommand, "", getStaffFlagValue("None"), true, false), + commandData("newchar", newCharacterCommand, "<first name> <last name>", getStaffFlagValue("None"), true, false), + commandData("usechar", useCharacterCommand, "<character id>", getStaffFlagValue("None"), true, false), + ], + translate: [], + trigger: [ + commandData("addtrig", createTriggerCommand, "<trigger name>", getStaffFlagValue("ManageServer"), true, false), + commandData("deltrig", deleteTriggerCommand, "<trigger id>", getStaffFlagValue("ManageServer"), true, false), + commandData("addtrigcond", addTriggerConditionCommand, "<trigger id> <condition name>", getStaffFlagValue("ManageServer"), true, false), + commandData("deltrigcond", removeTriggerConditionCommand, "<trigger id> <condition id>", getStaffFlagValue("ManageServer"), true, false), + commandData("addtrigresp", addTriggerResponseCommand, "<trigger id> <response name>", getStaffFlagValue("ManageServer"), true, false), + commandData("deltrigresp", removeTriggerResponseCommand, "<trigger id> <response name>", getStaffFlagValue("ManageServer"), true, false), + commandData("triggers", listTriggersCommand, "[search value]", getStaffFlagValue("ManageServer"), true, false), + commandData("trigcond", listTriggerConditionsCommand, "<trigger id>", getStaffFlagValue("ManageServer"), true, false), + commandData("trigresp", listTriggerResponsesCommand, "<trigger id>", getStaffFlagValue("ManageServer"), true, false), + commandData("trigtoggle", toggleTriggerEnabledCommand, "<trigger id> [0/1 state]", getStaffFlagValue("ManageServer"), true, false), + ], + utilities: [], + vehicle: [ + commandData("addveh", createVehicleCommand, "<model id/name>", getStaffFlagValue("ManageVehicles"), true, false), + commandData("tempveh", createTemporaryVehicleCommand, "<model id/name>", getStaffFlagValue("ManageVehicles"), true, false), + commandData("delveh", deleteVehicleCommand, "", getStaffFlagValue("ManageVehicles"), true, false), + commandData("nearveh", getNearbyVehiclesCommand, "", getStaffFlagValue("None"), true, false), - commandData("oldveh", getLastVehicleInfoCommand, "", getStaffFlagValue("None"), true, false), - commandData("lastveh", getLastVehicleInfoCommand, "", getStaffFlagValue("None"), true, false), - commandData("oldcar", getLastVehicleInfoCommand, "", getStaffFlagValue("None"), true, false), - commandData("lastcar", getLastVehicleInfoCommand, "", getStaffFlagValue("None"), true, false), + commandData("oldveh", getLastVehicleInfoCommand, "", getStaffFlagValue("None"), true, false), + commandData("lastveh", getLastVehicleInfoCommand, "", getStaffFlagValue("None"), true, false), + commandData("oldcar", getLastVehicleInfoCommand, "", getStaffFlagValue("None"), true, false), + commandData("lastcar", getLastVehicleInfoCommand, "", getStaffFlagValue("None"), true, false), - commandData("lock", vehicleLockCommand, "", getStaffFlagValue("None"), true, false), - commandData("unlock", vehicleLockCommand, "", getStaffFlagValue("None"), true, false), - commandData("engine", vehicleEngineCommand, "", getStaffFlagValue("None"), true, false), - commandData("siren", vehicleSirenCommand, "", getStaffFlagValue("None"), true, false), - commandData("lights", vehicleLightsCommand, "", getStaffFlagValue("None"), true, false), + commandData("lock", vehicleLockCommand, "", getStaffFlagValue("None"), true, false), + commandData("unlock", vehicleLockCommand, "", getStaffFlagValue("None"), true, false), + commandData("engine", vehicleEngineCommand, "", getStaffFlagValue("None"), true, false), + commandData("siren", vehicleSirenCommand, "", getStaffFlagValue("None"), true, false), + commandData("lights", vehicleLightsCommand, "", getStaffFlagValue("None"), true, false), - commandData("vehowner", setVehicleOwnerCommand, "<player id/name>", getStaffFlagValue("ManageVehicles"), true, true), - commandData("vehpublic", setVehiclePublicCommand, "", getStaffFlagValue("ManageVehicles"), true, true), - commandData("vehclan", setVehicleClanCommand, "<clan id/name>", getStaffFlagValue(""), true, true), - commandData("vehbiz", setVehicleToBusinessCommand, "", getStaffFlagValue(""), true, true), - commandData("vehjob", setVehicleJobCommand, "[job id/name]", getStaffFlagValue("ManageVehicles"), true, true), - commandData("vehdelowner", removeVehicleOwnerCommand, "", getStaffFlagValue("ManageVehicles"), true, true), - commandData("vehrank", setVehicleRankCommand, "<rank id/name>", getStaffFlagValue("None"), true, true), - commandData("vehinfo", getVehicleInfoCommand, "", getStaffFlagValue("None"), true, true), - commandData("vehpark", toggleVehicleSpawnLockCommand, "", getStaffFlagValue("ManageVehicles"), true, true), + commandData("vehowner", setVehicleOwnerCommand, "<player id/name>", getStaffFlagValue("ManageVehicles"), true, true), + commandData("vehpublic", setVehiclePublicCommand, "", getStaffFlagValue("ManageVehicles"), true, true), + commandData("vehclan", setVehicleClanCommand, "<clan id/name>", getStaffFlagValue(""), true, true), + commandData("vehbiz", setVehicleToBusinessCommand, "", getStaffFlagValue(""), true, true), + commandData("vehjob", setVehicleJobCommand, "[job id/name]", getStaffFlagValue("ManageVehicles"), true, true), + commandData("vehdelowner", removeVehicleOwnerCommand, "", getStaffFlagValue("ManageVehicles"), true, true), + commandData("vehrank", setVehicleRankCommand, "<rank id/name>", getStaffFlagValue("None"), true, true), + commandData("vehinfo", getVehicleInfoCommand, "", getStaffFlagValue("None"), true, true), + commandData("vehpark", toggleVehicleSpawnLockCommand, "", getStaffFlagValue("ManageVehicles"), true, true), - commandData("vehrespawnall", respawnAllVehiclesCommand, "", getStaffFlagValue("ManageVehicles"), true, true, "Respawns all vehicles (also respawns all traffic vehicles)"), - commandData("vehrespawnempty", respawnEmptyVehiclesCommand, "", getStaffFlagValue("ManageVehicles"), true, true, "Respawns all empty/unoccupied vehicles"), - commandData("vehrespawnjob", respawnJobVehiclesCommand, "", getStaffFlagValue("ManageVehicles"), true, true, "Respawns all job vehicles"), - commandData("vehrespawnplr", respawnPlayerVehiclesCommand, "", getStaffFlagValue("ManageVehicles"), true, true, "Respawns all player-owned vehicles"), - commandData("vehrespawnclan", respawnClanVehiclesCommand, "", getStaffFlagValue("ManageVehicles"), true, true, "Respawns all clan-owned vehicles"), - commandData("vehrespawnpublic", respawnPublicVehiclesCommand, "", getStaffFlagValue("ManageVehicles"), true, true, "Respawns all public vehicles"), - commandData("vehrespawnbiz", respawnBusinessVehiclesCommand, "", getStaffFlagValue("ManageVehicles"), true, true, "Respawns all business-owned vehicles"), - commandData("vehrespawn", respawnVehicleCommand, "", getStaffFlagValue("ManageVehicles"), true, true, "Respawns your current vehicle"), - commandData("vehreloadall", reloadAllVehiclesCommand, "", getStaffFlagValue("ManageVehicles"), true, true, "Deletes and reloads all vehicles from database"), + commandData("vehrespawnall", respawnAllVehiclesCommand, "", getStaffFlagValue("ManageVehicles"), true, true, "Respawns all vehicles (also respawns all traffic vehicles)"), + commandData("vehrespawnempty", respawnEmptyVehiclesCommand, "", getStaffFlagValue("ManageVehicles"), true, true, "Respawns all empty/unoccupied vehicles"), + commandData("vehrespawnjob", respawnJobVehiclesCommand, "", getStaffFlagValue("ManageVehicles"), true, true, "Respawns all job vehicles"), + commandData("vehrespawnplr", respawnPlayerVehiclesCommand, "", getStaffFlagValue("ManageVehicles"), true, true, "Respawns all player-owned vehicles"), + commandData("vehrespawnclan", respawnClanVehiclesCommand, "", getStaffFlagValue("ManageVehicles"), true, true, "Respawns all clan-owned vehicles"), + commandData("vehrespawnpublic", respawnPublicVehiclesCommand, "", getStaffFlagValue("ManageVehicles"), true, true, "Respawns all public vehicles"), + commandData("vehrespawnbiz", respawnBusinessVehiclesCommand, "", getStaffFlagValue("ManageVehicles"), true, true, "Respawns all business-owned vehicles"), + commandData("vehrespawn", respawnVehicleCommand, "", getStaffFlagValue("ManageVehicles"), true, true, "Respawns your current vehicle"), + commandData("vehreloadall", reloadAllVehiclesCommand, "", getStaffFlagValue("ManageVehicles"), true, true, "Deletes and reloads all vehicles from database"), - commandData("vehrent", rentVehicleCommand, "", getStaffFlagValue("None"), true, true, "Starts renting your current vehicle (if rentable)"), - commandData("vehrentprice", setVehicleRentPriceCommand, "", getStaffFlagValue("None"), true, true, "Sets your vehicle's rent price"), - commandData("vehbuyprice", setVehicleBuyPriceCommand, "", getStaffFlagValue("None"), true, true, "Sets your vehicle's rent price"), - commandData("stoprent", stopRentingVehicleCommand, "", getStaffFlagValue("None"), true, true, "Stops renting your vehicle"), - commandData("vehbuy", buyVehicleCommand, "", getStaffFlagValue("None"), true, true, "Purchases your vehicle"), - commandData("vehcolour", vehicleAdminColourCommand, "<colour1> <colour2>", getStaffFlagValue("None"), true, true, "Sets a vehicle's colour"), - commandData("vehlivery", vehicleAdminLiveryCommand, "<livery id>", getStaffFlagValue("None"), true, true, "Sets your vehicle's livery/paintjob"), - commandData("vehrepair", vehicleAdminRepairCommand, "", getStaffFlagValue("None"), true, true, "Repairs your vehicle"), - commandData("passenger", enterVehicleAsPassengerCommand, "", getStaffFlagValue("None"), true, true, "Enters a vehicle as passenger"), - ], - }; + commandData("vehrent", rentVehicleCommand, "", getStaffFlagValue("None"), true, true, "Starts renting your current vehicle (if rentable)"), + commandData("vehrentprice", setVehicleRentPriceCommand, "", getStaffFlagValue("None"), true, true, "Sets your vehicle's rent price"), + commandData("vehbuyprice", setVehicleBuyPriceCommand, "", getStaffFlagValue("None"), true, true, "Sets your vehicle's rent price"), + commandData("stoprent", stopRentingVehicleCommand, "", getStaffFlagValue("None"), true, true, "Stops renting your vehicle"), + commandData("vehbuy", buyVehicleCommand, "", getStaffFlagValue("None"), true, true, "Purchases your vehicle"), + commandData("vehcolour", vehicleAdminColourCommand, "<colour1> <colour2>", getStaffFlagValue("None"), true, true, "Sets a vehicle's colour"), + commandData("vehlivery", vehicleAdminLiveryCommand, "<livery id>", getStaffFlagValue("None"), true, true, "Sets your vehicle's livery/paintjob"), + commandData("vehrepair", vehicleAdminRepairCommand, "", getStaffFlagValue("None"), true, true, "Repairs your vehicle"), + commandData("passenger", enterVehicleAsPassengerCommand, "", getStaffFlagValue("None"), true, true, "Enters a vehicle as passenger"), + ], + }; - return tempCommands; + return tempCommands; } // =========================================================================== function addAllCommandHandlers() { - for(let i in serverCommands) { - for(let j in serverCommands[i]) { - addCommandHandler(serverCommands[i][j].command, processPlayerCommand); - } - } + for(let i in serverCommands) { + for(let j in serverCommands[i]) { + addCommandHandler(serverCommands[i][j].command, processPlayerCommand); + } + } } // =========================================================================== function getCommand(command) { - let commandGroups = getCommands() - for(let i in commandGroups) { - let commandGroup = commandGroups[i]; - for(let j in commandGroup) { - if(toLowerCase(commandGroup[j].command) == toLowerCase(command)) { - return commandGroup[j]; - } - } - } + let commandGroups = getCommands() + for(let i in commandGroups) { + let commandGroup = commandGroups[i]; + for(let j in commandGroup) { + if(toLowerCase(commandGroup[j].command) == toLowerCase(command)) { + return commandGroup[j]; + } + } + } - return false; + return false; } // =========================================================================== function getCommandData(command) { - return getCommand(command); + return getCommand(command); } // =========================================================================== function getCommands() { - return serverCommands; + return serverCommands; } // =========================================================================== function commandData(command, handlerFunction, syntaxString = "", requiredStaffFlags = getStaffFlagValue("None"), requireLogin = true, allowOnDiscord = true, usageHelpMessage) { - return new CommandData(command, handlerFunction, syntaxString, requiredStaffFlags, requireLogin, allowOnDiscord, usageHelpMessage); + return new CommandData(command, handlerFunction, syntaxString, requiredStaffFlags, requireLogin, allowOnDiscord, usageHelpMessage); } // =========================================================================== function doesCommandRequireLogin(command) { - return getCommand(command).requireLogin; + return getCommand(command).requireLogin; } // =========================================================================== function getCommandRequiredPermissions(command) { - return getCommand(command).requiredStaffFlags; + return getCommand(command).requiredStaffFlags; } // =========================================================================== function getCommandSyntaxText(command) { - return `/${command} ${getCommand(command).syntaxString}`; + return `/${command} ${getCommand(command).syntaxString}`; } // =========================================================================== function isCommandAllowedOnDiscord(command) { - return getCommand(command).allowOnDiscord; + return getCommand(command).allowOnDiscord; } // =========================================================================== @@ -595,16 +595,16 @@ function disableCommand(command, params, client) { if(areParamsEmpty(params)) { messagePlayerSyntax(client, getCommandSyntaxText(command)); return false; - } + } - params = toLowerCase(params); + params = toLowerCase(params); - if(!getCommand(params)) { - messagePlayerError(client, `The command {ALTCOLOUR}/${params} {MAINCOLOUR} does not exist!`); - return false; - } + if(!getCommand(params)) { + messagePlayerError(client, `The command {ALTCOLOUR}/${params} {MAINCOLOUR} does not exist!`); + return false; + } - getCommand(params).enabled = false; + getCommand(params).enabled = false; messagePlayerSuccess(client, `Command {ALTCOLOUR}/${params} {MAINCOLOUR}has been disabled!`); return true; } @@ -615,16 +615,16 @@ function enableCommand(command, params, client) { if(areParamsEmpty(params)) { messagePlayerSyntax(client, getCommandSyntaxText(command)); return false; - } + } - params = toLowerCase(params); + params = toLowerCase(params); - if(!getCommand(params)) { - messagePlayerError(client, `The command {ALTCOLOUR}/${params} {MAINCOLOUR} does not exist!`); - return false; - } + if(!getCommand(params)) { + messagePlayerError(client, `The command {ALTCOLOUR}/${params} {MAINCOLOUR} does not exist!`); + return false; + } - getCommand(params).enabled = true; + getCommand(params).enabled = true; messagePlayerSuccess(client, `Command {ALTCOLOUR}/${params} {MAINCOLOUR}has been enabled!`); return true; } @@ -637,16 +637,16 @@ function disableAllCommandsByType(command, params, client) { return false; } - params = toLowerCase(params); + params = toLowerCase(params); - if(isNull(getServerData().commands[params])) { - messagePlayerError(client, `Command type {ALTCOLOUR}${params} {MAINCOLOUR}does not exist!`); - return false; - } + if(isNull(getServerData().commands[params])) { + messagePlayerError(client, `Command type {ALTCOLOUR}${params} {MAINCOLOUR}does not exist!`); + return false; + } - for(let i in getServerData().commands[params]) { - getServerData().commands[params][i].enabled = false; - } + for(let i in getServerData().commands[params]) { + getServerData().commands[params][i].enabled = false; + } messagePlayerSuccess(client, `{clanOrange}All {ALTCOLOUR}${params} {MAINCOLOUR}commands have been disabled!`); return true; @@ -658,18 +658,18 @@ function enableAllCommandsByType(command, params, client) { if(areParamsEmpty(params)) { messagePlayerSyntax(client, getCommandSyntaxText(command)); return false; - } + } - params = toLowerCase(params); + params = toLowerCase(params); - if(isNull(getServerData().commands[params])) { - messagePlayerError(client, `Command type {ALTCOLOUR}${params} {MAINCOLOUR}does not exist!`); - return false; - } + if(isNull(getServerData().commands[params])) { + messagePlayerError(client, `Command type {ALTCOLOUR}${params} {MAINCOLOUR}does not exist!`); + return false; + } - for(let i in getServerData().commands[params]) { - getServerData().commands[params][i].enabled = true; - } + for(let i in getServerData().commands[params]) { + getServerData().commands[params][i].enabled = true; + } messagePlayerSuccess(client, `{clanOrange}All {ALTCOLOUR}${params} {MAINCOLOUR}commands have been enabled!`); return true; @@ -678,44 +678,44 @@ function enableAllCommandsByType(command, params, client) { // =========================================================================== function onPlayerCommand(event, client, command, params) { - processPlayerCommand(command, params, client) + processPlayerCommand(command, params, client) } // =========================================================================== function processPlayerCommand(command, params, client) { - if(builtInCommands.indexOf(toLowerCase(command)) != -1) { - return true; - } + if(builtInCommands.indexOf(toLowerCase(command)) != -1) { + return true; + } - let commandData = getCommand(toLowerCase(command)); + let commandData = getCommand(toLowerCase(command)); - let paramsDisplay = params; - if(areParamsEmpty(params)) { - paramsDisplay = ""; - } + let paramsDisplay = params; + if(areParamsEmpty(params)) { + paramsDisplay = ""; + } - if(!doesCommandExist(toLowerCase(command))) { - console.warn(`[VRR.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (invalid command): /${command} ${paramsDisplay}`); + if(!doesCommandExist(toLowerCase(command))) { + console.warn(`[VRR.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (invalid command): /${command} ${paramsDisplay}`); - let possibleCommand = getCommandFromParams(command); - if(possibleCommand != false && doesPlayerHaveStaffPermission(client, getCommandRequiredPermissions(toLowerCase(possibleCommand.command)))) { - messagePlayerError(client, `The command {ALTCOLOUR}/${command} {MAINCOLOUR}does not exist! Did you mean {ALTCOLOUR}/${possibleCommand.command} ?`); - } else { - messagePlayerError(client, `The command {ALTCOLOUR}/${command} {MAINCOLOUR}does not exist! Use /help for commands and information.`); - } - return false; - } + let possibleCommand = getCommandFromParams(command); + if(possibleCommand != false && doesPlayerHaveStaffPermission(client, getCommandRequiredPermissions(toLowerCase(possibleCommand.command)))) { + messagePlayerError(client, `The command {ALTCOLOUR}/${command} {MAINCOLOUR}does not exist! Did you mean {ALTCOLOUR}/${possibleCommand.command} ?`); + } else { + messagePlayerError(client, `The command {ALTCOLOUR}/${command} {MAINCOLOUR}does not exist! Use /help for commands and information.`); + } + return false; + } - if(!commandData.enabled) { - console.warn(`[VRR.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (command is disabled): /${command} ${paramsDisplay}`); - messagePlayerError(client, `The command {ALTCOLOUR}/${command} {MAINCOLOUR}is disabled!`); - return false; - } + if(!commandData.enabled) { + console.warn(`[VRR.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (command is disabled): /${command} ${paramsDisplay}`); + messagePlayerError(client, `The command {ALTCOLOUR}/${command} {MAINCOLOUR}is disabled!`); + return false; + } if(doesCommandRequireLogin(toLowerCase(command))) { if(!isPlayerLoggedIn(client)) { - console.warn(`[VRR.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (requires login first): /${command} ${paramsDisplay}`); + console.warn(`[VRR.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (requires login first): /${command} ${paramsDisplay}`); messagePlayerError(client, `You must be logged in to use the {ALTCOLOUR}/${command} {MAINCOLOUR}command!`); return false; } @@ -723,84 +723,84 @@ function processPlayerCommand(command, params, client) { //if(isClientFromDiscord(client)) { // if(!isCommandAllowedOnDiscord(command)) { - // console.warn(`[VRR.Command] ${getPlayerDisplayForConsole(client)} attempted to use command from discord, but failed (not available on discord): /${command} ${paramsDisplay}`); + // console.warn(`[VRR.Command] ${getPlayerDisplayForConsole(client)} attempted to use command from discord, but failed (not available on discord): /${command} ${paramsDisplay}`); // messagePlayerError(client, `The {ALTCOLOUR}/${command} {MAINCOLOUR} command isn't available on discord!`); // return false; // } //} - if(!client.console) { - if(!doesPlayerHaveStaffPermission(client, getCommandRequiredPermissions(toLowerCase(command)))) { - console.warn(`[VRR.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (no permission): /${command} ${paramsDisplay}`); - messagePlayerError(client, `You do not have permission to use the {ALTCOLOUR}/${toLowerCase(command)} {MAINCOLOUR}command!`); - return false; - } - } + if(!client.console) { + if(!doesPlayerHaveStaffPermission(client, getCommandRequiredPermissions(toLowerCase(command)))) { + console.warn(`[VRR.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (no permission): /${command} ${paramsDisplay}`); + messagePlayerError(client, `You do not have permission to use the {ALTCOLOUR}/${toLowerCase(command)} {MAINCOLOUR}command!`); + return false; + } + } - logToConsole(LOG_DEBUG, `[VRR.Command] ${getPlayerDisplayForConsole(client)} used command: /${command} ${paramsDisplay}`); - commandData.handlerFunction(toLowerCase(command), params, client); + logToConsole(LOG_DEBUG, `[VRR.Command] ${getPlayerDisplayForConsole(client)} used command: /${command} ${paramsDisplay}`); + commandData.handlerFunction(toLowerCase(command), params, client); } // =========================================================================== addCommandHandler("cmd", function(command, params, client) { - if(!isConsole(client)) { - return false; - } + if(!isConsole(client)) { + return false; + } - let splitParams = params.split(" "); - let newCommand = getParam(params, " ", 1); - let newParams = splitParams.slice(1).join(" "); + let splitParams = params.split(" "); + let newCommand = getParam(params, " ", 1); + let newParams = splitParams.slice(1).join(" "); - getCommand(newCommand).handlerFunction(newCommand, newParams, client); + getCommand(newCommand).handlerFunction(newCommand, newParams, client); }); // =========================================================================== function listAllCommands() { - for(let i in serverCommands) { - for(let j in serverCommands[i]) { - logToConsole(LOG_DEBUG, serverCommands[i][j].command); - } - } + for(let i in serverCommands) { + for(let j in serverCommands[i]) { + logToConsole(LOG_DEBUG, serverCommands[i][j].command); + } + } } // =========================================================================== function doesCommandExist(command) { - if(getCommandData(command)) { - return true; - } + if(getCommandData(command)) { + return true; + } - return false; + return false; } // =========================================================================== function cacheAllCommandsAliases() { - for(let i in serverCommands) { - for(let j in serverCommands[i]) { - for(let k in serverCommands) { - for(let m in serverCommands[k]) { - if(serverCommands[i][j].handlerFunction == serverCommands[k][m].handlerFunction) { - serverCommands[i][j].aliases.push(serverCommands[k][m]); - serverCommands[k][m].aliases.push(serverCommands[i][j]); - } - } - } - } - } + for(let i in serverCommands) { + for(let j in serverCommands[i]) { + for(let k in serverCommands) { + for(let m in serverCommands[k]) { + if(serverCommands[i][j].handlerFunction == serverCommands[k][m].handlerFunction) { + serverCommands[i][j].aliases.push(serverCommands[k][m]); + serverCommands[k][m].aliases.push(serverCommands[i][j]); + } + } + } + } + } } // =========================================================================== function getCommandAliasesNames(command) { - let commandAliases = []; - for(let i in command.aliases) { - commandAliases.push(command.aliases[i].name); - } + let commandAliases = []; + for(let i in command.aliases) { + commandAliases.push(command.aliases[i].name); + } - return commandAliases; + return commandAliases; } // =========================================================================== diff --git a/scripts/server/config.js b/scripts/server/config.js index caf569c8..14544fae 100644 --- a/scripts/server/config.js +++ b/scripts/server/config.js @@ -283,18 +283,18 @@ function setTimeCommand(command, params, client) { if(hour > 23 || hour < 0) { messagePlayerError(client, "The hour must be between 0 and 23!"); return false; - } + } if(minute > 59 || minute < 0) { messagePlayerError(client, "The minute must be between 0 and 59!"); return false; - } + } getServerConfig().hour = hour; getServerConfig().minute = minute; - game.time.hour = getServerConfig().hour; - game.time.minute = getServerConfig().minute; + game.time.hour = getServerConfig().hour; + game.time.minute = getServerConfig().minute; //checkServerGameTime(); @@ -322,7 +322,7 @@ function setMinuteDurationCommand(command, params, client) { return false; } - let minuteDuration = toInteger(params); + let minuteDuration = toInteger(params); getServerConfig().minuteDuration = minuteDuration; setTimeMinuteDuration(null, minuteDuration); @@ -354,15 +354,15 @@ function setWeatherCommand(command, params, client) { if(!weatherId) { messagePlayerError(client, `That weather ID or name is invalid!`); return false; - } + } - game.forceWeather(toInteger(weatherId)); + game.forceWeather(toInteger(weatherId)); getServerConfig().weather = weatherId; getServerConfig().needsSaved = true; - messageAdminAction(`${getPlayerName(client)} set the weather to {ALTCOLOUR}${getGameConfig().weatherNames[getServerGame()][toInteger(weatherId)]}`); - updateServerRules(); + messageAdminAction(`${getPlayerName(client)} set the weather to {ALTCOLOUR}${getGameConfig().weatherNames[getServerGame()][toInteger(weatherId)]}`); + updateServerRules(); return true; } @@ -384,7 +384,7 @@ function setSnowingCommand(command, params, client) { } let splitParams = params.split(" "); - let falling = toInteger(getParam(params, " ", 1)); + let falling = toInteger(getParam(params, " ", 1)); let ground = toInteger(getParam(params, " ", 2)); getServerConfig().fallingSnow = intToBool(falling); @@ -394,8 +394,8 @@ function setSnowingCommand(command, params, client) { getServerConfig().needsSaved = true; - messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned falling snow ${getBoolRedGreenInlineColour(falling)}${getOnOffFromBool(falling)} {MAINCOLOUR}and ground snow ${getBoolRedGreenInlineColour(ground)}${getOnOffFromBool(ground)}`); - updateServerRules(); + messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned falling snow ${getBoolRedGreenInlineColour(falling)}${getOnOffFromBool(falling)} {MAINCOLOUR}and ground snow ${getBoolRedGreenInlineColour(ground)}${getOnOffFromBool(ground)}`); + updateServerRules(); return true; } @@ -417,7 +417,7 @@ function setServerGUIColoursCommand(command, params, client) { } let splitParams = params.split(" "); - let colourRed = toInteger(getParam(params, " ", 1)) || 255; + let colourRed = toInteger(getParam(params, " ", 1)) || 255; let colourGreen = toInteger(getParam(params, " ", 2)) || 255; let colourBlue = toInteger(getParam(params, " ", 3)) || 255; @@ -430,8 +430,8 @@ function setServerGUIColoursCommand(command, params, client) { getServerConfig().needsSaved = true; - //messageAdminAction(`${getPlayerName(client)} ${getInlineChatColourByName("orange")}set the server ${getBoolRedGreenInlineColour(fallingSnow)}${getOnOffFromBool(fallingSnow)} ${getInlineChatColourByName("orange")}and ground snow ${getBoolRedGreenInlineColour(groundSnow)}${getOnOffFromBool(groundSnow)}`); - //updateServerRules(); + //messageAdminAction(`${getPlayerName(client)} ${getInlineChatColourByName("orange")}set the server ${getBoolRedGreenInlineColour(fallingSnow)}${getOnOffFromBool(fallingSnow)} ${getInlineChatColourByName("orange")}and ground snow ${getBoolRedGreenInlineColour(groundSnow)}${getOnOffFromBool(groundSnow)}`); + //updateServerRules(); return true; } @@ -452,8 +452,8 @@ function toggleServerLogoCommand(command, params, client) { updatePlayerShowLogoState(null, getServerConfig().useLogo); - messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned the server logo image ${getBoolRedGreenInlineColour(doesServerHaveServerLogoEnabled())}${toUpperCase(getOnOffFromBool(getServerConfig().useLogo))}`); - updateServerRules(); + messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned the server logo image ${getBoolRedGreenInlineColour(doesServerHaveServerLogoEnabled())}${toUpperCase(getOnOffFromBool(getServerConfig().useLogo))}`); + updateServerRules(); return true; } @@ -472,7 +472,7 @@ function toggleServerLogoCommand(command, params, client) { getServerConfig().createJobBlips = !getServerConfig().createJobBlips; getServerConfig().needsSaved = true; - messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned ${getBoolRedGreenInlineColour(doesServerHaveJobBlipsEnabled())}${toUpperCase(getOnOffFromBool(getServerConfig().createJobBlips))} {MAINCOLOUR}all job blips`); + messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned ${getBoolRedGreenInlineColour(doesServerHaveJobBlipsEnabled())}${toUpperCase(getOnOffFromBool(getServerConfig().createJobBlips))} {MAINCOLOUR}all job blips`); resetAllJobBlips(); return true; } @@ -492,7 +492,7 @@ function toggleServerLogoCommand(command, params, client) { getServerConfig().createJobPickups = !getServerConfig().createJobPickups; getServerConfig().needsSaved = true; - messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned ${getBoolRedGreenInlineColour(doesServerHaveJobPickupsEnabled())}${toUpperCase(getOnOffFromBool(getServerConfig().createJobPickups))} {MAINCOLOUR}all job pickups`); + messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned ${getBoolRedGreenInlineColour(doesServerHaveJobPickupsEnabled())}${toUpperCase(getOnOffFromBool(getServerConfig().createJobPickups))} {MAINCOLOUR}all job pickups`); resetAllJobPickups(); return true; } @@ -509,10 +509,10 @@ function toggleServerLogoCommand(command, params, client) { * */ function toggleServerBusinessBlipsCommand(command, params, client) { - getServerConfig().createBusinessBlips = !getServerConfig().createBusinessBlips; + getServerConfig().createBusinessBlips = !getServerConfig().createBusinessBlips; getServerConfig().needsSaved = true; - messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned ${getBoolRedGreenInlineColour(doesServerHaveBusinessBlipsEnabled())}${toUpperCase(getOnOffFromBool(getServerConfig().createBusinessBlips))} {MAINCOLOUR}all business blips`); + messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned ${getBoolRedGreenInlineColour(doesServerHaveBusinessBlipsEnabled())}${toUpperCase(getOnOffFromBool(getServerConfig().createBusinessBlips))} {MAINCOLOUR}all business blips`); resetAllBusinessBlips(); return true; } @@ -529,10 +529,10 @@ function toggleServerLogoCommand(command, params, client) { * */ function toggleServerBusinessPickupsCommand(command, params, client) { - getServerConfig().createBusinessPickups = !getServerConfig().createBusinessPickups; + getServerConfig().createBusinessPickups = !getServerConfig().createBusinessPickups; getServerConfig().needsSaved = true; - messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned ${getBoolRedGreenInlineColour(doesServerHaveBusinessPickupsEnabled())}${toUpperCase(getOnOffFromBool(getServerConfig().createBusinessPickups))} {MAINCOLOUR}all business pickups`); + messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned ${getBoolRedGreenInlineColour(doesServerHaveBusinessPickupsEnabled())}${toUpperCase(getOnOffFromBool(getServerConfig().createBusinessPickups))} {MAINCOLOUR}all business pickups`); resetAllBusinessPickups(); return true; } @@ -549,10 +549,10 @@ function toggleServerLogoCommand(command, params, client) { * */ function toggleServerHouseBlipsCommand(command, params, client) { - getServerConfig().createHouseBlips = !getServerConfig().createHouseBlips; + getServerConfig().createHouseBlips = !getServerConfig().createHouseBlips; getServerConfig().needsSaved = true; - messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned ${getBoolRedGreenInlineColour(doesServerHaveHouseBlipsEnabled())}${toUpperCase(getOnOffFromBool(getServerConfig().createHouseBlips))} {MAINCOLOUR}all house blips`); + messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned ${getBoolRedGreenInlineColour(doesServerHaveHouseBlipsEnabled())}${toUpperCase(getOnOffFromBool(getServerConfig().createHouseBlips))} {MAINCOLOUR}all house blips`); resetAllHouseBlips(); return true; } @@ -572,7 +572,7 @@ function toggleServerLogoCommand(command, params, client) { getServerConfig().createHousePickups = !getServerConfig().createHousePickups; getServerConfig().needsSaved = true; - messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned ${getBoolRedGreenInlineColour(doesServerHaveHousePickupsEnabled())}${toUpperCase(getOnOffFromBool(getServerConfig().createHousePickups))} {MAINCOLOUR}all house pickups`); + messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned ${getBoolRedGreenInlineColour(doesServerHaveHousePickupsEnabled())}${toUpperCase(getOnOffFromBool(getServerConfig().createHousePickups))} {MAINCOLOUR}all house pickups`); resetAllHousePickups(); return true; } @@ -593,8 +593,8 @@ function toggleServerGUICommand(command, params, client) { getServerConfig().needsSaved = true; - messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned GUI ${toLowerCase(getOnOffFromBool(doesServerHaveGUIEnabled()))} for this server`); - updateServerRules(); + messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned GUI ${toLowerCase(getOnOffFromBool(doesServerHaveGUIEnabled()))} for this server`); + updateServerRules(); return true; } @@ -611,12 +611,12 @@ function toggleServerGUICommand(command, params, client) { */ function toggleServerUseRealWorldTimeCommand(command, params, client) { getServerConfig().useRealTime = !getServerConfig().useRealTime; - + getServerConfig().needsSaved = true; - messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned real-world time ${getServerConfig().useRealTime} for this server (GMT ${addPositiveNegativeSymbol(getServerConfig().realTimeZone)})`); + messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned real-world time ${getServerConfig().useRealTime} for this server (GMT ${addPositiveNegativeSymbol(getServerConfig().realTimeZone)})`); updateServerGameTime(); - updateServerRules(); + updateServerRules(); return true; } @@ -637,12 +637,12 @@ function setServerRealWorldTimeZoneCommand(command, params, client) { return false; } - getServerConfig().realTimeZone = toInteger(params); + getServerConfig().realTimeZone = toInteger(params); getServerConfig().needsSaved = true; - messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}set the time zone for in-game's real-world time to GMT ${addPositiveNegativeSymbol(getServerConfig().realTimeZone)}`); + messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}set the time zone for in-game's real-world time to GMT ${addPositiveNegativeSymbol(getServerConfig().realTimeZone)}`); updateServerGameTime(); - updateServerRules(); + updateServerRules(); return true; } @@ -662,7 +662,7 @@ function reloadServerConfigurationCommand(command, params, client) { applyConfigToServer(serverConfig); updateServerRules(); - messagePlayerSuccess(client, `You reloaded the server configuration!`); + messagePlayerSuccess(client, `You reloaded the server configuration!`); return true; } @@ -679,7 +679,7 @@ function reloadServerConfigurationCommand(command, params, client) { */ function reloadEmailConfigurationCommand(command, params, client) { emailConfig = loadEmailConfiguration(); - messagePlayerSuccess(client, `You reloaded the email configuration!`); + messagePlayerSuccess(client, `You reloaded the email configuration!`); return true; } diff --git a/scripts/server/database.js b/scripts/server/database.js index 00bfeac8..5d5adff3 100644 --- a/scripts/server/database.js +++ b/scripts/server/database.js @@ -20,4 +20,3 @@ function initDatabaseScript() { } // =========================================================================== - diff --git a/scripts/server/developer.js b/scripts/server/developer.js index 7ee25bef..6f3ebe7a 100644 --- a/scripts/server/developer.js +++ b/scripts/server/developer.js @@ -572,9 +572,9 @@ function streamAudioNameToAllPlayersCommand(command, params, client) { // =========================================================================== function fixAllServerBlipsCommand(command, params, client) { - deleteAllBusinessBlips(); - deleteAllJobBlips(); - deleteAllHouseBlips(); + deleteAllBusinessBlips(); + deleteAllJobBlips(); + deleteAllHouseBlips(); let blips = getElementsByType(ELEMENT_BLIP); blips.forEach((blip) => { diff --git a/scripts/server/discord.js b/scripts/server/discord.js index 653138a3..f6116d3d 100644 --- a/scripts/server/discord.js +++ b/scripts/server/discord.js @@ -16,31 +16,31 @@ function initDiscordScript() { /* addEventHandler("OnDiscordCommand", function(command, params, discordUser) { - let commandData = getCommand(command); + let commandData = getCommand(command); - if(!commandData) { - messagePlayerError(discordUser, "That command does not exist!"); - return false; - } + if(!commandData) { + messagePlayerError(discordUser, "That command does not exist!"); + return false; + } - if(isCommandAllowedOnDiscord(command)) { - messagePlayerError(discordUser, "That command can not be used on Discord!"); - return false; - } + if(isCommandAllowedOnDiscord(command)) { + messagePlayerError(discordUser, "That command can not be used on Discord!"); + return false; + } - if(doesClientHavePermission(discordUser, getCommandRequiredPermissions(command))) { - messagePlayerError(discordUser, "You do not have permission to use that command!"); - return false; - } + if(doesClientHavePermission(discordUser, getCommandRequiredPermissions(command))) { + messagePlayerError(discordUser, "You do not have permission to use that command!"); + return false; + } - commandData.handlerFunction(command, params, discordUser); + commandData.handlerFunction(command, params, discordUser); }); */ // =========================================================================== function messageDiscordUser(discordUser, messageText) { - let socketData = JSON.stringify({ + let socketData = JSON.stringify({ type: "chat.message.text", payload: { author: discordUser.name, @@ -53,88 +53,88 @@ function messageDiscordUser(discordUser, messageText) { // =========================================================================== function sendDiscordSocketData(socketData) { - if(!getDiscordSocket()) { - return false; - } + if(!getDiscordSocket()) { + return false; + } - getDiscordSocket().send(module.hash.encodeBase64(socketData) + "\r\n"); + getDiscordSocket().send(module.hash.encodeBase64(socketData) + "\r\n"); } // =========================================================================== function isClientFromDiscord(client) { - if(client == null) { - return false; - } + if(client == null) { + return false; + } - if(client instanceof Client) { - return false; - } else { - return true; - } + if(client instanceof Client) { + return false; + } else { + return true; + } } // =========================================================================== function getDiscordSocket() { - return false; + return false; } // =========================================================================== function getDiscordUserData(discordUserId) { - return loadAccountFromDiscordUserId(discordUserId); + return loadAccountFromDiscordUserId(discordUserId); } // =========================================================================== function messageDiscordChatChannel(message) { - if(!getServerConfig().discordConfig.sendChat) { - return false; - } + if(!getServerConfig().discordConfig.sendChat) { + return false; + } - message = removeColoursInMessage(message); - console.warn(message); - let payloadData = { - "username": "Chat", - "content": message, - }; + message = removeColoursInMessage(message); + console.warn(message); + let payloadData = { + "username": "Chat", + "content": message, + }; - triggerWebHook(getServerConfig().discordConfig.chatChannelWebHookURL, JSON.stringify(payloadData)); + triggerWebHook(getServerConfig().discordConfig.chatChannelWebHookURL, JSON.stringify(payloadData)); } // =========================================================================== function messageDiscordAdminChannel(message) { - if(!getServerConfig().discordConfig.sendAdminEvents) { - return false; - } + if(!getServerConfig().discordConfig.sendAdminEvents) { + return false; + } - message = removeColoursInMessage(message); - console.warn(message); - let payloadData = { - "username": "Admin Event", - "content": message, - }; + message = removeColoursInMessage(message); + console.warn(message); + let payloadData = { + "username": "Admin Event", + "content": message, + }; - triggerWebHook(getServerConfig().discordConfig.adminChannelWebHookURL, JSON.stringify(payloadData)); + triggerWebHook(getServerConfig().discordConfig.adminChannelWebHookURL, JSON.stringify(payloadData)); } // =========================================================================== function messageDiscordEventChannel(message) { - if(!getServerConfig().discordConfig.sendEvents) { - return false; - } + if(!getServerConfig().discordConfig.sendEvents) { + return false; + } - message = removeColoursInMessage(message); - console.warn(message); - let payloadData = { - "username": "Event", - "content": message, - }; + message = removeColoursInMessage(message); + console.warn(message); + let payloadData = { + "username": "Event", + "content": message, + }; - triggerWebHook(getServerConfig().discordConfig.eventChannelWebHookURL, JSON.stringify(payloadData)); + triggerWebHook(getServerConfig().discordConfig.eventChannelWebHookURL, JSON.stringify(payloadData)); } // =========================================================================== \ No newline at end of file diff --git a/scripts/server/economy.js b/scripts/server/economy.js index 0a90b279..56abfc4b 100644 --- a/scripts/server/economy.js +++ b/scripts/server/economy.js @@ -30,10 +30,10 @@ function playerPayDay(client) { let wealth = calculateWealth(client); let grossIncome = getPlayerData(client).payDayAmount; - // Passive income + // Passive income grossIncome = grossIncome + getGlobalConfig().economy.passiveIncomePerPayDay; - // Payday bonus + // Payday bonus grossIncome = grossIncome*getGlobalConfig().economy.grossIncomeMultiplier; let incomeTaxAmount = calculateIncomeTax(wealth); @@ -120,12 +120,12 @@ function setPayDayBonusMultiplier(command, params, client) { let newMultiplier = params; - if(isNaN(newMultiplier)) { - messagePlayerError(client, getLocaleString(client, "AmountNotNumber")); - return false; - } + if(isNaN(newMultiplier)) { + messagePlayerError(client, getLocaleString(client, "AmountNotNumber")); + return false; + } - getGlobalConfig().economy.grossIncomeMultiplier = newMultiplier; + getGlobalConfig().economy.grossIncomeMultiplier = newMultiplier; messageAdminAction(`${client.name} set payday bonus to ${newMultiplier*100}%`); } diff --git a/scripts/server/email.js b/scripts/server/email.js index 10ecdd20..a5b120b4 100644 --- a/scripts/server/email.js +++ b/scripts/server/email.js @@ -8,47 +8,47 @@ // =========================================================================== function initEmailScript() { - if(!checkForSMTPModule()) { - return false; - } + if(!checkForSMTPModule()) { + return false; + } logToConsole(LOG_INFO, "[VRR.Email]: Initializing email script ..."); - emailConfig = loadEmailConfiguration(); + emailConfig = loadEmailConfiguration(); logToConsole(LOG_INFO, "[VRR.Email]: Email script initialized successfully!"); } // =========================================================================== function sendEmail(toEmail, toName, subject, body) { - if(!checkForSMTPModule()) { - return false; - } + if(!checkForSMTPModule()) { + return false; + } - module.smtp.send( - getEmailConfig().smtp.host, - getEmailConfig().smtp.port, - intToBool(getEmailConfig().smtp.useTLS), - getEmailConfig().smtp.username, - getEmailConfig().smtp.password, - toEmail, - toName, - subject, - body, - getEmailConfig().smtp.from, - getEmailConfig().smtp.fromName); + module.smtp.send( + getEmailConfig().smtp.host, + getEmailConfig().smtp.port, + intToBool(getEmailConfig().smtp.useTLS), + getEmailConfig().smtp.username, + getEmailConfig().smtp.password, + toEmail, + toName, + subject, + body, + getEmailConfig().smtp.from, + getEmailConfig().smtp.fromName); } // =========================================================================== function loadEmailConfiguration() { - let emailConfigFile = loadTextFile("config/email.json"); + let emailConfigFile = loadTextFile("config/email.json"); return JSON.parse(emailConfigFile); } // =========================================================================== function getEmailConfig() { - return emailConfig; + return emailConfig; } // =========================================================================== \ No newline at end of file diff --git a/scripts/server/event.js b/scripts/server/event.js index b10b1780..8bbb46f7 100644 --- a/scripts/server/event.js +++ b/scripts/server/event.js @@ -8,60 +8,60 @@ // =========================================================================== function initEventScript() { - logToConsole(LOG_INFO, "[VRR.Event]: Initializing event script ..."); - addAllEventHandlers(); - logToConsole(LOG_INFO, "[VRR.Event]: Event script initialized!"); + logToConsole(LOG_INFO, "[VRR.Event]: Initializing event script ..."); + addAllEventHandlers(); + logToConsole(LOG_INFO, "[VRR.Event]: Event script initialized!"); } // =========================================================================== function addAllEventHandlers() { - addEventHandler("onResourceStart", onResourceStart); - addEventHandler("onResourceStop", onResourceStop); - addEventHandler("onServerStop", onResourceStop); + addEventHandler("onResourceStart", onResourceStart); + addEventHandler("onResourceStop", onResourceStop); + addEventHandler("onServerStop", onResourceStop); - addEventHandler("onProcess", onProcess); - addEventHandler("onEntityProcess", onEntityProcess); + addEventHandler("onProcess", onProcess); + addEventHandler("onEntityProcess", onEntityProcess); - addEventHandler("onPlayerConnect", onPlayerConnect); - addEventHandler("onPlayerJoin", onPlayerJoin); - addEventHandler("onPlayerJoined", onPlayerJoined); - addEventHandler("onPlayerChat", onPlayerChat); - addEventHandler("onPlayerQuit", onPlayerQuit); - addEventHandler("onElementStreamIn", onElementStreamIn); - addEventHandler("onElementStreamOut", onElementStreamOut); + addEventHandler("onPlayerConnect", onPlayerConnect); + addEventHandler("onPlayerJoin", onPlayerJoin); + addEventHandler("onPlayerJoined", onPlayerJoined); + addEventHandler("onPlayerChat", onPlayerChat); + addEventHandler("onPlayerQuit", onPlayerQuit); + addEventHandler("onElementStreamIn", onElementStreamIn); + addEventHandler("onElementStreamOut", onElementStreamOut); - addEventHandler("onPedSpawn", onPedSpawn); - addEventHandler("onPedEnterVehicle", onPedEnteringVehicle); - addEventHandler("onPedExitVehicle", onPedExitingVehicle); + addEventHandler("onPedSpawn", onPedSpawn); + addEventHandler("onPedEnterVehicle", onPedEnteringVehicle); + addEventHandler("onPedExitVehicle", onPedExitingVehicle); - addEventHandler("onPedEnteringVehicle", onPedEnteringVehicle); - addEventHandler("onPedExitingVehicle", onPedExitingVehicle); + addEventHandler("onPedEnteringVehicle", onPedEnteringVehicle); + addEventHandler("onPedExitingVehicle", onPedExitingVehicle); - addEventHandler("OnPlayerCommand", onPlayerCommand); + addEventHandler("OnPlayerCommand", onPlayerCommand); } // =========================================================================== function onPlayerConnect(event, ipAddress, port) { - logToConsole(LOG_INFO, `[VRR.Event] Client connecting (IP: ${ipAddress})`); - //if(isIpAddressBanned(ipAddress)) { - // messagePlayerError(client, "You are banned from this server!"); - // return false; - //} + logToConsole(LOG_INFO, `[VRR.Event] Client connecting (IP: ${ipAddress})`); + //if(isIpAddressBanned(ipAddress)) { + // messagePlayerError(client, "You are banned from this server!"); + // return false; + //} } // =========================================================================== function onPlayerJoin(event, client) { - logToConsole(LOG_INFO, `[VRR.Event] Client ${client.name}[${client.index}] joining from ${client.ip}`); + logToConsole(LOG_INFO, `[VRR.Event] Client ${client.name}[${client.index}] joining from ${client.ip}`); - if(isFadeCameraSupported()) { - fadeCamera(client, true, 1.0); - } + if(isFadeCameraSupported()) { + fadeCamera(client, true, 1.0); + } - messageAdmins(`${client.name} is joining the server ...`); - //messageDiscordEventChannel(`👋 ${getPlayerDisplayForConsole(client)} has joined the server.`); + messageAdmins(`${client.name} is joining the server ...`); + //messageDiscordEventChannel(`👋 ${getPlayerDisplayForConsole(client)} has joined the server.`); } // =========================================================================== @@ -73,16 +73,16 @@ function onPlayerJoined(event, client) { // =========================================================================== function onElementStreamIn(event, element, client) { - //if(getPlayerDimension(client) != getElementDimension(element)) { - // event.preventDefault(); - //} + //if(getPlayerDimension(client) != getElementDimension(element)) { + // event.preventDefault(); + //} - if(getPlayerData(getClientFromIndex(element.owner)) != false ) { - if(hasBitFlag(getPlayerData(getClientFromIndex(element.owner)).accountData.flags.moderation, getModerationFlagValue("DontSyncClientElements"))) { - event.preventDefault(); - destroyGameElement(element); - } - } + if(getPlayerData(getClientFromIndex(element.owner)) != false ) { + if(hasBitFlag(getPlayerData(getClientFromIndex(element.owner)).accountData.flags.moderation, getModerationFlagValue("DontSyncClientElements"))) { + event.preventDefault(); + destroyGameElement(element); + } + } } // =========================================================================== @@ -94,43 +94,43 @@ function onElementStreamOut(event, element, client) { // =========================================================================== function onPlayerQuit(event, client, quitReasonId) { - logToConsole(LOG_INFO, `👋 Client ${getPlayerDisplayForConsole(client)} disconnected (${disconnectReasons[quitReasonId]}[${quitReasonId}])`); - updateConnectionLogOnQuit(client, quitReasonId); + logToConsole(LOG_INFO, `👋 Client ${getPlayerDisplayForConsole(client)} disconnected (${disconnectReasons[quitReasonId]}[${quitReasonId}])`); + updateConnectionLogOnQuit(client, quitReasonId); - if(isPlayerLoggedIn(client)) { - let reasonText = disconnectReasons[quitReasonId]; - if(getPlayerData(client).customDisconnectReason != "") { - reasonText = getPlayerData(client).customDisconnectReason; - } - messagePlayerNormal(null, `👋 ${getPlayerName(client)} has left the server (${reasonText})`, getColourByName("softYellow")); - savePlayerToDatabase(client); - resetClientStuff(client); - getServerData().clients[client.index] = null; - } + if(isPlayerLoggedIn(client)) { + let reasonText = disconnectReasons[quitReasonId]; + if(getPlayerData(client).customDisconnectReason != "") { + reasonText = getPlayerData(client).customDisconnectReason; + } + messagePlayerNormal(null, `👋 ${getPlayerName(client)} has left the server (${reasonText})`, getColourByName("softYellow")); + savePlayerToDatabase(client); + resetClientStuff(client); + getServerData().clients[client.index] = null; + } - messageDiscordEventChannel(`👋 ${getPlayerDisplayForConsole(client)} has left the server.`); + messageDiscordEventChannel(`👋 ${getPlayerDisplayForConsole(client)} has left the server.`); - clearTemporaryVehicles(); - clearTemporaryPeds(); + clearTemporaryVehicles(); + clearTemporaryPeds(); } // =========================================================================== async function onPlayerChat(event, client, messageText) { - event.preventDefault(); + event.preventDefault(); - processPlayerChat(client, messageText); + processPlayerChat(client, messageText); } // =========================================================================== function onProcess(event, deltaTime) { - updateServerGameTime(); - //checkPlayerSpawning(); - //checkPlayerPedState(); - //checkVehicleBurning(); + updateServerGameTime(); + //checkPlayerSpawning(); + //checkPlayerPedState(); + //checkVehicleBurning(); - processVehiclePurchasing(); + processVehiclePurchasing(); } // =========================================================================== @@ -141,89 +141,89 @@ function onEntityProcess(event, entity) { // =========================================================================== function onPedEnteringVehicle(event, ped, vehicle, seat) { - if(ped.isType(ELEMENT_PLAYER)) { - let client = getClientFromPlayerElement(ped); - getPlayerData(client).pedState = VRR_PEDSTATE_ENTERINGVEHICLE; + if(ped.isType(ELEMENT_PLAYER)) { + let client = getClientFromPlayerElement(ped); + getPlayerData(client).pedState = VRR_PEDSTATE_ENTERINGVEHICLE; - if(!getVehicleData(vehicle)) { - return false; - } + if(!getVehicleData(vehicle)) { + return false; + } - if(getVehicleData(vehicle).locked) { - if(doesPlayerHaveVehicleKeys(client, vehicle)) { - if(!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand(client, "lock")) { - messagePlayerTip(client, `🔒 This ${getVehicleName(vehicle)} is locked. Press {ALTCOLOUR}${toUpperCase(getKeyNameFromId(getPlayerKeyBindForCommand(client, "lock").key))} {MAINCOLOUR}to unlock it.`); - } else { - messagePlayerNormal(client, `🔒 This ${getVehicleName(vehicle)} is locked. Use /lock to unlock it`); - } - } else { - messagePlayerNormal(client, `🔒 This ${getVehicleName(vehicle)} is locked and you don't have the keys to unlock it`); - } + if(getVehicleData(vehicle).locked) { + if(doesPlayerHaveVehicleKeys(client, vehicle)) { + if(!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand(client, "lock")) { + messagePlayerTip(client, `🔒 This ${getVehicleName(vehicle)} is locked. Press {ALTCOLOUR}${toUpperCase(getKeyNameFromId(getPlayerKeyBindForCommand(client, "lock").key))} {MAINCOLOUR}to unlock it.`); + } else { + messagePlayerNormal(client, `🔒 This ${getVehicleName(vehicle)} is locked. Use /lock to unlock it`); + } + } else { + messagePlayerNormal(client, `🔒 This ${getVehicleName(vehicle)} is locked and you don't have the keys to unlock it`); + } - getPlayerData(client).enteringVehicle = null; - makePlayerStopAnimation(client); - return false; - } + getPlayerData(client).enteringVehicle = null; + makePlayerStopAnimation(client); + return false; + } - getPlayerData(client).enteringVehicle = vehicle; - } + getPlayerData(client).enteringVehicle = vehicle; + } } // =========================================================================== function onPedExitingVehicle(event, ped, vehicle) { - if(!getVehicleData(vehicle)) { - return false; - } + if(!getVehicleData(vehicle)) { + return false; + } - if(ped.isType(ELEMENT_PLAYER)) { - let client = getClientFromPlayerElement(ped); - getPlayerData(client).pedState = VRR_PEDSTATE_EXITINGVEHICLE; - } + if(ped.isType(ELEMENT_PLAYER)) { + let client = getClientFromPlayerElement(ped); + getPlayerData(client).pedState = VRR_PEDSTATE_EXITINGVEHICLE; + } - if(!getVehicleData(vehicle).spawnLocked) { - getVehicleData(vehicle).spawnPosition = getVehiclePosition(vehicle); - getVehicleData(vehicle).spawnRotation = getVehicleHeading(vehicle); - getVehicleData(vehicle).needsSaved = true; - } + if(!getVehicleData(vehicle).spawnLocked) { + getVehicleData(vehicle).spawnPosition = getVehiclePosition(vehicle); + getVehicleData(vehicle).spawnRotation = getVehicleHeading(vehicle); + getVehicleData(vehicle).needsSaved = true; + } } // =========================================================================== function onResourceStart(event, resource) { - logToConsole(LOG_WARN, `[VRR.Event] ${resource.name} started!`); + logToConsole(LOG_WARN, `[VRR.Event] ${resource.name} started!`); - if(resource != thisResource) { - messageAdmins(`{MAINCOLOUR}Resource {ALTCOLOUR}${resource.name} {MAINCOLOUR}started!`); - } + if(resource != thisResource) { + messageAdmins(`{MAINCOLOUR}Resource {ALTCOLOUR}${resource.name} {MAINCOLOUR}started!`); + } } // =========================================================================== function onResourceStop(event, resource) { - logToConsole(LOG_WARN, `[VRR.Event] ${resource.name} stopped!`); + logToConsole(LOG_WARN, `[VRR.Event] ${resource.name} stopped!`); - if(resource != thisResource) { - messageAdmins(`{MAINCOLOUR}Resource {ALTCOLOUR}${resource.name} {MAINCOLOUR}stopped!`); - } + if(resource != thisResource) { + messageAdmins(`{MAINCOLOUR}Resource {ALTCOLOUR}${resource.name} {MAINCOLOUR}stopped!`); + } - if(resource == thisResource) { - saveAllServerDataToDatabase(); - clearArray(getServerData().vehicles); - clearArray(getServerData().clients); - clearArray(getServerData().businesses); - clearArray(getServerData().houses); - clearArray(getServerData().factions); - clearArray(getServerData().jobs); - clearArray(getServerData().clans); - clearArray(getServerData().items); - clearArray(getServerData().itemTypes); - clearArray(getServerData().groundItemCache); - clearArray(getServerData().groundPlantCache); - kickAllClients(); - } + if(resource == thisResource) { + saveAllServerDataToDatabase(); + clearArray(getServerData().vehicles); + clearArray(getServerData().clients); + clearArray(getServerData().businesses); + clearArray(getServerData().houses); + clearArray(getServerData().factions); + clearArray(getServerData().jobs); + clearArray(getServerData().clans); + clearArray(getServerData().items); + clearArray(getServerData().itemTypes); + clearArray(getServerData().groundItemCache); + clearArray(getServerData().groundPlantCache); + kickAllClients(); + } - collectAllGarbage(); + collectAllGarbage(); } // =========================================================================== @@ -241,184 +241,184 @@ function onPlayerExitedSphere(client, sphere) { // =========================================================================== async function onPlayerEnteredVehicle(client, clientVehicle, seat) { - if(client == null) { - return false; - } + if(client == null) { + return false; + } - let vehicle = null; + let vehicle = null; - if(getGame() == VRR_GAME_GTA_IV) { - vehicle = getVehicleFromIVNetworkId(clientVehicle); - } else { - if(client.player == null) { - return false; - } + if(getGame() == VRR_GAME_GTA_IV) { + vehicle = getVehicleFromIVNetworkId(clientVehicle); + } else { + if(client.player == null) { + return false; + } - await waitUntil(() => client != null && client.player != null && client.player.vehicle != null); + await waitUntil(() => client != null && client.player != null && client.player.vehicle != null); - vehicle = client.player.vehicle; - } + vehicle = client.player.vehicle; + } - if(!getVehicleData(vehicle)) { - return false; - } + if(!getVehicleData(vehicle)) { + return false; + } - logToConsole(LOG_DEBUG, `[VRR.Event] ${getPlayerDisplayForConsole(client)} entered a ${getVehicleName(vehicle)} (ID: ${vehicle.getData("vrr.dataSlot")}, Database ID: ${getVehicleData(vehicle).databaseId})`); + logToConsole(LOG_DEBUG, `[VRR.Event] ${getPlayerDisplayForConsole(client)} entered a ${getVehicleName(vehicle)} (ID: ${vehicle.getData("vrr.dataSlot")}, Database ID: ${getVehicleData(vehicle).databaseId})`); - getPlayerData(client).lastVehicle = vehicle; - getVehicleData(vehicle).lastActiveTime = getCurrentUnixTimestamp(); + getPlayerData(client).lastVehicle = vehicle; + getVehicleData(vehicle).lastActiveTime = getCurrentUnixTimestamp(); - if(getPlayerVehicleSeat(client) == VRR_VEHSEAT_DRIVER) { - vehicle.engine = getVehicleData(vehicle).engine; + if(getPlayerVehicleSeat(client) == VRR_VEHSEAT_DRIVER) { + vehicle.engine = getVehicleData(vehicle).engine; - if(getVehicleData(vehicle).buyPrice > 0) { - messagePlayerAlert(client, getLocaleString(client, "VehicleForSale", getVehicleName(vehicle), `{ALTCOLOUR}$${makeLargeNumberReadable(getVehicleData(vehicle).buyPrice)}{MAINCOLOUR}`, `{ALTCOLOUR}/vehbuy{MAINCOLOUR}`)); - resetVehiclePosition(vehicle); - } else if(getVehicleData(vehicle).rentPrice > 0) { - if(getVehicleData(vehicle).rentedBy != client) { - messagePlayerAlert(client, getLocaleString(client, "VehicleForRent", getVehicleName(vehicle), `{ALTCOLOUR}$${makeLargeNumberReadable(getVehicleData(vehicle).rentPrice)}{MAINCOLOUR}`, `{ALTCOLOUR}/vehrent{MAINCOLOUR}`)); - resetVehiclePosition(vehicle); - } else { - messagePlayerAlert(client, `You are renting this ${getVehicleName(vehicle)} for {ALTCOLOUR}$${makeLargeNumberReadable(getVehicleData(vehicle).rentPrice)} per minute. {MAINCOLOUR}Use {ALTCOLOUR}/stoprent {MAINCOLOUR}if you want to stop renting it.`); - } - } else { - let ownerName = "Nobody"; - let ownerType = "None"; - ownerType = toLowerCase(getVehicleOwnerTypeText(getVehicleData(vehicle).ownerType)); - switch(getVehicleData(vehicle).ownerType) { - case VRR_VEHOWNER_CLAN: - ownerName = getClanData(getClanIdFromDatabaseId(getVehicleData(vehicle).ownerId)).name; - ownerType = "clan"; - break; + if(getVehicleData(vehicle).buyPrice > 0) { + messagePlayerAlert(client, getLocaleString(client, "VehicleForSale", getVehicleName(vehicle), `{ALTCOLOUR}$${makeLargeNumberReadable(getVehicleData(vehicle).buyPrice)}{MAINCOLOUR}`, `{ALTCOLOUR}/vehbuy{MAINCOLOUR}`)); + resetVehiclePosition(vehicle); + } else if(getVehicleData(vehicle).rentPrice > 0) { + if(getVehicleData(vehicle).rentedBy != client) { + messagePlayerAlert(client, getLocaleString(client, "VehicleForRent", getVehicleName(vehicle), `{ALTCOLOUR}$${makeLargeNumberReadable(getVehicleData(vehicle).rentPrice)}{MAINCOLOUR}`, `{ALTCOLOUR}/vehrent{MAINCOLOUR}`)); + resetVehiclePosition(vehicle); + } else { + messagePlayerAlert(client, `You are renting this ${getVehicleName(vehicle)} for {ALTCOLOUR}$${makeLargeNumberReadable(getVehicleData(vehicle).rentPrice)} per minute. {MAINCOLOUR}Use {ALTCOLOUR}/stoprent {MAINCOLOUR}if you want to stop renting it.`); + } + } else { + let ownerName = "Nobody"; + let ownerType = "None"; + ownerType = toLowerCase(getVehicleOwnerTypeText(getVehicleData(vehicle).ownerType)); + switch(getVehicleData(vehicle).ownerType) { + case VRR_VEHOWNER_CLAN: + ownerName = getClanData(getClanIdFromDatabaseId(getVehicleData(vehicle).ownerId)).name; + ownerType = "clan"; + break; - case VRR_VEHOWNER_JOB: - ownerName = getJobData(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)).name; - ownerType = "job"; - break; + case VRR_VEHOWNER_JOB: + ownerName = getJobData(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)).name; + ownerType = "job"; + break; - case VRR_VEHOWNER_PLAYER: - let subAccountData = loadSubAccountFromId(getVehicleData(vehicle).ownerId); - ownerName = `${subAccountData.firstName} ${subAccountData.lastName}`; - ownerType = "player"; - break; + case VRR_VEHOWNER_PLAYER: + let subAccountData = loadSubAccountFromId(getVehicleData(vehicle).ownerId); + ownerName = `${subAccountData.firstName} ${subAccountData.lastName}`; + ownerType = "player"; + break; - case VRR_VEHOWNER_BIZ: - ownerName = getBusinessData(getVehicleData(vehicle).ownerId).name; - ownerType = "business"; - break; + case VRR_VEHOWNER_BIZ: + ownerName = getBusinessData(getVehicleData(vehicle).ownerId).name; + ownerType = "business"; + break; - default: - break; - } - messagePlayerAlert(client, `This ${getVehicleName(vehicle)} belongs to {ALTCOLOUR}${ownerName} (${ownerType})`); - } + default: + break; + } + messagePlayerAlert(client, `This ${getVehicleName(vehicle)} belongs to {ALTCOLOUR}${ownerName} (${ownerType})`); + } - if(!getVehicleData(vehicle).engine) { - if(getVehicleData(vehicle).buyPrice == 0 && getVehicleData(vehicle).rentPrice == 0) { - if(doesPlayerHaveVehicleKeys(client, vehicle)) { - if(!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand(client, "engine")) { - messagePlayerTip(client, `This ${getVehicleName(vehicle)}'s engine is off. Press {ALTCOLOUR}${toUpperCase(getKeyNameFromId(getPlayerKeyBindForCommand(client, "engine").key))} {MAINCOLOUR}to start it.`); - } else { - messagePlayerAlert(client, `This ${getVehicleName(vehicle)}'s engine is off. Use /engine to start it`); - } - } else { - messagePlayerAlert(client, `This ${getVehicleName(vehicle)}'s engine is off and you don't have the keys to start it`); + if(!getVehicleData(vehicle).engine) { + if(getVehicleData(vehicle).buyPrice == 0 && getVehicleData(vehicle).rentPrice == 0) { + if(doesPlayerHaveVehicleKeys(client, vehicle)) { + if(!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand(client, "engine")) { + messagePlayerTip(client, `This ${getVehicleName(vehicle)}'s engine is off. Press {ALTCOLOUR}${toUpperCase(getKeyNameFromId(getPlayerKeyBindForCommand(client, "engine").key))} {MAINCOLOUR}to start it.`); + } else { + messagePlayerAlert(client, `This ${getVehicleName(vehicle)}'s engine is off. Use /engine to start it`); + } + } else { + messagePlayerAlert(client, `This ${getVehicleName(vehicle)}'s engine is off and you don't have the keys to start it`); - } - } - resetVehiclePosition(vehicle); - } + } + } + resetVehiclePosition(vehicle); + } - let currentSubAccount = getPlayerCurrentSubAccount(client); + let currentSubAccount = getPlayerCurrentSubAccount(client); - if(isPlayerWorking(client)) { - if(getVehicleData(vehicle).ownerType == VRR_VEHOWNER_JOB) { - if(getVehicleData(vehicle).ownerId == getPlayerCurrentSubAccount(client).job) { - getPlayerCurrentSubAccount(client).lastJobVehicle = vehicle; - messagePlayerInfo(client, `Use /startroute to start working in this vehicle`); - } - } - } + if(isPlayerWorking(client)) { + if(getVehicleData(vehicle).ownerType == VRR_VEHOWNER_JOB) { + if(getVehicleData(vehicle).ownerId == getPlayerCurrentSubAccount(client).job) { + getPlayerCurrentSubAccount(client).lastJobVehicle = vehicle; + messagePlayerInfo(client, `Use /startroute to start working in this vehicle`); + } + } + } - if(isPlayerWorking(client)) { - if(isPlayerOnJobRoute(client)) { - if(vehicle == getPlayerJobRouteVehicle(client)) { - stopReturnToJobVehicleCountdown(client); - } - } - } - } + if(isPlayerWorking(client)) { + if(isPlayerOnJobRoute(client)) { + if(vehicle == getPlayerJobRouteVehicle(client)) { + stopReturnToJobVehicleCountdown(client); + } + } + } + } - if(getVehicleData(vehicle).streamingRadioStation != -1) { - if(getPlayerData(client).streamingRadioStation != getVehicleData(vehicle).streamingRadioStation) { - playRadioStreamForPlayer(client, radioStations[getVehicleData(vehicle).streamingRadioStation].url, true, getPlayerStreamingRadioVolume(client)); - } - } + if(getVehicleData(vehicle).streamingRadioStation != -1) { + if(getPlayerData(client).streamingRadioStation != getVehicleData(vehicle).streamingRadioStation) { + playRadioStreamForPlayer(client, radioStations[getVehicleData(vehicle).streamingRadioStation].url, true, getPlayerStreamingRadioVolume(client)); + } + } } // =========================================================================== function onPlayerExitedVehicle(client, vehicle) { - getPlayerData(client).pedState = VRR_PEDSTATE_READY; + getPlayerData(client).pedState = VRR_PEDSTATE_READY; - stopRadioStreamForPlayer(client); + stopRadioStreamForPlayer(client); - if(!getVehicleData(vehicle)) { - return false; - } + if(!getVehicleData(vehicle)) { + return false; + } - if(isPlayerWorking(client)) { - if(isPlayerOnJobRoute(client)) { - if(vehicle == getPlayerJobRouteVehicle(client)) { - startReturnToJobVehicleCountdown(client); - } - } - } + if(isPlayerWorking(client)) { + if(isPlayerOnJobRoute(client)) { + if(vehicle == getPlayerJobRouteVehicle(client)) { + startReturnToJobVehicleCountdown(client); + } + } + } - getVehicleData(vehicle).lastActiveTime = getCurrentUnixTimestamp(); + getVehicleData(vehicle).lastActiveTime = getCurrentUnixTimestamp(); - logToConsole(LOG_DEBUG, `[VRR.Event] ${getPlayerDisplayForConsole(client)} exited a ${getVehicleName(vehicle)} (ID: ${vehicle.getData("vrr.dataSlot")}, Database ID: ${getVehicleData(vehicle).databaseId})`); + logToConsole(LOG_DEBUG, `[VRR.Event] ${getPlayerDisplayForConsole(client)} exited a ${getVehicleName(vehicle)} (ID: ${vehicle.getData("vrr.dataSlot")}, Database ID: ${getVehicleData(vehicle).databaseId})`); } // =========================================================================== function onPlayerDeath(client, position) { - logToConsole(LOG_INFO, `${getPlayerDisplayForConsole(client)} died.`); - getPlayerData(client).pedState = VRR_PEDSTATE_DEAD; + logToConsole(LOG_INFO, `${getPlayerDisplayForConsole(client)} died.`); + getPlayerData(client).pedState = VRR_PEDSTATE_DEAD; updatePlayerSpawnedState(client, false); - setPlayerControlState(client, false); + setPlayerControlState(client, false); setTimeout(function() { - if(isFadeCameraSupported()) { - fadeCamera(client, false, 1.0); - } + if(isFadeCameraSupported()) { + fadeCamera(client, false, 1.0); + } setTimeout(function() { if(getPlayerCurrentSubAccount(client).inJail) { - let closestJail = getClosestPoliceStation(getPlayerPosition(client)); - client.despawnPlayer(); - getPlayerCurrentSubAccount(client).interior = closestJail.interior; - getPlayerCurrentSubAccount(client).dimension = closestJail.dimension; - spawnPlayer(client, closestJail.position, closestJail.heading, getGameConfig().skins[getGame()][getPlayerCurrentSubAccount(client).skin][0]); + let closestJail = getClosestPoliceStation(getPlayerPosition(client)); + client.despawnPlayer(); + getPlayerCurrentSubAccount(client).interior = closestJail.interior; + getPlayerCurrentSubAccount(client).dimension = closestJail.dimension; + spawnPlayer(client, closestJail.position, closestJail.heading, getGameConfig().skins[getGame()][getPlayerCurrentSubAccount(client).skin][0]); - if(isFadeCameraSupported()) { - fadeCamera(client, true, 1.0); - } - updatePlayerSpawnedState(client, true); - makePlayerStopAnimation(client); - setPlayerControlState(client, true); + if(isFadeCameraSupported()) { + fadeCamera(client, true, 1.0); + } + updatePlayerSpawnedState(client, true); + makePlayerStopAnimation(client); + setPlayerControlState(client, true); } else { - let closestHospital = getClosestHospital(getPlayerPosition(client)); - client.despawnPlayer(); - getPlayerCurrentSubAccount(client).interior = closestHospital.interior; - getPlayerCurrentSubAccount(client).dimension = closestHospital.dimension; - spawnPlayer(client, closestHospital.position, closestHospital.heading, getGameConfig().skins[getGame()][getPlayerCurrentSubAccount(client).skin][0]); + let closestHospital = getClosestHospital(getPlayerPosition(client)); + client.despawnPlayer(); + getPlayerCurrentSubAccount(client).interior = closestHospital.interior; + getPlayerCurrentSubAccount(client).dimension = closestHospital.dimension; + spawnPlayer(client, closestHospital.position, closestHospital.heading, getGameConfig().skins[getGame()][getPlayerCurrentSubAccount(client).skin][0]); - if(isFadeCameraSupported()) { - fadeCamera(client, true, 1.0); - } - - updatePlayerSpawnedState(client, true); - makePlayerStopAnimation(client); - setPlayerControlState(client, true); + if(isFadeCameraSupported()) { + fadeCamera(client, true, 1.0); + } + + updatePlayerSpawnedState(client, true); + makePlayerStopAnimation(client); + setPlayerControlState(client, true); } }, 2000); }, 1000); @@ -427,179 +427,179 @@ function onPlayerDeath(client, position) { // =========================================================================== function onPedSpawn(ped) { - if(ped.type == ELEMENT_PLAYER) { - //setTimeout(onPlayerSpawn, 250, ped); - onPlayerSpawn(); - } + if(ped.type == ELEMENT_PLAYER) { + //setTimeout(onPlayerSpawn, 250, ped); + onPlayerSpawn(); + } } // =========================================================================== function onPlayerSpawn(client) { - logToConsole(LOG_DEBUG, `[VRR.Event] Checking for ${getPlayerDisplayForConsole(client)}'s player ped`); - //if(client.player == null) { - // logToConsole(LOG_DEBUG, `[VRR.Event] ${getPlayerDisplayForConsole(client)}'s player element not set yet. Rechecking ...`); - // setTimeout(onPlayerSpawn, 500, client); - // return false; - //} + logToConsole(LOG_DEBUG, `[VRR.Event] Checking for ${getPlayerDisplayForConsole(client)}'s player ped`); + //if(client.player == null) { + // logToConsole(LOG_DEBUG, `[VRR.Event] ${getPlayerDisplayForConsole(client)}'s player element not set yet. Rechecking ...`); + // setTimeout(onPlayerSpawn, 500, client); + // return false; + //} - logToConsole(LOG_DEBUG, `[VRR.Event] ${getPlayerDisplayForConsole(client)}'s player ped is valid. Continuing spawn processing ...`); + logToConsole(LOG_DEBUG, `[VRR.Event] ${getPlayerDisplayForConsole(client)}'s player ped is valid. Continuing spawn processing ...`); - logToConsole(LOG_DEBUG, `[VRR.Event] Checking ${getPlayerDisplayForConsole(client)}'s player data`); - if(!getPlayerData(client)) { - logToConsole(LOG_DEBUG, `[VRR.Event] ${getPlayerDisplayForConsole(client)}'s player data is invalid. Kicking them from server.`); - client.disconnect(); - return false; - } + logToConsole(LOG_DEBUG, `[VRR.Event] Checking ${getPlayerDisplayForConsole(client)}'s player data`); + if(!getPlayerData(client)) { + logToConsole(LOG_DEBUG, `[VRR.Event] ${getPlayerDisplayForConsole(client)}'s player data is invalid. Kicking them from server.`); + client.disconnect(); + return false; + } - logToConsole(LOG_DEBUG, `[VRR.Event] Checking ${getPlayerDisplayForConsole(client)}'s login status`); - if(!getPlayerData(client).loggedIn) { - logToConsole(LOG_DEBUG, `[VRR.Event] ${getPlayerDisplayForConsole(client)} is NOT logged in. Despawning their player.`); - client.disconnect(); - return false; - } + logToConsole(LOG_DEBUG, `[VRR.Event] Checking ${getPlayerDisplayForConsole(client)}'s login status`); + if(!getPlayerData(client).loggedIn) { + logToConsole(LOG_DEBUG, `[VRR.Event] ${getPlayerDisplayForConsole(client)} is NOT logged in. Despawning their player.`); + client.disconnect(); + return false; + } - logToConsole(LOG_DEBUG, `[VRR.Event] Checking ${getPlayerDisplayForConsole(client)}'s selected character status`); - if(getPlayerData(client).currentSubAccount == -1) { - logToConsole(LOG_DEBUG, `[VRR.Event] ${getPlayerDisplayForConsole(client)} has NOT selected a character. Despawning their player.`); - client.disconnect(); - return false; - } + logToConsole(LOG_DEBUG, `[VRR.Event] Checking ${getPlayerDisplayForConsole(client)}'s selected character status`); + if(getPlayerData(client).currentSubAccount == -1) { + logToConsole(LOG_DEBUG, `[VRR.Event] ${getPlayerDisplayForConsole(client)} has NOT selected a character. Despawning their player.`); + client.disconnect(); + return false; + } - logToConsole(LOG_DEBUG, `[VRR.Event] ${getPlayerDisplayForConsole(client)}'s player data is valid. Continuing spawn processing ...`); + logToConsole(LOG_DEBUG, `[VRR.Event] ${getPlayerDisplayForConsole(client)}'s player data is valid. Continuing spawn processing ...`); - if(getServerGame() == VRR_GAME_GTA_IV) { - logToConsole(LOG_DEBUG, `[VRR.Event] Setting ${getPlayerDisplayForConsole(client)}'s ped body parts and props`); - setEntityData(client.player, "vrr.bodyParts", getPlayerCurrentSubAccount(client).bodyParts, true); - setEntityData(client.player, "vrr.bodyProps", getPlayerCurrentSubAccount(client).bodyProps, true); - } + if(getServerGame() == VRR_GAME_GTA_IV) { + logToConsole(LOG_DEBUG, `[VRR.Event] Setting ${getPlayerDisplayForConsole(client)}'s ped body parts and props`); + setEntityData(client.player, "vrr.bodyParts", getPlayerCurrentSubAccount(client).bodyParts, true); + setEntityData(client.player, "vrr.bodyProps", getPlayerCurrentSubAccount(client).bodyProps, true); + } - logToConsole(LOG_DEBUG, `[VRR.Event] Setting ${getPlayerDisplayForConsole(client)}'s ped scale (${getPlayerCurrentSubAccount(client).pedScale})`); - setEntityData(client.player, "vrr.scale", getPlayerCurrentSubAccount(client).pedScale, true); + logToConsole(LOG_DEBUG, `[VRR.Event] Setting ${getPlayerDisplayForConsole(client)}'s ped scale (${getPlayerCurrentSubAccount(client).pedScale})`); + setEntityData(client.player, "vrr.scale", getPlayerCurrentSubAccount(client).pedScale, true); - if(isPlayerSwitchingCharacter(client) || isPlayerCreatingCharacter(client)) { - logToConsole(LOG_DEBUG, `[VRR.Event] ${getPlayerDisplayForConsole(client)}'s ped is being used for character selection/creation. No further spawn processing needed'`); - return false; - } + if(isPlayerSwitchingCharacter(client) || isPlayerCreatingCharacter(client)) { + logToConsole(LOG_DEBUG, `[VRR.Event] ${getPlayerDisplayForConsole(client)}'s ped is being used for character selection/creation. No further spawn processing needed'`); + return false; + } - if(isCustomCameraSupported()) { - restorePlayerCamera(client); - } + if(isCustomCameraSupported()) { + restorePlayerCamera(client); + } - logToConsole(LOG_DEBUG, `[VRR.Event] Storing ${getPlayerDisplayForConsole(client)} ped in client data `); - if(areServerElementsSupported()) { - getPlayerData(client).ped = client.player; - } + logToConsole(LOG_DEBUG, `[VRR.Event] Storing ${getPlayerDisplayForConsole(client)} ped in client data `); + if(areServerElementsSupported()) { + getPlayerData(client).ped = client.player; + } - logToConsole(LOG_DEBUG, `[VRR.Event] Sending ${getPlayerDisplayForConsole(client)} the 'now playing as' message`); - messagePlayerAlert(client, `You are now playing as: {businessBlue}${getCharacterFullName(client)}`, getColourByName("white")); - messagePlayerNormal(client, "This server is in early development and may restart at any time for updates.", getColourByName("orange")); - messagePlayerNormal(client, "Please report any bugs using /bug and suggestions using /idea", getColourByName("yellow")); + logToConsole(LOG_DEBUG, `[VRR.Event] Sending ${getPlayerDisplayForConsole(client)} the 'now playing as' message`); + messagePlayerAlert(client, `You are now playing as: {businessBlue}${getCharacterFullName(client)}`, getColourByName("white")); + messagePlayerNormal(client, "This server is in early development and may restart at any time for updates.", getColourByName("orange")); + messagePlayerNormal(client, "Please report any bugs using /bug and suggestions using /idea", getColourByName("yellow")); - logToConsole(LOG_DEBUG, `[VRR.Event] Updating spawned state for ${getPlayerDisplayForConsole(client)} to true`); - updatePlayerSpawnedState(client, true); + logToConsole(LOG_DEBUG, `[VRR.Event] Updating spawned state for ${getPlayerDisplayForConsole(client)} to true`); + updatePlayerSpawnedState(client, true); - logToConsole(LOG_DEBUG, `[VRR.Event] Setting player interior for ${getPlayerDisplayForConsole(client)} to ${getPlayerCurrentSubAccount(client).interior}`); - setPlayerInterior(client, getPlayerCurrentSubAccount(client).interior); + logToConsole(LOG_DEBUG, `[VRR.Event] Setting player interior for ${getPlayerDisplayForConsole(client)} to ${getPlayerCurrentSubAccount(client).interior}`); + setPlayerInterior(client, getPlayerCurrentSubAccount(client).interior); - logToConsole(LOG_DEBUG, `[VRR.Event] Setting player dimension for ${getPlayerDisplayForConsole(client)} to ${getPlayerCurrentSubAccount(client).dimension}`); - setPlayerDimension(client, getPlayerCurrentSubAccount(client).dimension); + logToConsole(LOG_DEBUG, `[VRR.Event] Setting player dimension for ${getPlayerDisplayForConsole(client)} to ${getPlayerCurrentSubAccount(client).dimension}`); + setPlayerDimension(client, getPlayerCurrentSubAccount(client).dimension); - //if(getPlayerCurrentSubAccount(client).interior != 0 || getPlayerCurrentSubAccount(client).dimension != 0) { - // updateAllInteriorVehiclesForPlayer(client, getPlayerCurrentSubAccount(client).interior, getPlayerCurrentSubAccount(client).dimension); - //} + //if(getPlayerCurrentSubAccount(client).interior != 0 || getPlayerCurrentSubAccount(client).dimension != 0) { + // updateAllInteriorVehiclesForPlayer(client, getPlayerCurrentSubAccount(client).interior, getPlayerCurrentSubAccount(client).dimension); + //} - logToConsole(LOG_DEBUG, `[VRR.Event] Setting player health for ${getPlayerDisplayForConsole(client)} to ${getPlayerCurrentSubAccount(client).health}`); - setPlayerHealth(client, getPlayerCurrentSubAccount(client).health); + logToConsole(LOG_DEBUG, `[VRR.Event] Setting player health for ${getPlayerDisplayForConsole(client)} to ${getPlayerCurrentSubAccount(client).health}`); + setPlayerHealth(client, getPlayerCurrentSubAccount(client).health); - logToConsole(LOG_DEBUG, `[VRR.Event] Setting player armour for ${getPlayerDisplayForConsole(client)} to ${getPlayerCurrentSubAccount(client).armour}`); - setPlayerArmour(client, getPlayerCurrentSubAccount(client).armour); + logToConsole(LOG_DEBUG, `[VRR.Event] Setting player armour for ${getPlayerDisplayForConsole(client)} to ${getPlayerCurrentSubAccount(client).armour}`); + setPlayerArmour(client, getPlayerCurrentSubAccount(client).armour); - logToConsole(LOG_DEBUG, `[VRR.Event] Sending ${getPlayerDisplayForConsole(client)}'s job type to their client (${getJobIndexFromDatabaseId(getPlayerCurrentSubAccount(client))})`); - sendPlayerJobType(client, getPlayerCurrentSubAccount(client).job); + logToConsole(LOG_DEBUG, `[VRR.Event] Sending ${getPlayerDisplayForConsole(client)}'s job type to their client (${getJobIndexFromDatabaseId(getPlayerCurrentSubAccount(client))})`); + sendPlayerJobType(client, getPlayerCurrentSubAccount(client).job); - logToConsole(LOG_DEBUG, `[VRR.Event] Enabling all rendering states for ${getPlayerDisplayForConsole(client)}`); - setPlayer2DRendering(client, true, true, true, true, true, true); + logToConsole(LOG_DEBUG, `[VRR.Event] Enabling all rendering states for ${getPlayerDisplayForConsole(client)}`); + setPlayer2DRendering(client, true, true, true, true, true, true); - logToConsole(LOG_DEBUG, `[VRR.Event] Sending snow states to ${getPlayerDisplayForConsole(client)}`); - if(isSnowSupported()) { - updatePlayerSnowState(client); - } + logToConsole(LOG_DEBUG, `[VRR.Event] Sending snow states to ${getPlayerDisplayForConsole(client)}`); + if(isSnowSupported()) { + updatePlayerSnowState(client); + } - if(areServerElementsSupported() && getServerGame() == VRR_GAME_GTA_SA) { - logToConsole(LOG_DEBUG, `[VRR.Event] Setting player walk and fightstyle for ${getPlayerDisplayForConsole(client)}`); - setEntityData(client.player, "vrr.walkStyle", getPlayerCurrentSubAccount(client).walkStyle, true); + if(areServerElementsSupported() && getServerGame() == VRR_GAME_GTA_SA) { + logToConsole(LOG_DEBUG, `[VRR.Event] Setting player walk and fightstyle for ${getPlayerDisplayForConsole(client)}`); + setEntityData(client.player, "vrr.walkStyle", getPlayerCurrentSubAccount(client).walkStyle, true); - setPlayerFightStyle(client, getPlayerCurrentSubAccount(client).fightStyle); - } + setPlayerFightStyle(client, getPlayerCurrentSubAccount(client).fightStyle); + } - logToConsole(LOG_DEBUG, `[VRR.Event] Updating logo state for ${getPlayerDisplayForConsole(client)}`); - if(getServerConfig().showLogo && doesPlayerHaveLogoEnabled(client)) { - updatePlayerShowLogoState(client, true); - } + logToConsole(LOG_DEBUG, `[VRR.Event] Updating logo state for ${getPlayerDisplayForConsole(client)}`); + if(getServerConfig().showLogo && doesPlayerHaveLogoEnabled(client)) { + updatePlayerShowLogoState(client, true); + } - logToConsole(LOG_DEBUG, `[VRR.Event] Caching ${getPlayerDisplayForConsole(client)}'s hotbar items`); - cachePlayerHotBarItems(client); + logToConsole(LOG_DEBUG, `[VRR.Event] Caching ${getPlayerDisplayForConsole(client)}'s hotbar items`); + cachePlayerHotBarItems(client); - logToConsole(LOG_DEBUG, `[VRR.Event] Syncing ${getPlayerDisplayForConsole(client)}'s hotbar`); - updatePlayerHotBar(client); + logToConsole(LOG_DEBUG, `[VRR.Event] Syncing ${getPlayerDisplayForConsole(client)}'s hotbar`); + updatePlayerHotBar(client); - logToConsole(LOG_DEBUG, `[VRR.Event] Setting ${getPlayerDisplayForConsole(client)}'s switchchar state to false`); - getPlayerData(client).switchingCharacter = false; + logToConsole(LOG_DEBUG, `[VRR.Event] Setting ${getPlayerDisplayForConsole(client)}'s switchchar state to false`); + getPlayerData(client).switchingCharacter = false; - if(!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand(client, "enter")) { - let keyId = getPlayerKeyBindForCommand(client, "enter"); - logToConsole(LOG_DEBUG, `[VRR.Event] Sending custom enter property key ID (${keyId.key}, ${toUpperCase(getKeyNameFromId(keyId.key))}) to ${getPlayerDisplayForConsole(client)}`); - sendPlayerEnterPropertyKey(client, keyId.key); - } + if(!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand(client, "enter")) { + let keyId = getPlayerKeyBindForCommand(client, "enter"); + logToConsole(LOG_DEBUG, `[VRR.Event] Sending custom enter property key ID (${keyId.key}, ${toUpperCase(getKeyNameFromId(keyId.key))}) to ${getPlayerDisplayForConsole(client)}`); + sendPlayerEnterPropertyKey(client, keyId.key); + } - //if(isGTAIV()) { - // setEntityData(client.player, "vrr.bodyPartHair", getPlayerCurrentSubAccount(client).bodyParts.hair, true); - // setEntityData(client.player, "vrr.bodyPartHead", getPlayerCurrentSubAccount(client).bodyParts.head, true); - // setEntityData(client.player, "vrr.bodyPartUpper", getPlayerCurrentSubAccount(client).bodyParts.upper, true); - // setEntityData(client.player, "vrr.bodyPartLower", getPlayerCurrentSubAccount(client).bodyParts.lower, true); - // setEntityData(client.player, "vrr.bodyPropHair", getPlayerCurrentSubAccount(client).bodyProps.hair, true); - // setEntityData(client.player, "vrr.bodyPropEyes", getPlayerCurrentSubAccount(client).bodyProps.eyes, true); - // setEntityData(client.player, "vrr.bodyPartHead", getPlayerCurrentSubAccount(client).bodyProps.head, true); - // setEntityData(client.player, "vrr.bodyPartLeftHand", getPlayerCurrentSubAccount(client).bodyProps.leftHand, true); - // setEntityData(client.player, "vrr.bodyPartRightHand", getPlayerCurrentSubAccount(client).bodyProps.rightHand, true); - // setEntityData(client.player, "vrr.bodyPartLeftWrist", getPlayerCurrentSubAccount(client).bodyProps.leftWrist, true); - // setEntityData(client.player, "vrr.bodyPartRightWrist", getPlayerCurrentSubAccount(client).bodyProps.rightWrist, true); - // setEntityData(client.player, "vrr.bodyPartHip", getPlayerCurrentSubAccount(client).bodyProps.hip, true); - // setEntityData(client.player, "vrr.bodyPartLeftFoot", getPlayerCurrentSubAccount(client).bodyProps.leftFoot, true); - // setEntityData(client.player, "vrr.bodyPartRightFoot", getPlayerCurrentSubAccount(client).bodyProps.rightFoot, true); - //} + //if(isGTAIV()) { + // setEntityData(client.player, "vrr.bodyPartHair", getPlayerCurrentSubAccount(client).bodyParts.hair, true); + // setEntityData(client.player, "vrr.bodyPartHead", getPlayerCurrentSubAccount(client).bodyParts.head, true); + // setEntityData(client.player, "vrr.bodyPartUpper", getPlayerCurrentSubAccount(client).bodyParts.upper, true); + // setEntityData(client.player, "vrr.bodyPartLower", getPlayerCurrentSubAccount(client).bodyParts.lower, true); + // setEntityData(client.player, "vrr.bodyPropHair", getPlayerCurrentSubAccount(client).bodyProps.hair, true); + // setEntityData(client.player, "vrr.bodyPropEyes", getPlayerCurrentSubAccount(client).bodyProps.eyes, true); + // setEntityData(client.player, "vrr.bodyPartHead", getPlayerCurrentSubAccount(client).bodyProps.head, true); + // setEntityData(client.player, "vrr.bodyPartLeftHand", getPlayerCurrentSubAccount(client).bodyProps.leftHand, true); + // setEntityData(client.player, "vrr.bodyPartRightHand", getPlayerCurrentSubAccount(client).bodyProps.rightHand, true); + // setEntityData(client.player, "vrr.bodyPartLeftWrist", getPlayerCurrentSubAccount(client).bodyProps.leftWrist, true); + // setEntityData(client.player, "vrr.bodyPartRightWrist", getPlayerCurrentSubAccount(client).bodyProps.rightWrist, true); + // setEntityData(client.player, "vrr.bodyPartHip", getPlayerCurrentSubAccount(client).bodyProps.hip, true); + // setEntityData(client.player, "vrr.bodyPartLeftFoot", getPlayerCurrentSubAccount(client).bodyProps.leftFoot, true); + // setEntityData(client.player, "vrr.bodyPartRightFoot", getPlayerCurrentSubAccount(client).bodyProps.rightFoot, true); + //} - if(isGTAIV()) { - //sendPlayerPedPartsAndProps(client); - } + if(isGTAIV()) { + //sendPlayerPedPartsAndProps(client); + } - logToConsole(LOG_DEBUG, `[VRR.Event] Setting ${getPlayerDisplayForConsole(client)}'s ped state to ready`); - getPlayerData(client).pedState = VRR_PEDSTATE_READY; + logToConsole(LOG_DEBUG, `[VRR.Event] Setting ${getPlayerDisplayForConsole(client)}'s ped state to ready`); + getPlayerData(client).pedState = VRR_PEDSTATE_READY; - if(areServerElementsSupported()) { - syncPlayerProperties(client); - //setTimeout(function() { - // syncPlayerProperties(client); - //}, 1000); - } + if(areServerElementsSupported()) { + syncPlayerProperties(client); + //setTimeout(function() { + // syncPlayerProperties(client); + //}, 1000); + } - logToConsole(LOG_DEBUG, `[VRR.Event] Syncing ${getPlayerDisplayForConsole(client)}'s cash ${getPlayerCurrentSubAccount(client).cash}`); - updatePlayerCash(client); + logToConsole(LOG_DEBUG, `[VRR.Event] Syncing ${getPlayerDisplayForConsole(client)}'s cash ${getPlayerCurrentSubAccount(client).cash}`); + updatePlayerCash(client); - logToConsole(LOG_DEBUG, `[VRR.Event] Updating all player name tags`); - updateAllPlayerNameTags(); + logToConsole(LOG_DEBUG, `[VRR.Event] Updating all player name tags`); + updateAllPlayerNameTags(); - if(!areServerElementsSupported()) { - sendAllBusinessesToPlayer(client); - sendAllHousesToPlayer(client); - sendAllJobsToPlayer(client); - //sendAllVehiclesToPlayer(client); + if(!areServerElementsSupported()) { + sendAllBusinessesToPlayer(client); + sendAllHousesToPlayer(client); + sendAllJobsToPlayer(client); + //sendAllVehiclesToPlayer(client); - requestPlayerPedNetworkId(client); - } + requestPlayerPedNetworkId(client); + } - getPlayerData(client).payDayTickStart = sdl.ticks; + getPlayerData(client).payDayTickStart = sdl.ticks; } // =========================================================================== diff --git a/scripts/server/gate.js b/scripts/server/gate.js index 1f7ee69e..7080c613 100644 --- a/scripts/server/gate.js +++ b/scripts/server/gate.js @@ -54,7 +54,7 @@ function doesPlayerHaveGateKeys(client, vehicle) { } } - if(gateData.ownerType == VRR_GATEOWNER_BUSINESS) { + if(gateData.ownerType == VRR_GATEOWNER_BUSINESS) { if(doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageBusinesses"))) { return true; } @@ -64,7 +64,7 @@ function doesPlayerHaveGateKeys(client, vehicle) { } } - if(gateData.ownerType == VRR_GATEOWNER_HOUSE) { + if(gateData.ownerType == VRR_GATEOWNER_HOUSE) { if(doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageHouses"))) { return true; } @@ -80,11 +80,11 @@ function doesPlayerHaveGateKeys(client, vehicle) { // =========================================================================== function getGateData(gateId) { - if(typeof getServerData().gates[gateId] != "undefined") { - return getServerData().gates[gateId]; - } + if(typeof getServerData().gates[gateId] != "undefined") { + return getServerData().gates[gateId]; + } - return false; + return false; } // =========================================================================== diff --git a/scripts/server/gui.js b/scripts/server/gui.js index 71e8036b..0d28a6a2 100644 --- a/scripts/server/gui.js +++ b/scripts/server/gui.js @@ -15,121 +15,121 @@ function initGUIScript() { // =========================================================================== function playerPromptAnswerNo(client) { - if(getPlayerData(client).promptType == VRR_PROMPT_NONE) { - return false; - } + if(getPlayerData(client).promptType == VRR_PROMPT_NONE) { + return false; + } - logToConsole(LOG_DEBUG, `[VRR.GUI] ${getPlayerDisplayForConsole(client)} answered NO to their prompt (${getPlayerData(client).promptType})`); + logToConsole(LOG_DEBUG, `[VRR.GUI] ${getPlayerDisplayForConsole(client)} answered NO to their prompt (${getPlayerData(client).promptType})`); - switch(getPlayerData(client).promptType) { - case VRR_PROMPT_CREATEFIRSTCHAR: - logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)} chose not to create a first character. Kicking them from the server ...`); - showPlayerErrorGUI(client, "You don't have a character to play. Goodbye!", "No Characters"); - setTimeout(function() { client.disconnect(); }, 5000); - break; + switch(getPlayerData(client).promptType) { + case VRR_PROMPT_CREATEFIRSTCHAR: + logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)} chose not to create a first character. Kicking them from the server ...`); + showPlayerErrorGUI(client, "You don't have a character to play. Goodbye!", "No Characters"); + setTimeout(function() { client.disconnect(); }, 5000); + break; - case VRR_PROMPT_BIZORDER: - if(getPlayerData(client).businessOrderAmount > 0) { - if(canPlayerUseGUI(client)) { - showPlayerErrorGUI(client, "You canceled the order.", "Business Order Canceled"); - } else { - logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)} canceled the order of ${getPlayerData(client).businessOrderAmount} ${getPlayerData(client).businessOrderItem} at ${getPlayerData(client).businessOrderCost/getPlayerData(client).businessOrderAmount} each for business ${getBusinessData(getPlayerData(client).businessOrderBusiness)}`); - messagePlayerError(client, "You canceled the order!"); - } - } else { - showPlayerErrorGUI(client, "You aren't ordering anything for a business!", "Business Order Canceled"); - } - break; + case VRR_PROMPT_BIZORDER: + if(getPlayerData(client).businessOrderAmount > 0) { + if(canPlayerUseGUI(client)) { + showPlayerErrorGUI(client, "You canceled the order.", "Business Order Canceled"); + } else { + logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)} canceled the order of ${getPlayerData(client).businessOrderAmount} ${getPlayerData(client).businessOrderItem} at ${getPlayerData(client).businessOrderCost/getPlayerData(client).businessOrderAmount} each for business ${getBusinessData(getPlayerData(client).businessOrderBusiness)}`); + messagePlayerError(client, "You canceled the order!"); + } + } else { + showPlayerErrorGUI(client, "You aren't ordering anything for a business!", "Business Order Canceled"); + } + break; - default: - break; - } + default: + break; + } - getPlayerData(client).promptType = VRR_PROMPT_NONE; + getPlayerData(client).promptType = VRR_PROMPT_NONE; } // =========================================================================== function playerPromptAnswerYes(client) { - if(getPlayerData(client).promptType == VRR_PROMPT_NONE) { - return false; - } + if(getPlayerData(client).promptType == VRR_PROMPT_NONE) { + return false; + } - logToConsole(LOG_DEBUG, `[VRR.GUI] ${getPlayerDisplayForConsole(client)} answered YES to their prompt (${getPlayerData(client).promptType})`); + logToConsole(LOG_DEBUG, `[VRR.GUI] ${getPlayerDisplayForConsole(client)} answered YES to their prompt (${getPlayerData(client).promptType})`); - switch(getPlayerData(client).promptType) { - case VRR_PROMPT_CREATEFIRSTCHAR: - showPlayerNewCharacterGUI(client); - break; + switch(getPlayerData(client).promptType) { + case VRR_PROMPT_CREATEFIRSTCHAR: + showPlayerNewCharacterGUI(client); + break; - case VRR_PROMPT_BIZORDER: - if(getPlayerData(client).businessOrderAmount > 0) { - if(getBusinessData(getPlayerData(client).businessOrderBusiness).till < getPlayerData(client).businessOrderCost) { - logToConsole(LOG_DEBUG, `[VRR.GUI] ${getPlayerDisplayForConsole(client)} failed to order ${getPlayerData(client).businessOrderAmount} ${getItemTypeData(getPlayerData(client).businessOrderItem).name} at ${getPlayerData(client).businessOrderCost/getPlayerData(client).businessOrderAmount} each for business ${getBusinessData(getPlayerData(client).businessOrderBusiness).name} (Reason: Not enough money in business till)`); - showPlayerErrorGUI(client, "This business doesn't have enough money! Deposit some using /bizdeposit", "Business Order Canceled"); - getPlayerData(client).businessOrderAmount = 0; - getPlayerData(client).businessOrderBusiness = false; - getPlayerData(client).businessOrderItem = -1; - getPlayerData(client).businessOrderValue = -1; - } else { - logToConsole(LOG_DEBUG, `[VRR.GUI] ${getPlayerDisplayForConsole(client)} successfully ordered ${getPlayerData(client).businessOrderAmount} ${getItemTypeData(getPlayerData(client).businessOrderItem).name} at ${getPlayerData(client).businessOrderCost/getPlayerData(client).businessOrderAmount} each for business ${getBusinessData(getPlayerData(client).businessOrderBusiness).name}`); - showPlayerInfoGUI(client, `You ordered ${getPlayerData(client).businessOrderAmount} ${getItemTypeData(getPlayerData(client).businessOrderItem).name} (${getItemValueDisplay(getPlayerData(client).businessOrderItem, getPlayerData(client).businessOrderValue)}) for ${getPlayerData(client).businessOrderCost}!`, "Business Order Successful"); - createItem(getPlayerData(client).businessOrderItem, getPlayerData(client).businessOrderValue, VRR_ITEM_OWNER_BIZFLOOR, getBusinessData(getPlayerData(client).businessOrderBusiness).databaseId, getPlayerData(client).businessOrderAmount); - cacheBusinessItems(getPlayerData(client).businessOrderBusiness); - getBusinessData(getPlayerData(client).businessOrderBusiness).till -= getPlayerData(client).businessOrderCost; - updateBusinessPickupLabelData(getPlayerData(client).businessOrderBusiness); - getPlayerData(client).businessOrderAmount = 0; - getPlayerData(client).businessOrderBusiness = false; - getPlayerData(client).businessOrderItem = -1; - getPlayerData(client).businessOrderValue = -1; + case VRR_PROMPT_BIZORDER: + if(getPlayerData(client).businessOrderAmount > 0) { + if(getBusinessData(getPlayerData(client).businessOrderBusiness).till < getPlayerData(client).businessOrderCost) { + logToConsole(LOG_DEBUG, `[VRR.GUI] ${getPlayerDisplayForConsole(client)} failed to order ${getPlayerData(client).businessOrderAmount} ${getItemTypeData(getPlayerData(client).businessOrderItem).name} at ${getPlayerData(client).businessOrderCost/getPlayerData(client).businessOrderAmount} each for business ${getBusinessData(getPlayerData(client).businessOrderBusiness).name} (Reason: Not enough money in business till)`); + showPlayerErrorGUI(client, "This business doesn't have enough money! Deposit some using /bizdeposit", "Business Order Canceled"); + getPlayerData(client).businessOrderAmount = 0; + getPlayerData(client).businessOrderBusiness = false; + getPlayerData(client).businessOrderItem = -1; + getPlayerData(client).businessOrderValue = -1; + } else { + logToConsole(LOG_DEBUG, `[VRR.GUI] ${getPlayerDisplayForConsole(client)} successfully ordered ${getPlayerData(client).businessOrderAmount} ${getItemTypeData(getPlayerData(client).businessOrderItem).name} at ${getPlayerData(client).businessOrderCost/getPlayerData(client).businessOrderAmount} each for business ${getBusinessData(getPlayerData(client).businessOrderBusiness).name}`); + showPlayerInfoGUI(client, `You ordered ${getPlayerData(client).businessOrderAmount} ${getItemTypeData(getPlayerData(client).businessOrderItem).name} (${getItemValueDisplay(getPlayerData(client).businessOrderItem, getPlayerData(client).businessOrderValue)}) for ${getPlayerData(client).businessOrderCost}!`, "Business Order Successful"); + createItem(getPlayerData(client).businessOrderItem, getPlayerData(client).businessOrderValue, VRR_ITEM_OWNER_BIZFLOOR, getBusinessData(getPlayerData(client).businessOrderBusiness).databaseId, getPlayerData(client).businessOrderAmount); + cacheBusinessItems(getPlayerData(client).businessOrderBusiness); + getBusinessData(getPlayerData(client).businessOrderBusiness).till -= getPlayerData(client).businessOrderCost; + updateBusinessPickupLabelData(getPlayerData(client).businessOrderBusiness); + getPlayerData(client).businessOrderAmount = 0; + getPlayerData(client).businessOrderBusiness = false; + getPlayerData(client).businessOrderItem = -1; + getPlayerData(client).businessOrderValue = -1; - } - } else { - showPlayerErrorGUI(client, `You aren't ordering anything for a business!`, `Business Order Canceled`); - } - break; + } + } else { + showPlayerErrorGUI(client, `You aren't ordering anything for a business!`, `Business Order Canceled`); + } + break; - default: - break; - } + default: + break; + } - getPlayerData(client).promptType = VRR_PROMPT_NONE; + getPlayerData(client).promptType = VRR_PROMPT_NONE; } // =========================================================================== function canPlayerUseGUI(client) { - return (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)); + return (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)); } // =========================================================================== function playerPromptAnswerYesCommand(command, params, client) { - playerPromptAnswerYes(client); + playerPromptAnswerYes(client); } // =========================================================================== function playerPromptAnswerNoCommand(command, params, client) { - playerPromptAnswerNo(client); + playerPromptAnswerNo(client); } // =========================================================================== function playerToggledGUI(client) { - toggleAccountGUICommand("gui", "", client); + toggleAccountGUICommand("gui", "", client); } // =========================================================================== function showPlayerChangePasswordGUI(client) { - sendNetworkEventToPlayer("vrr.changePassword", client); + sendNetworkEventToPlayer("vrr.changePassword", client); } // =========================================================================== function showPlayerTwoFactorAuthenticationGUI(client) { - sendNetworkEventToPlayer("vrr.2fa", client); + sendNetworkEventToPlayer("vrr.2fa", client); } // =========================================================================== \ No newline at end of file diff --git a/scripts/server/help.js b/scripts/server/help.js index 3fabb8d1..089f1507 100644 --- a/scripts/server/help.js +++ b/scripts/server/help.js @@ -15,144 +15,144 @@ function initHelpScript() { // =========================================================================== let randomTips = [ - `{MAINCOLOUR}Look for yellow dots on your map for job locations.`, - `{MAINCOLOUR}You can set custom key binds. Use {ALTCOLOUR}/help keys {MAINCOLOUR} for details.`, - `{MAINCOLOUR}Use /notips if you don't want to see tips and extra information`, - `{MAINCOLOUR}You can edit your keybinds using {ALTCOLOUR}/bindkey and /unbindkey`, - `{MAINCOLOUR}Press ℹ️ to see your inventory, and use number keys to select an item`, - `{MAINCOLOUR}Use /buy at a business to purchase items.`, - `{MAINCOLOUR}Found a bug? Report it with {ALTCOLOUR}/bug`, - `{MAINCOLOUR}Have an idea or suggestion for the server? Let the devs know using {ALTCOLOUR}/idea`, - `{MAINCOLOUR}Want to buy a business? Use /bizbuy at one for sale`, - `{MAINCOLOUR}Want to buy a house? Use /housebuy at one for sale`, - `{MAINCOLOUR}Want to buy a vehicle? Visit a dealership and enter one for info on how to buy it!`, - `{MAINCOLOUR}Switch to any of your characters with {ALTCOLOUR}/switchchar`, - `{MAINCOLOUR}Use {ALTCOLOUR}/iplogin {MAINCOLOUR}to automatically login when connecting with the same IP`, - `{MAINCOLOUR}Use {ALTCOLOUR}/houselights or /bizlights {MAINCOLOUR}to turn on/off the lights in your house or business`, - `{MAINCOLOUR}Use {ALTCOLOUR}/radiostation {MAINCOLOUR}to play an internet radio station in your car, house, or business`, - //`{MAINCOLOUR}Lower your car windows with /windows {ALTCOLOUR} to play the vehicle's internet radio station {ALTCOLOUR}(/radiostation) {MAINCOLOUR}to nearby players`, - //`{MAINCOLOUR}Lower your car windows with /windows {ALTCOLOUR} to play the vehicle's internet radio station {ALTCOLOUR}(/radiostation) {MAINCOLOUR}to nearby players`, - //`{MAINCOLOUR}Tax is based on your total wealth. This includes money, vehicles, businesses and more.`, - //`{MAINCOLOUR}Don't go broke because of a hospital bill! Get insured today by visiting an insurance agency!`, - //`{MAINCOLOUR}Don't go broke because your car was destroyed. Visit an insurance agency today!`, - //`{MAINCOLOUR}You can find most locations by using {ALTCOLOUR}/gps`, - //`{MAINCOLOUR}Want to advertise your business? Visit the news station and place an /ad today!`, - //`{MAINCOLOUR}You can change your quick item display. Choices are GTAV-style pie menu or Minecraft-style hotbar`, - //`{MAINCOLOUR}Hold [#0066FF]E {MAINCOLOUR}to hail a nearby taxi if you need a ride.`, - //`{MAINCOLOUR}Press [#0066FF]G {MAINCOLOUR}to enter a vehicle as passenger.`, - //`{MAINCOLOUR}Banks can provide loans. Use {ALTCOLOUR}/help loans {MAINCOLOUR} for more details.`, - `{MAINCOLOUR}Want to make a clan? Use {ALTCOLOUR}/help clans {MAINCOLOUR} for details.`, - `{MAINCOLOUR}Legal weapons can be purchased at any ammunation.`, + `{MAINCOLOUR}Look for yellow dots on your map for job locations.`, + `{MAINCOLOUR}You can set custom key binds. Use {ALTCOLOUR}/help keys {MAINCOLOUR} for details.`, + `{MAINCOLOUR}Use /notips if you don't want to see tips and extra information`, + `{MAINCOLOUR}You can edit your keybinds using {ALTCOLOUR}/bindkey and /unbindkey`, + `{MAINCOLOUR}Press ℹ️ to see your inventory, and use number keys to select an item`, + `{MAINCOLOUR}Use /buy at a business to purchase items.`, + `{MAINCOLOUR}Found a bug? Report it with {ALTCOLOUR}/bug`, + `{MAINCOLOUR}Have an idea or suggestion for the server? Let the devs know using {ALTCOLOUR}/idea`, + `{MAINCOLOUR}Want to buy a business? Use /bizbuy at one for sale`, + `{MAINCOLOUR}Want to buy a house? Use /housebuy at one for sale`, + `{MAINCOLOUR}Want to buy a vehicle? Visit a dealership and enter one for info on how to buy it!`, + `{MAINCOLOUR}Switch to any of your characters with {ALTCOLOUR}/switchchar`, + `{MAINCOLOUR}Use {ALTCOLOUR}/iplogin {MAINCOLOUR}to automatically login when connecting with the same IP`, + `{MAINCOLOUR}Use {ALTCOLOUR}/houselights or /bizlights {MAINCOLOUR}to turn on/off the lights in your house or business`, + `{MAINCOLOUR}Use {ALTCOLOUR}/radiostation {MAINCOLOUR}to play an internet radio station in your car, house, or business`, + //`{MAINCOLOUR}Lower your car windows with /windows {ALTCOLOUR} to play the vehicle's internet radio station {ALTCOLOUR}(/radiostation) {MAINCOLOUR}to nearby players`, + //`{MAINCOLOUR}Lower your car windows with /windows {ALTCOLOUR} to play the vehicle's internet radio station {ALTCOLOUR}(/radiostation) {MAINCOLOUR}to nearby players`, + //`{MAINCOLOUR}Tax is based on your total wealth. This includes money, vehicles, businesses and more.`, + //`{MAINCOLOUR}Don't go broke because of a hospital bill! Get insured today by visiting an insurance agency!`, + //`{MAINCOLOUR}Don't go broke because your car was destroyed. Visit an insurance agency today!`, + //`{MAINCOLOUR}You can find most locations by using {ALTCOLOUR}/gps`, + //`{MAINCOLOUR}Want to advertise your business? Visit the news station and place an /ad today!`, + //`{MAINCOLOUR}You can change your quick item display. Choices are GTAV-style pie menu or Minecraft-style hotbar`, + //`{MAINCOLOUR}Hold [#0066FF]E {MAINCOLOUR}to hail a nearby taxi if you need a ride.`, + //`{MAINCOLOUR}Press [#0066FF]G {MAINCOLOUR}to enter a vehicle as passenger.`, + //`{MAINCOLOUR}Banks can provide loans. Use {ALTCOLOUR}/help loans {MAINCOLOUR} for more details.`, + `{MAINCOLOUR}Want to make a clan? Use {ALTCOLOUR}/help clans {MAINCOLOUR} for details.`, + `{MAINCOLOUR}Legal weapons can be purchased at any ammunation.`, ]; // =========================================================================== function helpCommand(command, params, client) { if(areParamsEmpty(params)) { - showMainHelpMessage(client); - return false; - } + showMainHelpMessage(client); + return false; + } - let splitParams = params.split(" "); + let splitParams = params.split(" "); - switch(toLowerCase(getParam(params, " ", 1))) { - case "account": - showAccountHelpMessage(client); - break; + switch(toLowerCase(getParam(params, " ", 1))) { + case "account": + showAccountHelpMessage(client); + break; - case "vehicle": - case "veh": - case "vehs": - case "vehicles": - case "car": - case "cars": - showVehicleHelpMessage(client); - break; + case "vehicle": + case "veh": + case "vehs": + case "vehicles": + case "car": + case "cars": + showVehicleHelpMessage(client); + break; - case "dealership": - showVehicleDealershipHelpMessage(client); - break; + case "dealership": + showVehicleDealershipHelpMessage(client); + break; - case "business": - showBusinessHelpMessage(client); - break; + case "business": + showBusinessHelpMessage(client); + break; - case "job": - showJobHelpMessage(client); - break; + case "job": + showJobHelpMessage(client); + break; - case "chat": - showChatHelpMessage(client); - break; + case "chat": + showChatHelpMessage(client); + break; - case "rules": - showRulesHelpMessage(client); - break; + case "rules": + showRulesHelpMessage(client); + break; - case "website": - showWebsiteHelpMessage(client); - break; + case "website": + showWebsiteHelpMessage(client); + break; - case "discord": - showDiscordHelpMessage(client); - break; + case "discord": + showDiscordHelpMessage(client); + break; - case "anim": - case "anims": - case "animation": - case "animations": - showAnimationHelpMessage(client); - break; + case "anim": + case "anims": + case "animation": + case "animations": + showAnimationHelpMessage(client); + break; - case "skin": - case "skins": - case "clothes": - showClothesHelpMessage(client); - break; + case "skin": + case "skins": + case "clothes": + showClothesHelpMessage(client); + break; - case "key": - case "keys": - case "keybinds": - case "keybind": - case "bindkey": - case "bindkeys": - showBindKeysHelpMessage(client); - break; + case "key": + case "keys": + case "keybinds": + case "keybind": + case "bindkey": + case "bindkeys": + showBindKeysHelpMessage(client); + break; - case "command": - case "cmd": - showCommandHelpMessage(client, getParam(params, " ", 2)); - break; + case "command": + case "cmd": + showCommandHelpMessage(client, getParam(params, " ", 2)); + break; - case "clan": - case "clans": - case "group": - case "groups": - case "faction": - case "factions": - case "family": - case "families": - showClanHelpMessage(client); - break; + case "clan": + case "clans": + case "group": + case "groups": + case "faction": + case "factions": + case "family": + case "families": + showClanHelpMessage(client); + break; - case "radio": - case "radiostations": - case "music": - showRadioHelpMessage(client); - break; + case "radio": + case "radiostations": + case "music": + showRadioHelpMessage(client); + break; - case "economy": - case "wealth": - case "tax": - case "taxes": - case "payday": - showWealthAndTaxHelpMessage(client); - break; + case "economy": + case "wealth": + case "tax": + case "taxes": + case "payday": + showWealthAndTaxHelpMessage(client); + break; - default: - showMainHelpMessage(client); - break; - } + default: + showMainHelpMessage(client); + break; + } } // == Account Help ============================= @@ -184,152 +184,152 @@ function helpCommand(command, params, client) { // =========================================================================== function showMainHelpMessage(client) { - messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderHelpMainList"))); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Use /help <category> for commands and info. Example: {ALTCOLOUR}/help vehicle`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Help Categories: [#A9A9A9]account, command, vehicle, job, chat, rules, website, animation`); - messagePlayerNormal(client, `{clanOrange}• [#A9A9A9]skin, mechanic, dealership, discord, colour, keybind`); + messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderHelpMainList"))); + messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Use /help <category> for commands and info. Example: {ALTCOLOUR}/help vehicle`); + messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Help Categories: [#A9A9A9]account, command, vehicle, job, chat, rules, website, animation`); + messagePlayerNormal(client, `{clanOrange}• [#A9A9A9]skin, mechanic, dealership, discord, colour, keybind`); } // =========================================================================== function showAccountHelpMessage(client) { - messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderAccountHelp"))); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Do not share your password with anybody else.`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Use {ALTCOLOUR}/changepass{MAINCOLOUR} to change your password.`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Some settings you can use: {ALTCOLOUR}/gui, /logo, /iplogin, /autolastchar, /2fa, /loginalert`); + messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderAccountHelp"))); + messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Do not share your password with anybody else.`); + messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Use {ALTCOLOUR}/changepass{MAINCOLOUR} to change your password.`); + messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Some settings you can use: {ALTCOLOUR}/gui, /logo, /iplogin, /autolastchar, /2fa, /loginalert`); } // =========================================================================== function showVehicleHelpMessage(client) { - messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderVehicleHelp"))); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Visit dealerships to buy new vehicles (Use {ALTCOLOUR}/help dealership {MAINCOLOUR}for more info.)`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Some commands: {ALTCOLOUR}/lock, /engine, /lights, /trunk, /rentveh, /buyveh, /rentprice, /buyprice`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Your personal vehicles will save wherever you or somebody else leaves them!`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Visit a mechanic garage to repair, colour, and tune up your car! {ALTCOLOUR}/help mechanic {MAINCOLOUR} for info`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Don't forget to register and insure your vehicle! Use {ALTCOLOUR}/gps {MAINCOLOUR}to find a DMV for this.`); + messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderVehicleHelp"))); + messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Visit dealerships to buy new vehicles (Use {ALTCOLOUR}/help dealership {MAINCOLOUR}for more info.)`); + messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Some commands: {ALTCOLOUR}/lock, /engine, /lights, /trunk, /rentveh, /buyveh, /rentprice, /buyprice`); + messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Your personal vehicles will save wherever you or somebody else leaves them!`); + messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Visit a mechanic garage to repair, colour, and tune up your car! {ALTCOLOUR}/help mechanic {MAINCOLOUR} for info`); + messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Don't forget to register and insure your vehicle! Use {ALTCOLOUR}/gps {MAINCOLOUR}to find a DMV for this.`); } // =========================================================================== function showVehicleDealershipHelpMessage(client) { - messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderVehicleDealershipHelp"))); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Visit a vehicle dealer to buy new vehicles. Use {ALTCOLOUR}/gps {MAINCOLOUR}to find one.`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}At the dealer, simply enter a car you want to buy, and the price will be shown to you`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}If you want to buy the vehicle and have enough money, use {ALTCOLOUR}/buyveh {MAINCOLOUR}and you will be given keys`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}A new car for sale will appear when you drive away from the dealer.`); + messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderVehicleDealershipHelp"))); + messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Visit a vehicle dealer to buy new vehicles. Use {ALTCOLOUR}/gps {MAINCOLOUR}to find one.`); + messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}At the dealer, simply enter a car you want to buy, and the price will be shown to you`); + messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}If you want to buy the vehicle and have enough money, use {ALTCOLOUR}/buyveh {MAINCOLOUR}and you will be given keys`); + messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}A new car for sale will appear when you drive away from the dealer.`); } // =========================================================================== function showJobHelpMessage(client) { - messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderJobHelp"))); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Visit job locations get a job and earn money. Look for yellow spots on the map`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}At a job location, use {ALTCOLOUR}/takejob {MAINCOLOUR}to get the job. Use {ALTCOLOUR}/quitjob {MAINCOLOUR}to quit your job`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Use {ALTCOLOUR}/startwork {MAINCOLOUR}to begin working. You can also get a job {ALTCOLOUR}/uniform and {ALTCOLOUR}/equipment`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Most job vehicles are locked. Use {ALTCOLOUR}/lock {MAINCOLOUR}near one to enter it.`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}When entering a job vehicle, information on how to do the job will be shown to you.`); + messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderJobHelp"))); + messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Visit job locations get a job and earn money. Look for yellow spots on the map`); + messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}At a job location, use {ALTCOLOUR}/takejob {MAINCOLOUR}to get the job. Use {ALTCOLOUR}/quitjob {MAINCOLOUR}to quit your job`); + messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Use {ALTCOLOUR}/startwork {MAINCOLOUR}to begin working. You can also get a job {ALTCOLOUR}/uniform and {ALTCOLOUR}/equipment`); + messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Most job vehicles are locked. Use {ALTCOLOUR}/lock {MAINCOLOUR}near one to enter it.`); + messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}When entering a job vehicle, information on how to do the job will be shown to you.`); } // =========================================================================== function showChatHelpMessage(client) { - messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderChatHelp"))); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}There are two main types of chat: out-of-character (OOC) and in-character (IC)`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Mixing these two types is not proper roleplay. See {ALTCOLOUR}/rules {MAINCOLOUR}for info.`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Some chat commands: {ALTCOLOUR}/dm /whisper /talk /shout /me.`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Some have shorter names available ({ALTCOLOUR}/t {MAINCOLOUR}for talk, {ALTCOLOUR}/s {MAINCOLOUR}for shout, etc)`); + messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderChatHelp"))); + messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}There are two main types of chat: out-of-character (OOC) and in-character (IC)`); + messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Mixing these two types is not proper roleplay. See {ALTCOLOUR}/rules {MAINCOLOUR}for info.`); + messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Some chat commands: {ALTCOLOUR}/dm /whisper /talk /shout /me.`); + messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Some have shorter names available ({ALTCOLOUR}/t {MAINCOLOUR}for talk, {ALTCOLOUR}/s {MAINCOLOUR}for shout, etc)`); } // =========================================================================== function showRulesHelpMessage(client) { - messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderServerRulesList"))); - messagePlayerHelpContent(client, getGroupedLocaleString(client, "RulesHelp", 0)); - messagePlayerHelpContent(client, getGroupedLocaleString(client, "RulesHelp", 1)); - messagePlayerHelpContent(client, getGroupedLocaleString(client, "RulesHelp", 2)); - messagePlayerHelpContent(client, getGroupedLocaleString(client, "RulesHelp", 3)); - messagePlayerHelpContent(client, getGroupedLocaleString(client, "RulesHelp", 4), `{ALTCOLOUR}/help language {MAINCOLOUR}`); + messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderServerRulesList"))); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "RulesHelp", 0)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "RulesHelp", 1)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "RulesHelp", 2)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "RulesHelp", 3)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "RulesHelp", 4), `{ALTCOLOUR}/help language {MAINCOLOUR}`); } // =========================================================================== function showWebsiteHelpMessage(client) { - messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderWebsiteInfo"))); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}${server.getRule("Website")}`); + messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderWebsiteInfo"))); + messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}${server.getRule("Website")}`); } // =========================================================================== function showDiscordHelpMessage(client) { - messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderDiscordInfo"))); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}${server.getRule("Website")}`); + messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderDiscordInfo"))); + messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}${server.getRule("Website")}`); } // =========================================================================== function showAnimationHelpMessage(client) { - messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderAnimationHelp"))); - messagePlayerHelpContent(client, getGroupedLocaleString(client, "AnimationHelp", 0, `{ALTCOLOUR}/buy {MAINCOLOUR}`)); - messagePlayerHelpContent(client, getGroupedLocaleString(client, "AnimationHelp", 1, `{ALTCOLOUR}/an {MAINCOLOUR}`, `{ALTCOLOUR}/anim {MAINCOLOUR}`)); - messagePlayerHelpContent(client, getGroupedLocaleString(client, "AnimationHelp", 2, `{ALTCOLOUR}/animlist {MAINCOLOUR}`)); + messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderAnimationHelp"))); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "AnimationHelp", 0, `{ALTCOLOUR}/buy {MAINCOLOUR}`)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "AnimationHelp", 1, `{ALTCOLOUR}/an {MAINCOLOUR}`, `{ALTCOLOUR}/anim {MAINCOLOUR}`)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "AnimationHelp", 2, `{ALTCOLOUR}/animlist {MAINCOLOUR}`)); } // =========================================================================== function showClothesHelpMessage(client) { - messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderSkinHelp"))); - messagePlayerHelpContent(client, getGroupedLocaleString(client, "SkinHelp", 0, `{ALTCOLOUR}/buy {MAINCOLOUR}`)); - messagePlayerHelpContent(client, getGroupedLocaleString(client, "SkinHelp", 1, `{ALTCOLOUR}/help items {MAINCOLOUR}`)); - messagePlayerHelpContent(client, getGroupedLocaleString(client, "SkinHelp", 2)); + messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderSkinHelp"))); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "SkinHelp", 0, `{ALTCOLOUR}/buy {MAINCOLOUR}`)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "SkinHelp", 1, `{ALTCOLOUR}/help items {MAINCOLOUR}`)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "SkinHelp", 2)); } // =========================================================================== function showBindKeysHelpMessage(client) { - messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderBindableKeysHelp"))); - messagePlayerHelpContent(client, getGroupedLocaleString(client, "KeyBindHelp", 0, `{ALTCOLOUR}/keybinds {MAINCOLOUR}`)); - messagePlayerHelpContent(client, getGroupedLocaleString(client, "KeyBindHelp", 1, `{ALTCOLOUR}/bindkey {MAINCOLOUR}`, `{ALTCOLOUR}/unbindkey {MAINCOLOUR}`)); - messagePlayerHelpContent(client, getGroupedLocaleString(client, "KeyBindHelp", 2, `{ALTCOLOUR}K {MAINCOLOUR}`, `{ALTCOLOUR}L {MAINCOLOUR}`, `{ALTCOLOUR}J {MAINCOLOUR}`)); - messagePlayerHelpContent(client, getGroupedLocaleString(client, "KeyBindHelp", 3, `{ALTCOLOUR}I {MAINCOLOUR}`, `{ALTCOLOUR}1-9 {MAINCOLOUR}`, `{ALTCOLOUR}0 {MAINCOLOUR}`)); - messagePlayerHelpContent(client, getGroupedLocaleString(client, "KeyBindHelp", 4, `{ALTCOLOUR}U {MAINCOLOUR}`, `{ALTCOLOUR}O {MAINCOLOUR}`, `{ALTCOLOUR}P {MAINCOLOUR}`)); + messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderBindableKeysHelp"))); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "KeyBindHelp", 0, `{ALTCOLOUR}/keybinds {MAINCOLOUR}`)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "KeyBindHelp", 1, `{ALTCOLOUR}/bindkey {MAINCOLOUR}`, `{ALTCOLOUR}/unbindkey {MAINCOLOUR}`)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "KeyBindHelp", 2, `{ALTCOLOUR}K {MAINCOLOUR}`, `{ALTCOLOUR}L {MAINCOLOUR}`, `{ALTCOLOUR}J {MAINCOLOUR}`)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "KeyBindHelp", 3, `{ALTCOLOUR}I {MAINCOLOUR}`, `{ALTCOLOUR}1-9 {MAINCOLOUR}`, `{ALTCOLOUR}0 {MAINCOLOUR}`)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "KeyBindHelp", 4, `{ALTCOLOUR}U {MAINCOLOUR}`, `{ALTCOLOUR}O {MAINCOLOUR}`, `{ALTCOLOUR}P {MAINCOLOUR}`)); } // =========================================================================== function showBusinessHelpMessage(client) { - messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderBusinessHelp"))); - messagePlayerHelpContent(client, getGroupedLocaleString(client, "BusinessHelp", 0)); - messagePlayerHelpContent(client, getGroupedLocaleString(client, "BusinessHelp", 1)); - messagePlayerHelpContent(client, getGroupedLocaleString(client, "BusinessHelp", 2, `{ALTCOLOUR}/bizorder, /bizlock, /bizlights, /radiostation, /bizitemprice, /bizbuyprice, /bizfee, /biztill, /bizwithdraw, /bizdeposit`)); - messagePlayerHelpContent(client, getGroupedLocaleString(client, "BusinessHelp", 3)); + messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderBusinessHelp"))); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "BusinessHelp", 0)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "BusinessHelp", 1)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "BusinessHelp", 2, `{ALTCOLOUR}/bizorder, /bizlock, /bizlights, /radiostation, /bizitemprice, /bizbuyprice, /bizfee, /biztill, /bizwithdraw, /bizdeposit`)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "BusinessHelp", 3)); } // =========================================================================== function showClanHelpMessage(client) { - messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderClanHelp"))); - messagePlayerHelpContent(client, getGroupedLocaleString(client, "ClanHelp", 0)); - messagePlayerHelpContent(client, getGroupedLocaleString(client, "ClanHelp", 1)); - messagePlayerHelpContent(client, getGroupedLocaleString(client, "ClanHelp", 2, `{ALTCOLOUR}/clan, /clanmotd, /clanname, /clanowner, /clanhouse, /clanbiz, /claninvite, /clanuninvite, /clansetrank`)); - messagePlayerHelpContent(client, getGroupedLocaleString(client, "ClanHelp", 3, `{ALTCOLOUR}/clanranks, /clanflags, /clanaddrank, /clandelrank, /clanaddrankflag, /clandelrankflag, /clanaddmemberflag, /clandelmemberflag`)); + messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderClanHelp"))); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "ClanHelp", 0)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "ClanHelp", 1)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "ClanHelp", 2, `{ALTCOLOUR}/clan, /clanmotd, /clanname, /clanowner, /clanhouse, /clanbiz, /claninvite, /clanuninvite, /clansetrank`)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "ClanHelp", 3, `{ALTCOLOUR}/clanranks, /clanflags, /clanaddrank, /clandelrank, /clanaddrankflag, /clandelrankflag, /clanaddmemberflag, /clandelmemberflag`)); } // =========================================================================== function showRadioHelpMessage(client) { - messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderRadioHelp"))); - messagePlayerHelpContent(client, getGroupedLocaleString(client, "RadioHelp", 0, `{ALTCOLOUR}/radiostation {MAINCOLOUR}`)); - messagePlayerHelpContent(client, getGroupedLocaleString(client, "RadioHelp", 1, `{ALTCOLOUR}/radiostations {MAINCOLOUR}`)); - messagePlayerHelpContent(client, getGroupedLocaleString(client, "RadioHelp", 2, `{ALTCOLOUR}/radiovolume {MAINCOLOUR}`)); + messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderRadioHelp"))); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "RadioHelp", 0, `{ALTCOLOUR}/radiostation {MAINCOLOUR}`)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "RadioHelp", 1, `{ALTCOLOUR}/radiostations {MAINCOLOUR}`)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "RadioHelp", 2, `{ALTCOLOUR}/radiovolume {MAINCOLOUR}`)); } // =========================================================================== function showWealthAndTaxHelpMessage(client) { - messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderWealthandTaxHelp"))); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Your taxes on payday are ${100*getGlobalConfig().economy.incomeTaxRate}% of your calculated wealth.`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Your calculated wealth is a total sum based on how many vehicles, houses, and businesses you have.`); + messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderWealthandTaxHelp"))); + messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Your taxes on payday are ${100*getGlobalConfig().economy.incomeTaxRate}% of your calculated wealth.`); + messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Your calculated wealth is a total sum based on how many vehicles, houses, and businesses you have.`); messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Each vehicle is {ALTCOLOUR}${getGlobalConfig().economy.upKeepCosts.upKeepPerVehicle}, {MAINCOLOUR}each house is {ALTCOLOUR}${getGlobalConfig().economy.upKeepCosts.upKeepPerHouse}, {MAINCOLOUR}and each business is {ALTCOLOUR}${getGlobalConfig().economy.upKeepCosts.upKeepPerBusiness}`); messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Use {ALTCOLOUR}/wealth {MAINCOLOUR}to see your current wealth, and {ALTCOLOUR}/tax {MAINCOLOUR}to see how much you'll pay in tax each payday`); } @@ -337,35 +337,35 @@ function showWealthAndTaxHelpMessage(client) { // =========================================================================== function showCommandHelpMessage(client, commandName) { - if(!commandName) { - messagePlayerSyntax(client, `${getCommandSyntaxText("help")}command <command name>`); - return false; - } + if(!commandName) { + messagePlayerSyntax(client, `${getCommandSyntaxText("help")}command <command name>`); + return false; + } - commandName = toLowerCase(commandName); - commandName = commandName.trim(); + commandName = toLowerCase(commandName); + commandName = commandName.trim(); - if(commandName.slice(0, 1) == "/") { - commandName = commandName.slice(1); - } + if(commandName.slice(0, 1) == "/") { + commandName = commandName.slice(1); + } - let command = getCommandData(commandName); - let aliases = getCommandAliasesNames(command); + let command = getCommandData(commandName); + let aliases = getCommandAliasesNames(command); - messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderCommandInfo", commandName))); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Description: ${command.description}`); + messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderCommandInfo", commandName))); + messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Description: ${command.description}`); - if(aliases.length > 0) { - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Aliases: ${aliases.join(", ")}`); - } else { - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Aliases: (None)`); - } + if(aliases.length > 0) { + messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Aliases: ${aliases.join(", ")}`); + } else { + messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Aliases: (None)`); + } - //messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Usable on Discord: ${getYesNoFromBool(command.allowOnDiscord)}`); + //messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Usable on Discord: ${getYesNoFromBool(command.allowOnDiscord)}`); - //if(doesPlayerHaveStaffPermission(client, getStaffFlagValue("BasicModeration"))) { - // messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Usable on Discord: ${getYesNoFromBool(command.allowOnDiscord)}`); - //} + //if(doesPlayerHaveStaffPermission(client, getStaffFlagValue("BasicModeration"))) { + // messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Usable on Discord: ${getYesNoFromBool(command.allowOnDiscord)}`); + //} } // =========================================================================== diff --git a/scripts/server/house.js b/scripts/server/house.js index 6fb30280..58ef5721 100644 --- a/scripts/server/house.js +++ b/scripts/server/house.js @@ -1436,30 +1436,30 @@ function updateHousePickupLabelData(houseId) { return false; } - let houseData = getHouseData(houseId); + let houseData = getHouseData(houseId); - if(houseData.entrancePickup != null) { - setEntityData(houseData.entrancePickup, "vrr.owner.type", VRR_PICKUP_HOUSE_ENTRANCE, false); - setEntityData(houseData.entrancePickup, "vrr.owner.id", houseId, false); - setEntityData(houseData.entrancePickup, "vrr.label.type", VRR_LABEL_HOUSE, true); - //setEntityData(houseData.entrancePickup, "vrr.label.name", houseData.description, true); - setEntityData(houseData.entrancePickup, "vrr.label.locked", houseData.locked, true); - if(houseData.buyPrice > 0) { - setEntityData(houseData.entrancePickup, "vrr.label.price", houseData.buyPrice, true); - setEntityData(houseData.entrancePickup, "vrr.label.help", VRR_PROPLABEL_INFO_BUYHOUSE, true); - } else { - if(houseData.rentPrice > 0) { - setEntityData(houseData.entrancePickup, "vrr.label.rentprice", houseData.rentPrice, true); - setEntityData(houseData.entrancePickup, "vrr.label.help", VRR_PROPLABEL_INFO_RENTHOUSE, true); - } - } - } + if(houseData.entrancePickup != null) { + setEntityData(houseData.entrancePickup, "vrr.owner.type", VRR_PICKUP_HOUSE_ENTRANCE, false); + setEntityData(houseData.entrancePickup, "vrr.owner.id", houseId, false); + setEntityData(houseData.entrancePickup, "vrr.label.type", VRR_LABEL_HOUSE, true); + //setEntityData(houseData.entrancePickup, "vrr.label.name", houseData.description, true); + setEntityData(houseData.entrancePickup, "vrr.label.locked", houseData.locked, true); + if(houseData.buyPrice > 0) { + setEntityData(houseData.entrancePickup, "vrr.label.price", houseData.buyPrice, true); + setEntityData(houseData.entrancePickup, "vrr.label.help", VRR_PROPLABEL_INFO_BUYHOUSE, true); + } else { + if(houseData.rentPrice > 0) { + setEntityData(houseData.entrancePickup, "vrr.label.rentprice", houseData.rentPrice, true); + setEntityData(houseData.entrancePickup, "vrr.label.help", VRR_PROPLABEL_INFO_RENTHOUSE, true); + } + } + } - if(houseData.exitPickup != null) { - setEntityData(houseData.exitPickup, "vrr.owner.type", VRR_PICKUP_HOUSE_EXIT, false); - setEntityData(houseData.exitPickup, "vrr.owner.id", houseId, false); - setEntityData(houseData.exitPickup, "vrr.label.type", VRR_LABEL_EXIT, true); - } + if(houseData.exitPickup != null) { + setEntityData(houseData.exitPickup, "vrr.owner.type", VRR_PICKUP_HOUSE_EXIT, false); + setEntityData(houseData.exitPickup, "vrr.owner.id", houseId, false); + setEntityData(houseData.exitPickup, "vrr.label.type", VRR_LABEL_EXIT, true); + } } // =========================================================================== \ No newline at end of file diff --git a/scripts/server/item.js b/scripts/server/item.js index 1ca6b59e..fa5b0544 100644 --- a/scripts/server/item.js +++ b/scripts/server/item.js @@ -1063,16 +1063,16 @@ function playerSwitchItem(client, newHotBarSlot) { setPlayerWeaponDamageEnabled(client, true); setPlayerWeaponDamageEvent(client, VRR_WEAPON_DAMAGE_EVENT_NORMAL); } else { - let ammoItemSlot = getPlayerFirstAmmoItemForWeapon(client, getItemTypeData(getItemData(newHotBarItem).itemTypeIndex).useId); - if(ammoItemSlot != false) { - getItemData(newHotBarItem).value = getItemData(getPlayerData(client).hotBarItems[ammoItemSlot]).value; - givePlayerWeapon(client, toInteger(getItemTypeData(getItemData(newHotBarItem).itemTypeIndex).useId), toInteger(getItemData(newHotBarItem).value), true, true); - setPlayerWeaponDamageEnabled(client, true); - setPlayerWeaponDamageEvent(client, VRR_WEAPON_DAMAGE_EVENT_NORMAL); - deleteItem(getPlayerData(client).hotBarItems[ammoItemSlot]); - } else { - messagePlayerError(client, getLocaleString(client, "ItemUnequippableNoAmmo", getItemName(newHotBarItem), newHotBarSlot)); - } + let ammoItemSlot = getPlayerFirstAmmoItemForWeapon(client, getItemTypeData(getItemData(newHotBarItem).itemTypeIndex).useId); + if(ammoItemSlot != false) { + getItemData(newHotBarItem).value = getItemData(getPlayerData(client).hotBarItems[ammoItemSlot]).value; + givePlayerWeapon(client, toInteger(getItemTypeData(getItemData(newHotBarItem).itemTypeIndex).useId), toInteger(getItemData(newHotBarItem).value), true, true); + setPlayerWeaponDamageEnabled(client, true); + setPlayerWeaponDamageEvent(client, VRR_WEAPON_DAMAGE_EVENT_NORMAL); + deleteItem(getPlayerData(client).hotBarItems[ammoItemSlot]); + } else { + messagePlayerError(client, getLocaleString(client, "ItemUnequippableNoAmmo", getItemName(newHotBarItem), newHotBarSlot)); + } } } else if(getItemTypeData(getItemData(newHotBarItem).itemTypeIndex).useType == VRR_ITEM_USETYPE_TAZER) { if(getItemData(newHotBarItem).value > 0) { @@ -1698,7 +1698,7 @@ function playerItemActionDelayComplete(client) { break; } - clearPlayerItemActionState(client); + clearPlayerItemActionState(client); } // =========================================================================== @@ -2084,19 +2084,19 @@ function getItemTypeFromParams(params) { // =========================================================================== function getPlayerFirstAmmoItemForWeapon(client, weaponId) { - for(let i in getPlayerData(client).hotBarItems) { - if(getPlayerData(client).hotBarItems[i] != -1) { - if(getItemData(getPlayerData(client).hotBarItems[i]) != false) { - if(getItemTypeData(getItemData(getPlayerData(client).hotBarItems[i]).itemTypeIndex).useType == VRR_ITEM_USETYPE_AMMO_CLIP) { - if(getItemTypeData(getItemData(getPlayerData(client).hotBarItems[i]).itemTypeIndex).useId == weaponId) { - return i; - } - } - } - } - } + for(let i in getPlayerData(client).hotBarItems) { + if(getPlayerData(client).hotBarItems[i] != -1) { + if(getItemData(getPlayerData(client).hotBarItems[i]) != false) { + if(getItemTypeData(getItemData(getPlayerData(client).hotBarItems[i]).itemTypeIndex).useType == VRR_ITEM_USETYPE_AMMO_CLIP) { + if(getItemTypeData(getItemData(getPlayerData(client).hotBarItems[i]).itemTypeIndex).useId == weaponId) { + return i; + } + } + } + } + } - return false; + return false; } // =========================================================================== \ No newline at end of file diff --git a/scripts/server/job.js b/scripts/server/job.js index 748ef560..02b35637 100644 --- a/scripts/server/job.js +++ b/scripts/server/job.js @@ -631,7 +631,7 @@ function stopWorking(client) { deleteJobItems(client); restorePlayerJobLockerItems(client); respawnJobVehicle(client); - sendPlayerStopJobRoute(client); + sendPlayerStopJobRoute(client); let jobId = getPlayerJob(client); switch(getJobType(jobId)) { @@ -665,9 +665,9 @@ function stopWorking(client) { case VRR_JOB_DRUG: break; - case VRR_JOB_GENERIC: - messagePlayerInfo(client, "Your vehicle has been respawned at your job location"); - break; + case VRR_JOB_GENERIC: + messagePlayerInfo(client, "Your vehicle has been respawned at your job location"); + break; default: break; @@ -753,13 +753,13 @@ function jobUniformCommand(command, params, client) { return false; } - if(uniformId == 0) { - setPlayerSkin(client, getPlayerCurrentSubAccount(client).skin); - meActionToNearbyPlayers(client, `takes off their uniform`); - } else { - setPlayerSkin(client, jobData.uniforms[uniformId-1].skin); - meActionToNearbyPlayers(client, `puts on ${getProperDeterminerForName(jobData.uniforms[uniformId-1].name)} ${jobData.uniforms[uniformId-1].name} uniform`); - } + if(uniformId == 0) { + setPlayerSkin(client, getPlayerCurrentSubAccount(client).skin); + meActionToNearbyPlayers(client, `takes off their uniform`); + } else { + setPlayerSkin(client, jobData.uniforms[uniformId-1].skin); + meActionToNearbyPlayers(client, `puts on ${getProperDeterminerForName(jobData.uniforms[uniformId-1].name)} ${jobData.uniforms[uniformId-1].name} uniform`); + } } // =========================================================================== @@ -966,8 +966,8 @@ function createJob(name) { tempJobData.pickupModel = getGameConfig().pickupModels[getGame()].job; getServerData().jobs.push(tempJobData); - saveJobToDatabase(tempJobData); - setAllJobDataIndexes(); + saveJobToDatabase(tempJobData); + setAllJobDataIndexes(); } // =========================================================================== @@ -1213,17 +1213,17 @@ function setJobRouteAllLocationDelaysCommand(command, params, client) { let jobId = getPlayerJob(client); let jobRoute = getPlayerJobRoute(client); - let delay = getParam(params, " ", 1); + let delay = getParam(params, " ", 1); - if(isNaN(delay)) { - messagePlayerError(client, getLocaleString(client, "TimeNotNumber")) - return false; - } + if(isNaN(delay)) { + messagePlayerError(client, getLocaleString(client, "TimeNotNumber")) + return false; + } for(let i in getJobData(jobId).routes[jobRoute].locations) { - getJobData(jobId).routes[jobRoute].locations[i].stopDelay = delay; - getJobData(jobId).routes[jobRoute].locations[i].needsSaved = true; - } + getJobData(jobId).routes[jobRoute].locations[i].stopDelay = delay; + getJobData(jobId).routes[jobRoute].locations[i].needsSaved = true; + } messageAdmins(`${getPlayerName(client)} {MAINCOLOUR}${getEnabledDisabledFromBool(getJobData(jobId).enabled)}{MAINCOLOUR} set route {ALTCOLOUR}${oldName}{MAINCOLOUR} location's stop delays to {ALTCOLOUR}${delay/1000}{MAINCOLOUR} seconds for the {jobYellow}${getJobData(jobId).name}{MAINCOLOUR} job`); } @@ -1569,40 +1569,40 @@ function forceAllPlayersToStopWorking() { // =========================================================================== function jobStartRouteCommand(command, params, client) { - if(!canPlayerUseJobs(client)) { + if(!canPlayerUseJobs(client)) { messagePlayerError(client, "You are not allowed to use jobs."); - return false; - } + return false; + } - if(!isPlayerWorking(client)) { + if(!isPlayerWorking(client)) { messagePlayerError(client, "You aren't working yet! Use /startwork first."); - return false; - } + return false; + } - if(getJobData(getPlayerJob(client)).routes.length == 0) { + if(getJobData(getPlayerJob(client)).routes.length == 0) { messagePlayerError(client, "Your job doesn't have any routes for this location!"); - return false; + return false; } if(!isPlayerInJobVehicle(client)) { messagePlayerError(client, "You need to be in a vehicle that belongs to your job!"); - return false; + return false; } - if(isPlayerOnJobRoute(client)) { + if(isPlayerOnJobRoute(client)) { messagePlayerError(client, "You're already on a job route! Finish the route or use /stoproute"); - return false; + return false; } - let forceRoute = -1; - if(doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageJobs"))) { - if(!areParamsEmpty(params)) { - let tempRoute = getJobRouteFromParams(params, getPlayerJob(client)); - if(tempRoute != false) { - forceRoute = tempRoute; - } - } - } + let forceRoute = -1; + if(doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageJobs"))) { + if(!areParamsEmpty(params)) { + let tempRoute = getJobRouteFromParams(params, getPlayerJob(client)); + if(tempRoute != false) { + forceRoute = tempRoute; + } + } + } startJobRoute(client, forceRoute); return true; @@ -1611,24 +1611,24 @@ function jobStartRouteCommand(command, params, client) { // =========================================================================== function jobStopRouteCommand(command, params, client) { - if(!canPlayerUseJobs(client)) { + if(!canPlayerUseJobs(client)) { messagePlayerError(client, "You are not allowed to use jobs."); - return false; - } + return false; + } - if(!isPlayerWorking(client)) { + if(!isPlayerWorking(client)) { messagePlayerError(client, "You aren't working yet! Use /startwork first."); - return false; - } + return false; + } - //if(!doesPlayerHaveJobType(client, VRR_JOB_BUS) && !doesPlayerHaveJobType(client, VRR_JOB_GARBAGE)) { + //if(!doesPlayerHaveJobType(client, VRR_JOB_BUS) && !doesPlayerHaveJobType(client, VRR_JOB_GARBAGE)) { // messagePlayerError(client, "Your job doesn't use a route!"); - // return false; + // return false; //} if(!isPlayerOnJobRoute(client)) { messagePlayerError(client, "You aren't on a job route!"); - return false; + return false; } stopJobRoute(client, false, false); @@ -1660,21 +1660,21 @@ function isPlayerWorking(client) { // =========================================================================== function startJobRoute(client, forceRoute = -1) { - let jobId = getPlayerJob(client); - let jobRoute = 0; + let jobId = getPlayerJob(client); + let jobRoute = 0; - if(forceRoute == -1) { - jobRoute = getRandomJobRouteForLocation(getClosestJobLocationForJob(getPlayerPosition(client), jobId)); - } else { - jobRoute = forceRoute; - } + if(forceRoute == -1) { + jobRoute = getRandomJobRouteForLocation(getClosestJobLocationForJob(getPlayerPosition(client), jobId)); + } else { + jobRoute = forceRoute; + } - if(jobRoute == -1) { - messagePlayerError(client, `There are no routes for this location.`); - return false; - } + if(jobRoute == -1) { + messagePlayerError(client, `There are no routes for this location.`); + return false; + } - logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)} is starting job route ${jobRoute} for job ${jobId}`); + logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)} is starting job route ${jobRoute} for job ${jobId}`); getPlayerData(client).jobRoute = jobRoute; getPlayerData(client).jobRouteLocation = 0; @@ -1684,26 +1684,26 @@ function startJobRoute(client, forceRoute = -1) { getPlayerVehicle(client).colour2 = getJobRouteData(jobId, jobRoute).vehicleColour2; messagePlayerNormal(client, replaceJobRouteStringsInMessage(getJobRouteData(jobId, jobRoute).startMessage, jobId, jobRoute)); - if(getJobRouteData(jobId, jobRoute).locations.length > 0) { + if(getJobRouteData(jobId, jobRoute).locations.length > 0) { showCurrentJobLocation(client); } else { - messagePlayerError(client, `There are no locations for this route.`); - } + messagePlayerError(client, `There are no locations for this route.`); + } } // =========================================================================== function stopJobRoute(client, successful = false, alertPlayer = true) { - let jobId = getPlayerJob(client); + let jobId = getPlayerJob(client); if(alertPlayer) { messagePlayerAlert(client, replaceJobRouteStringsInMessage(getJobRouteData(jobId, getPlayerJobRoute(client)).finishMessage), jobId, getPlayerJobRoute(client)); } - if(successful == true) { - finishSuccessfulJobRoute(client); - return false; - } + if(successful == true) { + finishSuccessfulJobRoute(client); + return false; + } stopReturnToJobVehicleCountdown(client); sendPlayerStopJobRoute(client); @@ -1797,26 +1797,26 @@ function deleteJobLocation(jobLocationData) { quickDatabaseQuery(`DELETE FROM job_loc WHERE job_loc_id = ${jobLocationData.databaseId}`); } - deleteJobLocationBlip(tempJob, tempLocation); - deleteJobLocationPickup(tempJob, tempLocation); + deleteJobLocationBlip(tempJob, tempLocation); + deleteJobLocationPickup(tempJob, tempLocation); getJobData(getJobIdFromDatabaseId(tempJob)).locations.splice(tempLocation, 1); - setAllJobDataIndexes(); + setAllJobDataIndexes(); } // =========================================================================== function freezePlayerJobVehicleForRouteLocation(client) { - getVehicleData(getPlayerVehicle(client)).engine = false; + getVehicleData(getPlayerVehicle(client)).engine = false; setVehicleEngine(getPlayerVehicle(client), getVehicleData(getPlayerVehicle(client)).engine); - //setPlayerControlState(client, false); + //setPlayerControlState(client, false); } // =========================================================================== function unFreezePlayerJobVehicleForRouteLocation(client) { - getVehicleData(getPlayerVehicle(client)).engine = true; + getVehicleData(getPlayerVehicle(client)).engine = true; setVehicleEngine(getPlayerVehicle(client), getVehicleData(getPlayerVehicle(client)).engine); - //setPlayerControlState(client, true); + //setPlayerControlState(client, true); } // =========================================================================== @@ -2424,31 +2424,31 @@ function isPlayerOnJobBlackList(client, jobId) { // =========================================================================== function playerArrivedAtJobRouteLocation(client) { - let jobId = getPlayerJob(client); + let jobId = getPlayerJob(client); if(!isPlayerOnJobRoute(client)) { return false; } - if(isLastLocationOnJobRoute(jobId, getPlayerJobRoute(client), getPlayerJobRouteLocation(client))) { - finishSuccessfulJobRoute(client); - return false; - } + if(isLastLocationOnJobRoute(jobId, getPlayerJobRoute(client), getPlayerJobRouteLocation(client))) { + finishSuccessfulJobRoute(client); + return false; + } - showGameMessage(client, replaceJobRouteStringsInMessage(removeColoursInMessage(getJobRouteData(jobId, getPlayerJobRoute(client)).locationArriveMessage), jobId, getPlayerJobRoute(client)), getJobData(jobId).colour, 3500); - if(getJobRouteLocationData(jobId, getPlayerJobRoute(client),getPlayerJobRouteLocation(client)).stopDelay > 0) { - freezePlayerJobVehicleForRouteLocation(client); - getPlayerData(client).jobRouteLocation = getNextLocationOnJobRoute(jobId, getPlayerJobRoute(client), getPlayerJobRouteLocation(client)); - setTimeout(function() { - showCurrentJobLocation(client); - showGameMessage(client, replaceJobRouteStringsInMessage(removeColoursInMessage(getJobRouteData(jobId, getPlayerJobRoute(client)).locationNextMessage), jobId, getPlayerJobRoute(client)), getJobData(jobId).colour, 3500); - unFreezePlayerJobVehicleForRouteLocation(client); - }, getJobRouteLocationData(jobId, getPlayerJobRoute(client),getPlayerJobRouteLocation(client)).stopDelay); - } else { - getPlayerData(client).jobRouteLocation = getNextLocationOnJobRoute(jobId, getPlayerJobRoute(client), getPlayerJobRouteLocation(client)); - showCurrentJobLocation(client); - showGameMessage(client, replaceJobRouteStringsInMessage(removeColoursInMessage(getJobRouteData(jobId, getPlayerJobRoute(client)).locationNextMessage), jobId, getPlayerJobRoute(client)), getJobData(jobId).colour, 3500); - } + showGameMessage(client, replaceJobRouteStringsInMessage(removeColoursInMessage(getJobRouteData(jobId, getPlayerJobRoute(client)).locationArriveMessage), jobId, getPlayerJobRoute(client)), getJobData(jobId).colour, 3500); + if(getJobRouteLocationData(jobId, getPlayerJobRoute(client),getPlayerJobRouteLocation(client)).stopDelay > 0) { + freezePlayerJobVehicleForRouteLocation(client); + getPlayerData(client).jobRouteLocation = getNextLocationOnJobRoute(jobId, getPlayerJobRoute(client), getPlayerJobRouteLocation(client)); + setTimeout(function() { + showCurrentJobLocation(client); + showGameMessage(client, replaceJobRouteStringsInMessage(removeColoursInMessage(getJobRouteData(jobId, getPlayerJobRoute(client)).locationNextMessage), jobId, getPlayerJobRoute(client)), getJobData(jobId).colour, 3500); + unFreezePlayerJobVehicleForRouteLocation(client); + }, getJobRouteLocationData(jobId, getPlayerJobRoute(client),getPlayerJobRouteLocation(client)).stopDelay); + } else { + getPlayerData(client).jobRouteLocation = getNextLocationOnJobRoute(jobId, getPlayerJobRoute(client), getPlayerJobRouteLocation(client)); + showCurrentJobLocation(client); + showGameMessage(client, replaceJobRouteStringsInMessage(removeColoursInMessage(getJobRouteData(jobId, getPlayerJobRoute(client)).locationNextMessage), jobId, getPlayerJobRoute(client)), getJobData(jobId).colour, 3500); + } } // =========================================================================== @@ -2595,14 +2595,14 @@ function createJobRoute(routeName, closestJobLocation) { tempJobRouteData.vehicleColour1 = 1; tempJobRouteData.vehicleColour2 = 1; tempJobRouteData.pay = 500; - tempJobRouteData.jobIndex = closestJobLocation.jobIndex; + tempJobRouteData.jobIndex = closestJobLocation.jobIndex; tempJobRouteData.startMessage = `You are now on route {ALTCOLOUR}{JOBROUTENAME}{MAINCOLOUR} for the {jobYellow}{JOBNAME}{MAINCOLOUR} job!`; tempJobRouteData.finishMessage = `You have finished the {ALTCOLOUR}{JOBROUTENAME}{MAINCOLOUR} route and {ALTCOLOUR}{JOBROUTEPAY}{MAINCOLOUR} has been added to your next paycheck!`; tempJobRouteData.locationArriveMessage = `You arrived at a stop.`; tempJobRouteData.locationNextMessage = `Drive to the next stop.`; getJobData(closestJobLocation.jobIndex).routes.push(tempJobRouteData); - saveJobRouteToDatabase(tempJobRouteData); + saveJobRouteToDatabase(tempJobRouteData); setAllJobDataIndexes(); } @@ -2615,10 +2615,10 @@ function createJobRouteLocation(routeLocationName, position, jobRouteData) { tempJobRouteLocationData.enabled = true; tempJobRouteLocationData.needsSaved = true; tempJobRouteLocationData.position = position; - tempJobRouteLocationData.routeIndex = jobRouteData.index; + tempJobRouteLocationData.routeIndex = jobRouteData.index; getJobData(jobRouteData.jobIndex).routes[jobRouteData.index].locations.push(tempJobRouteLocationData); - saveJobRouteLocationToDatabase(tempJobRouteLocationData); + saveJobRouteLocationToDatabase(tempJobRouteLocationData); setAllJobDataIndexes(); } @@ -2638,7 +2638,7 @@ function deleteJobRouteLocationCommand(command, params, client) { getJobData(getJobIdFromDatabaseId(tempJob)).routes[tempJobRoute].locations.splice(tempIndex, 1); setAllJobDataIndexes(); - collectAllGarbage(); + collectAllGarbage(); } // =========================================================================== @@ -2647,9 +2647,9 @@ function deleteJobRouteCommand(command, params, client) { let jobId = getPlayerJob(client); let jobRoute = getPlayerData(client).jobRoute; - if(!areParamsEmpty(client)) { - jobRoute = getJobRouteFromParams(params, jobId); - } + if(!areParamsEmpty(client)) { + jobRoute = getJobRouteFromParams(params, jobId); + } let jobRouteData = getServerData().jobs[jobId].routes[jobRoute]; @@ -2667,10 +2667,10 @@ function deleteJobRouteCommand(command, params, client) { messageAdmins(`{ALTCOLOUR}${getPlayerName(client)}{MAINCOLOUR} deleted route {ALTCOLOUR}${jobRouteData.name} (DB ID ${jobRouteData.databaseId}) {MAINCOLOUR}for the {jobYellow}${getJobData(jobId).name}{MAINCOLOUR} job`); - if(jobRouteData.databaseId > 0) { - quickDatabaseQuery(`DELETE FROM job_route WHERE job_route_id = ${jobRouteData.databaseId}`); - quickDatabaseQuery(`DELETE FROM job_route_loc WHERE job_route_loc_route = ${jobRouteData.databaseId}`); - } + if(jobRouteData.databaseId > 0) { + quickDatabaseQuery(`DELETE FROM job_route WHERE job_route_id = ${jobRouteData.databaseId}`); + quickDatabaseQuery(`DELETE FROM job_route_loc WHERE job_route_loc_route = ${jobRouteData.databaseId}`); + } clearArray(getServerData().jobs[jobId].routes[jobRoute].locations); getServerData().jobs[jobId].routes.splice(jobRoute, 1); @@ -2744,7 +2744,7 @@ function getJobPointsInRange(position, distance) { // =========================================================================== function respawnJobVehicle(client) { - respawnVehicle(getPlayerJobVehicle(client)); + respawnVehicle(getPlayerJobVehicle(client)); } // =========================================================================== @@ -2756,12 +2756,12 @@ function getPlayerJobVehicle(client) { // =========================================================================== function getRandomJobRouteForLocation(closestJobLocation) { - if(closestJobLocation.routeCache.length > 0) { - let randomRoute = getRandom(0, closestJobLocation.routeCache.length-1); - let routeId = closestJobLocation.routeCache[randomRoute]; - return getJobRouteData(closestJobLocation.jobIndex, routeId).index; - } - return -1; + if(closestJobLocation.routeCache.length > 0) { + let randomRoute = getRandom(0, closestJobLocation.routeCache.length-1); + let routeId = closestJobLocation.routeCache[randomRoute]; + return getJobRouteData(closestJobLocation.jobIndex, routeId).index; + } + return -1; } // =========================================================================== @@ -2801,58 +2801,58 @@ function getClosestJobLocationForJob(position, jobId) { // =========================================================================== function getPlayerJobRoute(client) { - return getPlayerData(client).jobRoute; + return getPlayerData(client).jobRoute; } // =========================================================================== function getPlayerJobRouteLocation(client) { - return getPlayerData(client).jobRouteLocation; + return getPlayerData(client).jobRouteLocation; } // =========================================================================== function showCurrentJobLocation(client) { - let jobId = getPlayerJob(client); - sendJobRouteLocationToPlayer(client, getJobRouteLocationData(jobId, getPlayerJobRoute(client), getPlayerJobRouteLocation(client)).position, getJobData(jobId).colour); + let jobId = getPlayerJob(client); + sendJobRouteLocationToPlayer(client, getJobRouteLocationData(jobId, getPlayerJobRoute(client), getPlayerJobRouteLocation(client)).position, getJobData(jobId).colour); } // =========================================================================== function finishSuccessfulJobRoute(client) { - let jobId = getPlayerJob(client); - let jobRouteData = getJobRouteData(jobId, getPlayerJobRoute(client)); - let payout = toInteger(applyServerInflationMultiplier(jobRouteData.pay)); - getPlayerData(client).payDayAmount = getPlayerData(client).payDayAmount + payout; + let jobId = getPlayerJob(client); + let jobRouteData = getJobRouteData(jobId, getPlayerJobRoute(client)); + let payout = toInteger(applyServerInflationMultiplier(jobRouteData.pay)); + getPlayerData(client).payDayAmount = getPlayerData(client).payDayAmount + payout; - messagePlayerSuccess(client, replaceJobRouteStringsInMessage(jobRouteData.finishMessage, jobId, jobRouteData.index)); + messagePlayerSuccess(client, replaceJobRouteStringsInMessage(jobRouteData.finishMessage, jobId, jobRouteData.index)); - stopReturnToJobVehicleCountdown(client); - sendPlayerStopJobRoute(client); - respawnVehicle(getPlayerData(client).jobRouteVehicle); + stopReturnToJobVehicleCountdown(client); + sendPlayerStopJobRoute(client); + respawnVehicle(getPlayerData(client).jobRouteVehicle); - getPlayerData(client).jobRouteVehicle = false; - getPlayerData(client).jobRoute = -1; - getPlayerData(client).jobRouteLocation = -1; + getPlayerData(client).jobRouteVehicle = false; + getPlayerData(client).jobRoute = -1; + getPlayerData(client).jobRouteLocation = -1; } // =========================================================================== function getNextLocationOnJobRoute(jobId, routeId, currentLocationId) { - if(!isLastLocationOnJobRoute(jobId, routeId, currentLocationId)) { - return currentLocationId+1; - } else { - return getJobRouteData(jobId, routeId).locations.length-1; - } + if(!isLastLocationOnJobRoute(jobId, routeId, currentLocationId)) { + return currentLocationId+1; + } else { + return getJobRouteData(jobId, routeId).locations.length-1; + } } // =========================================================================== function isLastLocationOnJobRoute(jobId, routeId, currentLocationId) { - if(currentLocationId == getJobRouteData(jobId, routeId).locations.length-1) { - return true; - } - return false; + if(currentLocationId == getJobRouteData(jobId, routeId).locations.length-1) { + return true; + } + return false; } // =========================================================================== @@ -2876,21 +2876,21 @@ function getJobRouteFromParams(params, jobId) { // =========================================================================== function replaceJobRouteStringsInMessage(messageText, jobId, jobRouteId) { - let tempJobRouteData = getJobRouteData(jobId, jobRouteId); + let tempJobRouteData = getJobRouteData(jobId, jobRouteId); let tempFind = `{JOBROUTENAME}`; let tempRegex = new RegExp(tempFind, 'g'); messageText = messageText.replace(tempRegex, tempJobRouteData.name); - tempFind = `{JOBROUTEPAY}`; + tempFind = `{JOBROUTEPAY}`; tempRegex = new RegExp(tempFind, 'g'); messageText = messageText.replace(tempRegex, `$${tempJobRouteData.pay}`); - tempFind = `{JOBNAME}`; + tempFind = `{JOBNAME}`; tempRegex = new RegExp(tempFind, 'g'); messageText = messageText.replace(tempRegex, getJobData(tempJobRouteData.jobIndex).name); - return messageText; + return messageText; } // =========================================================================== \ No newline at end of file diff --git a/scripts/server/jsconfig.json b/scripts/server/jsconfig.json index f0347317..05e4c657 100644 --- a/scripts/server/jsconfig.json +++ b/scripts/server/jsconfig.json @@ -1,16 +1,16 @@ { "compilerOptions": { - "module": "commonjs", - "target": "es6", - "moduleResolution": "classic" + "module": "commonjs", + "target": "es6", + "moduleResolution": "classic" }, "include": [ - "*.js", - "job/*.js", - "business/*.js", - "item/*.js", - "npc/*.js", - "native/*.js", - "../shared/*.js" + "*.js", + "job/*.js", + "business/*.js", + "item/*.js", + "npc/*.js", + "native/*.js", + "../shared/*.js" ] } \ No newline at end of file diff --git a/scripts/server/keybind.js b/scripts/server/keybind.js index 7b6b23cf..d392bd68 100644 --- a/scripts/server/keybind.js +++ b/scripts/server/keybind.js @@ -10,190 +10,190 @@ function initKeyBindScript() { logToConsole(LOG_INFO, "[VRR.KeyBind]: Initializing key bind script ..."); - getGlobalConfig().keyBind = loadKeyBindConfiguration(); + getGlobalConfig().keyBind = loadKeyBindConfiguration(); logToConsole(LOG_INFO, "[VRR.KeyBind]: Key bind script initialized!"); } // =========================================================================== function addKeyBindCommand(command, params, client) { - let splitParams = params.split(" "); + let splitParams = params.split(" "); - let keyId = getKeyIdFromParams(getParam(params, " ", 1)); - let tempCommand = getParam(params, " ", 2); - let tempParams = (splitParams.length > 2) ? splitParams.slice(2).join(" ") : ""; + let keyId = getKeyIdFromParams(getParam(params, " ", 1)); + let tempCommand = getParam(params, " ", 2); + let tempParams = (splitParams.length > 2) ? splitParams.slice(2).join(" ") : ""; - if(!keyId) { - messagePlayerError(client, "The key ID or name you input is invalid!"); - messagePlayerTip(client, "Use simple key names, letters, or numbers. Don't add spaces."); - messagePlayerInfo(client, `Examples: {ALTCOLOUR}1, 2, a, b, numplus, num1, f1, f2, pageup, delete, insert, rightshift, leftctrl`); - return false; - } + if(!keyId) { + messagePlayerError(client, "The key ID or name you input is invalid!"); + messagePlayerTip(client, "Use simple key names, letters, or numbers. Don't add spaces."); + messagePlayerInfo(client, `Examples: {ALTCOLOUR}1, 2, a, b, numplus, num1, f1, f2, pageup, delete, insert, rightshift, leftctrl`); + return false; + } - if(!keyId) { - messagePlayerError(client, "That key name/id is invalid!"); - return false; - } + if(!keyId) { + messagePlayerError(client, "That key name/id is invalid!"); + return false; + } - if(areParamsEmpty(tempCommand)) { - messagePlayerSyntax(client, getCommandSyntaxText(command)); - return false; - } + if(areParamsEmpty(tempCommand)) { + messagePlayerSyntax(client, getCommandSyntaxText(command)); + return false; + } - addPlayerKeyBind(client, keyId, tempCommand, tempParams); - messagePlayerSuccess(client, `You binded the {ALTCOLOUR}${toUpperCase(getKeyNameFromId(keyId))} {MAINCOLOUR}key to command: {ALTCOLOUR}/${tempCommand} ${tempParams}`); + addPlayerKeyBind(client, keyId, tempCommand, tempParams); + messagePlayerSuccess(client, `You binded the {ALTCOLOUR}${toUpperCase(getKeyNameFromId(keyId))} {MAINCOLOUR}key to command: {ALTCOLOUR}/${tempCommand} ${tempParams}`); } // =========================================================================== function removeKeyBindCommand(command, params, client) { - let splitParams = params.split(" "); + let splitParams = params.split(" "); - let keyId = getKeyIdFromParams(getParam(params, " ", 1)); + let keyId = getKeyIdFromParams(getParam(params, " ", 1)); - if(!keyId) { - messagePlayerError(client, "The key ID or name you input is invalid!"); - messagePlayerTip(client, "Use simple key names, letters, or numbers. Don't add spaces."); - messagePlayerInfo(client, `Examples: {ALTCOLOUR}1, 2, a, b, numplus, num1, f1, f2, pageup, delete, insert, rightshift, leftctrl`); - return false; - } + if(!keyId) { + messagePlayerError(client, "The key ID or name you input is invalid!"); + messagePlayerTip(client, "Use simple key names, letters, or numbers. Don't add spaces."); + messagePlayerInfo(client, `Examples: {ALTCOLOUR}1, 2, a, b, numplus, num1, f1, f2, pageup, delete, insert, rightshift, leftctrl`); + return false; + } - if(!keyId) { - messagePlayerError(client, "That key name/id is invalid!"); - return false; - } + if(!keyId) { + messagePlayerError(client, "That key name/id is invalid!"); + return false; + } - removePlayerKeyBind(client, keyId); - messagePlayerSuccess(client, `You removed the keybind for the {ALTCOLOUR}${toUpperCase(getKeyNameFromId(keyId))} {MAINCOLOUR}key`); + removePlayerKeyBind(client, keyId); + messagePlayerSuccess(client, `You removed the keybind for the {ALTCOLOUR}${toUpperCase(getKeyNameFromId(keyId))} {MAINCOLOUR}key`); } // =========================================================================== function addPlayerKeyBind(client, keys, command, params, tempKey = false) { - let keyBindData = new KeyBindData(false, keys, `${command} ${params}`); - if(tempKey == true) { - keyBindData.databaseId = -1; - } + let keyBindData = new KeyBindData(false, keys, `${command} ${params}`); + if(tempKey == true) { + keyBindData.databaseId = -1; + } - getPlayerData(client).keyBinds.push(keyBindData); - sendAddAccountKeyBindToClient(client, keys, (keys.length > 1) ? VRR_KEYSTATE_COMBO : VRR_KEYSTATE_UP); + getPlayerData(client).keyBinds.push(keyBindData); + sendAddAccountKeyBindToClient(client, keys, (keys.length > 1) ? VRR_KEYSTATE_COMBO : VRR_KEYSTATE_UP); - if(!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand(client, "enter")) { - let keyId = getPlayerKeyBindForCommand(client, "enter"); - logToConsole(LOG_DEBUG, `[VRR.Event] Sending custom enter property key ID (${keyId.key}, ${toUpperCase(getKeyNameFromId(keyId.key))}) to ${getPlayerDisplayForConsole(client)}`); - sendPlayerEnterPropertyKey(client, keyId.key); - } else { - sendPlayerEnterPropertyKey(client, false); - } + if(!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand(client, "enter")) { + let keyId = getPlayerKeyBindForCommand(client, "enter"); + logToConsole(LOG_DEBUG, `[VRR.Event] Sending custom enter property key ID (${keyId.key}, ${toUpperCase(getKeyNameFromId(keyId.key))}) to ${getPlayerDisplayForConsole(client)}`); + sendPlayerEnterPropertyKey(client, keyId.key); + } else { + sendPlayerEnterPropertyKey(client, false); + } } // =========================================================================== function removePlayerKeyBind(client, keyId) { - if(isPlayerLoggedIn(client)) { - quickDatabaseQuery(`DELETE FROM acct_hotkey WHERE acct_hotkey_acct = ${getPlayerData(client).accountData.databaseId} AND acct_hotkey_key = ${keyId}`); - } + if(isPlayerLoggedIn(client)) { + quickDatabaseQuery(`DELETE FROM acct_hotkey WHERE acct_hotkey_acct = ${getPlayerData(client).accountData.databaseId} AND acct_hotkey_key = ${keyId}`); + } - for(let i in getPlayerData(client).keyBinds) { - if(getPlayerData(client).keyBinds[i].key == keyId) { - getPlayerData(client).keyBinds.splice(i, 1); - } - } - sendRemoveAccountKeyBindToClient(client, keyId); + for(let i in getPlayerData(client).keyBinds) { + if(getPlayerData(client).keyBinds[i].key == keyId) { + getPlayerData(client).keyBinds.splice(i, 1); + } + } + sendRemoveAccountKeyBindToClient(client, keyId); - if(!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand(client, "enter")) { - let keyId = getPlayerKeyBindForCommand(client, "enter"); - logToConsole(LOG_DEBUG, `[VRR.Event] Sending custom enter property key ID (${keyId.key}, ${toUpperCase(getKeyNameFromId(keyId.key))}) to ${getPlayerDisplayForConsole(client)}`); - sendPlayerEnterPropertyKey(client, keyId.key); - } else { - sendPlayerEnterPropertyKey(client, false); - } + if(!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand(client, "enter")) { + let keyId = getPlayerKeyBindForCommand(client, "enter"); + logToConsole(LOG_DEBUG, `[VRR.Event] Sending custom enter property key ID (${keyId.key}, ${toUpperCase(getKeyNameFromId(keyId.key))}) to ${getPlayerDisplayForConsole(client)}`); + sendPlayerEnterPropertyKey(client, keyId.key); + } else { + sendPlayerEnterPropertyKey(client, false); + } } // =========================================================================== function doesPlayerHaveKeyBindForCommand(client, command) { - for(let i in getPlayerData(client).keyBinds) { - if(toLowerCase(getPlayerData(client).keyBinds[i].commandString.split(" ")[0]) == toLowerCase(command)) { - return true; - } - } - return false; + for(let i in getPlayerData(client).keyBinds) { + if(toLowerCase(getPlayerData(client).keyBinds[i].commandString.split(" ")[0]) == toLowerCase(command)) { + return true; + } + } + return false; } // =========================================================================== function getPlayerKeyBindForCommand(client, command) { - for(let i in getPlayerData(client).keyBinds) { - if(toLowerCase(getPlayerData(client).keyBinds[i].commandString.split(" ")[0]) == toLowerCase(command)) { - return getPlayerData(client).keyBinds[i]; - } - } - return false; + for(let i in getPlayerData(client).keyBinds) { + if(toLowerCase(getPlayerData(client).keyBinds[i].commandString.split(" ")[0]) == toLowerCase(command)) { + return getPlayerData(client).keyBinds[i]; + } + } + return false; } // =========================================================================== function doesPlayerHaveKeyBindForKey(client, key) { - for(let i in getPlayerData(client).keyBinds) { - if(getPlayerData(client).keyBinds[i].key == key) { - return true; - } - } - return false; + for(let i in getPlayerData(client).keyBinds) { + if(getPlayerData(client).keyBinds[i].key == key) { + return true; + } + } + return false; } // =========================================================================== function doesPlayerHaveKeyBindsDisabled(client) { - return hasBitFlag(getPlayerData(client).accountData.settings, getAccountSettingsFlagValue("NoKeyBinds")); + return hasBitFlag(getPlayerData(client).accountData.settings, getAccountSettingsFlagValue("NoKeyBinds")); } // =========================================================================== function getPlayerKeyBindForKey(client, key) { - for(let i in getPlayerData(client).keyBinds) { - if(getPlayerData(client).keyBinds[i].key == key) { - return getPlayerData(client).keyBinds[i]; - } - } - return false; + for(let i in getPlayerData(client).keyBinds) { + if(getPlayerData(client).keyBinds[i].key == key) { + return getPlayerData(client).keyBinds[i]; + } + } + return false; } // =========================================================================== function playerUsedKeyBind(client, key) { - if(!isPlayerLoggedIn(client)) { - return false; - } + if(!isPlayerLoggedIn(client)) { + return false; + } - if(!isPlayerSpawned(client)) { - return false; - } + if(!isPlayerSpawned(client)) { + return false; + } - logToConsole(LOG_DEBUG, `[VRR.KeyBind] ${getPlayerDisplayForConsole(client)} used keybind ${toUpperCase(getKeyNameFromId(key))} (${key})`); - if(!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForKey(client, key)) { - let keyBindData = getPlayerKeyBindForKey(client, key); - if(keyBindData.enabled) { - let splitCommandString = keyBindData.commandString.split(" "); - let tempCommand = splitCommandString[0]; - let tempParams = ""; - if(splitCommandString.length > 1) { - tempParams = splitCommandString.slice(1).join(" "); - } - getCommand(toLowerCase(tempCommand)).handlerFunction(tempCommand, tempParams, client); - //triggerEvent("OnPlayerCommand", null, tempCommand, tempParams, client); - } - } + logToConsole(LOG_DEBUG, `[VRR.KeyBind] ${getPlayerDisplayForConsole(client)} used keybind ${toUpperCase(getKeyNameFromId(key))} (${key})`); + if(!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForKey(client, key)) { + let keyBindData = getPlayerKeyBindForKey(client, key); + if(keyBindData.enabled) { + let splitCommandString = keyBindData.commandString.split(" "); + let tempCommand = splitCommandString[0]; + let tempParams = ""; + if(splitCommandString.length > 1) { + tempParams = splitCommandString.slice(1).join(" "); + } + getCommand(toLowerCase(tempCommand)).handlerFunction(tempCommand, tempParams, client); + //triggerEvent("OnPlayerCommand", null, tempCommand, tempParams, client); + } + } } // =========================================================================== function sendAccountKeyBindsToClient(client) { - sendClearKeyBindsToClient(client); - for(let i in getPlayerData(client).keyBinds) { - sendAddAccountKeyBindToClient(client, getPlayerData(client).keyBinds[i].key, getPlayerData(client).keyBinds[i].keyState); - } + sendClearKeyBindsToClient(client); + for(let i in getPlayerData(client).keyBinds) { + sendAddAccountKeyBindToClient(client, getPlayerData(client).keyBinds[i].key, getPlayerData(client).keyBinds[i].keyState); + } } // =========================================================================== diff --git a/scripts/server/locale.js b/scripts/server/locale.js index a45ef9e8..0d9b61f7 100644 --- a/scripts/server/locale.js +++ b/scripts/server/locale.js @@ -12,16 +12,16 @@ let translateURL = "http://api.mymemory.translated.net/get?de={3}&q={0}&langpair // =========================================================================== function initLocaleScript() { - logToConsole(LOG_INFO, "[VRR.Locale]: Initializing locale script ..."); - getServerData().localeStrings = loadAllLocaleStrings(); + logToConsole(LOG_INFO, "[VRR.Locale]: Initializing locale script ..."); + getServerData().localeStrings = loadAllLocaleStrings(); - // Translation Cache - getServerData().cachedTranslations = new Array(getGlobalConfig().locale.locales.length); - getServerData().cachedTranslationFrom = new Array(getGlobalConfig().locale.locales.length); - getServerData().cachedTranslationFrom.fill([]); - getServerData().cachedTranslations.fill(getServerData().cachedTranslationFrom); + // Translation Cache + getServerData().cachedTranslations = new Array(getGlobalConfig().locale.locales.length); + getServerData().cachedTranslationFrom = new Array(getGlobalConfig().locale.locales.length); + getServerData().cachedTranslationFrom.fill([]); + getServerData().cachedTranslations.fill(getServerData().cachedTranslationFrom); - getGlobalConfig().locale.defaultLanguageId = getLocaleFromParams(getGlobalConfig().locale.defaultLanguageId); + getGlobalConfig().locale.defaultLanguageId = getLocaleFromParams(getGlobalConfig().locale.defaultLanguageId); logToConsole(LOG_INFO, "[VRR.Locale]: Locale script initialized!"); } @@ -29,68 +29,68 @@ function initLocaleScript() { // =========================================================================== function getLocaleString(client, stringName, ...args) { - let tempString = getRawLocaleString(stringName, getPlayerData(client).locale); - if(tempString == "") { - submitBugReport(client, `(AUTOMATED REPORT) Locale string "${stringName}" is missing for "${getPlayerLocaleName(client)}"`); - } + let tempString = getRawLocaleString(stringName, getPlayerData(client).locale); + if(tempString == "") { + submitBugReport(client, `(AUTOMATED REPORT) Locale string "${stringName}" is missing for "${getPlayerLocaleName(client)}"`); + } - 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; + return tempString; } // =========================================================================== function getGroupedLocaleString(client, stringName, index, ...args) { - let tempString = getRawGroupedLocaleString(stringName, getPlayerData(client).locale, index); + let tempString = getRawGroupedLocaleString(stringName, getPlayerData(client).locale, index); - 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; + return tempString; } // =========================================================================== function getRawLocaleString(stringName, localeName) { - return getLocaleStrings()[localeName][stringName]; + return getLocaleStrings()[localeName][stringName]; } // =========================================================================== function getRawGroupedLocaleString(stringName, localeName, index) { - return getLocaleStrings()[localeName][stringName][index]; + return getLocaleStrings()[localeName][stringName][index]; } // =========================================================================== function getPlayerLocaleName(client) { - let localeId = getPlayerData(client).locale; - return getLocales()[localeId][0]; + let localeId = getPlayerData(client).locale; + return getLocales()[localeId][0]; } // =========================================================================== function loadAllLocaleStrings() { - let tempLocaleStrings = {}; + let tempLocaleStrings = {}; - let locales = getGlobalConfig().locale.locales; - for(let i in locales) { - let localeData = locales[i]; - let localeFile = JSON.parse(loadTextFile(`locale/${localeData[1]}.json`)); - tempLocaleStrings[i] = localeFile; - } + let locales = getGlobalConfig().locale.locales; + for(let i in locales) { + let localeData = locales[i]; + let localeFile = JSON.parse(loadTextFile(`locale/${localeData[1]}.json`)); + tempLocaleStrings[i] = localeFile; + } - return tempLocaleStrings; + return tempLocaleStrings; } // =========================================================================== function getLocaleStrings() { - return getServerData().localeStrings; + return getServerData().localeStrings; } // =========================================================================== @@ -99,7 +99,7 @@ function getLocaleFromParams(params) { let locales = getLocales(); if(isNaN(params)) { for(let i in locales) { - if(toLowerCase(locales[i][2]).indexOf(toLowerCase(params)) != -1) { + if(toLowerCase(locales[i][2]).indexOf(toLowerCase(params)) != -1) { return i; } @@ -115,7 +115,7 @@ function getLocaleFromParams(params) { // =========================================================================== function getLocales() { - return getGlobalConfig().locale.locales; + return getGlobalConfig().locale.locales; } // =========================================================================== @@ -138,41 +138,41 @@ function setLocaleCommand(command, params, client) { return false; } - let localeId = getLocaleFromParams(params); + let localeId = getLocaleFromParams(params); - if(!getLocaleData(localeId)) { - messagePlayerInfo(client, getLocaleString(client, "InvalidLocale")); - return false; - } + if(!getLocaleData(localeId)) { + messagePlayerInfo(client, getLocaleString(client, "InvalidLocale")); + return false; + } - getPlayerData(client).accountData.locale = localeId; - getPlayerData(client).locale = localeId; - messagePlayerSuccess(client, getLocaleString(client, "LocaleChanged1"), getLocaleString(client, "LocaleNativeName")); + getPlayerData(client).accountData.locale = localeId; + getPlayerData(client).locale = localeId; + messagePlayerSuccess(client, getLocaleString(client, "LocaleChanged1"), getLocaleString(client, "LocaleNativeName")); } // =========================================================================== function getLocaleData(localeId) { - if(typeof getLocales()[localeId] != "undefined") { - return getLocales()[localeId]; - } + if(typeof getLocales()[localeId] != "undefined") { + return getLocales()[localeId]; + } - return false; + return false; } // =========================================================================== function reloadLocaleConfigurationCommand(command, params, client) { getGlobalConfig().locale = loadLocaleConfig(); - getServerData().localeStrings = loadAllLocaleStrings(); + getServerData().localeStrings = loadAllLocaleStrings(); - // Translation Cache - getServerData().cachedTranslations = new Array(getGlobalConfig().locale.locales.length); - getServerData().cachedTranslationFrom = new Array(getGlobalConfig().locale.locales.length); - getServerData().cachedTranslationFrom.fill([]); - getServerData().cachedTranslations.fill(getServerData().cachedTranslationFrom); + // Translation Cache + getServerData().cachedTranslations = new Array(getGlobalConfig().locale.locales.length); + getServerData().cachedTranslationFrom = new Array(getGlobalConfig().locale.locales.length); + getServerData().cachedTranslationFrom.fill([]); + getServerData().cachedTranslations.fill(getServerData().cachedTranslationFrom); - getGlobalConfig().locale.defaultLanguageId = getLocaleFromParams(getGlobalConfig().locale.defaultLanguage); + getGlobalConfig().locale.defaultLanguageId = getLocaleFromParams(getGlobalConfig().locale.defaultLanguage); messageAdmins(`${client.name}{MAINCOLOUR} has reloaded the locale settings and texts`); } @@ -181,9 +181,9 @@ function reloadLocaleConfigurationCommand(command, params, client) { async function translateMessage(messageText, translateFrom = getGlobalConfig().locale.defaultLanguageId, translateTo = getGlobalConfig().locale.defaultLanguageId) { return new Promise(resolve => { - if(translateFrom == translateTo) { - resolve(messageText); - } + if(translateFrom == translateTo) { + resolve(messageText); + } for(let i in cachedTranslations[translateFrom][translateTo]) { if(cachedTranslations[translateFrom][translateTo][i][0] == messageText) { diff --git a/scripts/server/messaging.js b/scripts/server/messaging.js index e990d2be..fae5f859 100644 --- a/scripts/server/messaging.js +++ b/scripts/server/messaging.js @@ -15,10 +15,10 @@ function initMessagingScript() { // =========================================================================== function messageAdminAction(messageText) { - messagePlayerNormal(null, `⚠️ ${messageText}`, getColourByName("orange")); - if(getServerConfig().discordEnabled) { - messageDiscord(`:warning: ${messageText}`); - } + messagePlayerNormal(null, `⚠️ ${messageText}`, getColourByName("orange")); + if(getServerConfig().discordEnabled) { + messageDiscord(`:warning: ${messageText}`); + } } // =========================================================================== @@ -33,196 +33,196 @@ function messageAdminAction(messageText) { * */ function messagePlayerNormal(client, messageText, colour = COLOUR_WHITE) { - //if(isConsole(client) || client == null) { - // logToConsole(LOG_INFO, `${removeColoursInMessage(messageText)}`); - //} + //if(isConsole(client) || client == null) { + // logToConsole(LOG_INFO, `${removeColoursInMessage(messageText)}`); + //} - messageText = replaceColoursInMessage(messageText); + messageText = replaceColoursInMessage(messageText); - if(client == null) { - message(messageText, colour); - } else { - messageClient(messageText, client, colour); - } + if(client == null) { + message(messageText, colour); + } else { + messageClient(messageText, client, colour); + } - //sendChatBoxMessageToPlayer(client, messageText, colour); - return true; + //sendChatBoxMessageToPlayer(client, messageText, colour); + return true; } // =========================================================================== function messageAdmins(messageText, colour = getColourByName("softRed")) { - //let plainMessage = removeColoursInMessage(messageText); - //console.warn(`🛡️ ${plainMessage}`); + //let plainMessage = removeColoursInMessage(messageText); + //console.warn(`🛡️ ${plainMessage}`); - let clients = getClients(); - for(let i in clients) { - if(doesPlayerHaveStaffPermission(clients[i], getStaffFlagValue("BasicModeration"))) { - messagePlayerNormal(clients[i], `🛡️ ${messageText}`, colour); - } - } + let clients = getClients(); + for(let i in clients) { + if(doesPlayerHaveStaffPermission(clients[i], getStaffFlagValue("BasicModeration"))) { + messagePlayerNormal(clients[i], `🛡️ ${messageText}`, colour); + } + } - //if(getServerConfig().discordConfig.sendAdminEvents) { - // messageDiscordAdminChannel(plainMessage); - //} + //if(getServerConfig().discordConfig.sendAdminEvents) { + // messageDiscordAdminChannel(plainMessage); + //} } // =========================================================================== function messagePlayerError(client, messageText) { - if(isConsole(client)) { - logToConsole(LOG_INFO, `❌ ${messageText}`); - return true; - } + if(isConsole(client)) { + logToConsole(LOG_INFO, `❌ ${messageText}`); + return true; + } - if(!isClientFromDiscord(client)) { - messagePlayerNormal(client, `❌ ${messageText}`, getColourByName("white")); - } else { - messageDiscordUser(client, `❌ ${messageText}`); - } + if(!isClientFromDiscord(client)) { + messagePlayerNormal(client, `❌ ${messageText}`, getColourByName("white")); + } else { + messageDiscordUser(client, `❌ ${messageText}`); + } } // =========================================================================== function messagePlayerSyntax(client, messageText) { - if(isConsole(client)) { - logToConsole(LOG_INFO, `⌨️ ${messageText}`); - return true; - } + if(isConsole(client)) { + logToConsole(LOG_INFO, `⌨️ ${messageText}`); + return true; + } - if(!isClientFromDiscord(client)) { - messagePlayerNormal(client, `⌨️ USAGE: {MAINCOLOUR} ${messageText}`, getColourByType("syntaxMessage")); - } else { - messageDiscordUser(client, `⌨️ ${messageText}`); - } + if(!isClientFromDiscord(client)) { + messagePlayerNormal(client, `⌨️ USAGE: {MAINCOLOUR} ${messageText}`, getColourByType("syntaxMessage")); + } else { + messageDiscordUser(client, `⌨️ ${messageText}`); + } } // =========================================================================== function messagePlayerAlert(client, messageText) { - if(isConsole(client)) { - logToConsole(LOG_INFO, `⚠️ ${messageText}`); - return true; - } + if(isConsole(client)) { + logToConsole(LOG_INFO, `⚠️ ${messageText}`); + return true; + } - if(!isClientFromDiscord(client)) { - messagePlayerNormal(client, `⚠️ ${messageText}`, getColourByName("white")); - } else { - messageDiscordUser(client, `⚠️ ${messageText}`); - } + if(!isClientFromDiscord(client)) { + messagePlayerNormal(client, `⚠️ ${messageText}`, getColourByName("white")); + } else { + messageDiscordUser(client, `⚠️ ${messageText}`); + } } // =========================================================================== function messagePlayerSuccess(client, messageText) { - if(isConsole(client)) { - logToConsole(LOG_INFO, `✔️ ${messageText}`); - return true; - } + if(isConsole(client)) { + logToConsole(LOG_INFO, `✔️ ${messageText}`); + return true; + } - if(!isClientFromDiscord(client)) { - messagePlayerNormal(client, `✔️ ${messageText}`, getColourByName("white")); - } else { - messageDiscordUser(client, `✔️ ${messageText}`); - } + if(!isClientFromDiscord(client)) { + messagePlayerNormal(client, `✔️ ${messageText}`, getColourByName("white")); + } else { + messageDiscordUser(client, `✔️ ${messageText}`); + } } // =========================================================================== function messagePlayerInfo(client, messageText) { - if(isConsole(client)) { - logToConsole(LOG_INFO, `ℹ️ ${messageText}`); - return true; - } + if(isConsole(client)) { + logToConsole(LOG_INFO, `ℹ️ ${messageText}`); + return true; + } - if(!isClientFromDiscord(client)) { - messagePlayerNormal(client, `ℹ️ ${messageText}`, getColourByName("white")); - } else { - messageDiscordUser(client, `:information_source: ${messageText}`); - } + if(!isClientFromDiscord(client)) { + messagePlayerNormal(client, `ℹ️ ${messageText}`, getColourByName("white")); + } else { + messageDiscordUser(client, `:information_source: ${messageText}`); + } } // =========================================================================== function messagePlayerTip(client, messageText) { - if(isConsole(client)) { - logToConsole(LOG_INFO, `ℹ️ ${messageText}`); - return true; - } + if(isConsole(client)) { + logToConsole(LOG_INFO, `ℹ️ ${messageText}`); + return true; + } - if(!isClientFromDiscord(client)) { - messagePlayerNormal(client, `ℹ️ ${messageText}`, getColourByName("white")); - } else { - messageDiscordUser(client, `:information_source: ${messageText}`); - } + if(!isClientFromDiscord(client)) { + messagePlayerNormal(client, `ℹ️ ${messageText}`, getColourByName("white")); + } else { + messageDiscordUser(client, `:information_source: ${messageText}`); + } } // =========================================================================== function messagePlayerTalk(client, talkingClient, messageText) { - messagePlayerNormal(client, `🗣️ ${getPlayerAccentInlineOutput(talkingClient)}${getClientSubAccountName(talkingClient)} says: ${messageText}`, getColourByType("talkMessage")); + messagePlayerNormal(client, `🗣️ ${getPlayerAccentInlineOutput(talkingClient)}${getClientSubAccountName(talkingClient)} says: ${messageText}`, getColourByType("talkMessage")); } // =========================================================================== function messagePlayerWhisper(client, whisperingClient, messageText) { - messagePlayerNormal(client, `🤫 ${getPlayerAccentInlineOutput(whisperingClient)}${getClientSubAccountName(whisperingClient)} whispers: ${messageText}`, getColourByType("whisperMessage")); + messagePlayerNormal(client, `🤫 ${getPlayerAccentInlineOutput(whisperingClient)}${getClientSubAccountName(whisperingClient)} whispers: ${messageText}`, getColourByType("whisperMessage")); } // =========================================================================== function messagePlayerMegaPhone(client, shoutingClient, messageText) { - messagePlayerNormal(client, `📢 ${getPlayerAccentInlineOutput(shoutingClient)}${getClientSubAccountName(shoutingClient)} (megaphone): ${messageText}!`, getColourByType("yellow")); + messagePlayerNormal(client, `📢 ${getPlayerAccentInlineOutput(shoutingClient)}${getClientSubAccountName(shoutingClient)} (megaphone): ${messageText}!`, getColourByType("yellow")); } // =========================================================================== function messagePlayerShout(client, shoutingClient, messageText) { - messagePlayerNormal(client, `🗣️ ${getPlayerAccentInlineOutput(shoutingClient)}${getClientSubAccountName(shoutingClient)} shouts: ${messageText}!`, getColourByType("shoutMessage")); + messagePlayerNormal(client, `🗣️ ${getPlayerAccentInlineOutput(shoutingClient)}${getClientSubAccountName(shoutingClient)} shouts: ${messageText}!`, getColourByType("shoutMessage")); } // =========================================================================== function messagePlayerDoAction(client, doingActionClient, messageText) { - if(!isClientFromDiscord(client)) { - messagePlayerNormal(client, `${messageText} * (${getClientSubAccountName(doingActionClient)})`, getColourByType("doActionMessage")); - } + if(!isClientFromDiscord(client)) { + messagePlayerNormal(client, `${messageText} * (${getClientSubAccountName(doingActionClient)})`, getColourByType("doActionMessage")); + } } // =========================================================================== function messagePlayerMeAction(client, doingActionClient, messageText) { - messagePlayerNormal(client, `${getClientSubAccountName(doingActionClient)} ${messageText}`, getColourByType("meActionMessage")); + messagePlayerNormal(client, `${getClientSubAccountName(doingActionClient)} ${messageText}`, getColourByType("meActionMessage")); } // =========================================================================== function messagePlayerClanChat(client, clanChattingClient, messageText) { - messagePlayerNormal(client, `👥 ${getInlineChatColourByName("clanOrange")}${(getPlayerClanRankName(clanChattingClient) != false) ? getPlayerClanRankName(clanChattingClient) : "No Rank"} ${getCharacterFullName(clanChattingClient)} {MAINCOLOUR}says (clan): {ALTCOLOUR}${messageText}`, getColourByType("clanChatMessage")); + messagePlayerNormal(client, `👥 ${getInlineChatColourByName("clanOrange")}${(getPlayerClanRankName(clanChattingClient) != false) ? getPlayerClanRankName(clanChattingClient) : "No Rank"} ${getCharacterFullName(clanChattingClient)} {MAINCOLOUR}says (clan): {ALTCOLOUR}${messageText}`, getColourByType("clanChatMessage")); } // =========================================================================== function messagePlayerAdminChat(client, adminChattingClient, messageText) { - messagePlayerNormal(client, `🛡️ [ADMIN CHAT] {ALTCOLOUR}${getPlayerData(adminChattingClient).accountData.staffTitle} [#CCCCCC]${getPlayerData(adminChattingClient).accountData.name}: {MAINCOLOUR}${messageText}`, getColourByType("orange")); + messagePlayerNormal(client, `🛡️ [ADMIN CHAT] {ALTCOLOUR}${getPlayerData(adminChattingClient).accountData.staffTitle} [#CCCCCC]${getPlayerData(adminChattingClient).accountData.name}: {MAINCOLOUR}${messageText}`, getColourByType("orange")); } // =========================================================================== function messagePlayerNewbieTip(client, message) { - if(!hasBitFlag(getPlayerData(client).accountData.settings, getAccountSettingsFlagValue("NoActionTips"))) { - messagePlayerNormal(client, `💡 ${message}`); - } + if(!hasBitFlag(getPlayerData(client).accountData.settings, getAccountSettingsFlagValue("NoActionTips"))) { + messagePlayerNormal(client, `💡 ${message}`); + } } // =========================================================================== function messagePlayerTimedRandomTip(client, message) { - if(isPlayerLoggedIn(client) && isPlayerSpawned(client)) { - if(!hasBitFlag(getPlayerData(client).accountData.settings, getAccountSettingsFlagValue("NoRandomTips"))) { - messagePlayerNormal(client, `💡 ${message}`); - } - } + if(isPlayerLoggedIn(client) && isPlayerSpawned(client)) { + if(!hasBitFlag(getPlayerData(client).accountData.settings, getAccountSettingsFlagValue("NoRandomTips"))) { + messagePlayerNormal(client, `💡 ${message}`); + } + } } // =========================================================================== @@ -245,7 +245,7 @@ function clearChatBox(client) { // =========================================================================== function messagePlayerHelpContent(client, messageString) { - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}${messageString}`); + messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}${messageString}`); } // =========================================================================== diff --git a/scripts/server/misc.js b/scripts/server/misc.js index 1f342c26..cb25eebf 100644 --- a/scripts/server/misc.js +++ b/scripts/server/misc.js @@ -47,7 +47,7 @@ function setNewCharacterSpawnPositionCommand(command, params, client) { getServerConfig().newCharacter.spawnHeading = client.player.heading; getServerConfig().needsSaved = true; - messagePlayerNormal(client, `The new character spawn position has been set to ${position.x.toFixed(2)}, ${position.y.toFixed(2)}, ${position.z.toFixed(2)}`) + messagePlayerNormal(client, `The new character spawn position has been set to ${position.x.toFixed(2)}, ${position.y.toFixed(2)}, ${position.z.toFixed(2)}`) return true; } @@ -64,7 +64,7 @@ let amount = toInteger(getParam(params, " ", 1)) || 1000; getServerConfig().newCharacter.cash = amount; getServerConfig().needsSaved = true; - messagePlayerNormal(client, `The new character money has been set to $${amount}`); + messagePlayerNormal(client, `The new character money has been set to $${amount}`); return true; } @@ -81,7 +81,7 @@ function setNewCharacterSkinCommand(command, params, client) { getServerConfig().newCharacter.skin = skinId; getServerConfig().needsSaved = true; - messagePlayerNormal(client, `The new character skin has been set to ${getSkinNameFromModel(skinId)} (Index ${skinId})`); + messagePlayerNormal(client, `The new character skin has been set to ${getSkinNameFromModel(skinId)} (Index ${skinId})`); return true; } @@ -95,7 +95,7 @@ function submitIdeaCommand(command, params, client) { submitIdea(client, params); - messagePlayerNormal(client, `Your suggestion/idea has been sent to the developers!`); + messagePlayerNormal(client, `Your suggestion/idea has been sent to the developers!`); return true; } @@ -109,7 +109,7 @@ function submitBugReportCommand(command, params, client) { submitBugReport(client, params); - messagePlayerNormal(client, `Your bug report has been sent to the developers!`); + messagePlayerNormal(client, `Your bug report has been sent to the developers!`); return true; } @@ -127,47 +127,47 @@ function enterExitPropertyCommand(command, params, client) { let ownerType = getEntityData(getPlayerData(client).currentPickup, "vrr.owner.type"); let ownerId = getEntityData(getPlayerData(client).currentPickup, "vrr.owner.id"); - + switch(ownerType) { case VRR_PICKUP_BUSINESS_ENTRANCE: isBusiness = true; isEntrance = true; closestProperty = getServerData().businesses[ownerId]; break; - + case VRR_PICKUP_BUSINESS_EXIT: isBusiness = true; isEntrance = false; closestProperty = getServerData().businesses[ownerId]; break; - + case VRR_PICKUP_HOUSE_ENTRANCE: isBusiness = false; isEntrance = true; closestProperty = getServerData().houses[ownerId]; break; - + case VRR_PICKUP_HOUSE_EXIT: isBusiness = false; isEntrance = false; closestProperty = getServerData().houses[ownerId]; break; - + default: return false; - } + } } else { for(let i in getServerData().businesses) { if(getPlayerDimension(client) == getGameConfig().mainWorldDimension[getGame()] && getPlayerInterior(client) == getGameConfig().mainWorldInterior[getGame()]) { let businessId = getClosestBusinessEntrance(getPlayerPosition(client), getPlayerDimension(client)); isBusiness = true; isEntrance = true; - closestProperty = getServerData().businesses[businessId]; + closestProperty = getServerData().businesses[businessId]; } else { let businessId = getClosestBusinessExit(getPlayerPosition(client), getPlayerDimension(client)); isBusiness = true; isEntrance = false; - closestProperty = getServerData().businesses[businessId]; + closestProperty = getServerData().businesses[businessId]; } } @@ -176,12 +176,12 @@ function enterExitPropertyCommand(command, params, client) { let houseId = getClosestHouseEntrance(getPlayerPosition(client), getPlayerDimension(client)); isBusiness = false; isEntrance = true; - closestProperty = getServerData().businesses[houseId]; + closestProperty = getServerData().businesses[houseId]; } else { let houseId = getClosestHouseExit(getPlayerPosition(client), getPlayerDimension(client)); isBusiness = false; isEntrance = false; - closestProperty = getServerData().businesses[houseId]; + closestProperty = getServerData().businesses[houseId]; } } } @@ -213,6 +213,7 @@ function enterExitPropertyCommand(command, params, client) { } setTimeout(function() { + setPlayerInCutsceneInterior(client, closestProperty.exitCutscene); setPlayerPosition(client, closestProperty.exitPosition); setPlayerHeading(client, closestProperty.exitRotation); setPlayerDimension(client, closestProperty.exitDimension); @@ -221,7 +222,6 @@ function enterExitPropertyCommand(command, params, client) { if(isFadeCameraSupported()) { fadeCamera(client, true, 1.0); } - setPlayerInCutsceneInterior(client, closestProperty.exitCutscene); updateInteriorLightsForPlayer(client, closestProperty.interiorLights); }, 1000); //setPlayerInCutsceneInterior(client, closestProperty.exitCutscene); @@ -251,6 +251,7 @@ function enterExitPropertyCommand(command, params, client) { disableCityAmbienceForPlayer(client, true); setTimeout(function() { + setPlayerInCutsceneInterior(client, closestProperty.entranceCutscene); setPlayerPosition(client, closestProperty.entrancePosition); setPlayerHeading(client, closestProperty.entranceRotation); setPlayerDimension(client, closestProperty.entranceDimension); @@ -259,14 +260,14 @@ function enterExitPropertyCommand(command, params, client) { if(isFadeCameraSupported()) { fadeCamera(client, true, 1.0); } - setPlayerInCutsceneInterior(client, closestProperty.entranceCutscene); + updateInteriorLightsForPlayer(client, true); }, 1000); }, 1100); //setPlayerInCutsceneInterior(client, closestProperty.entranceCutscene); stopRadioStreamForPlayer(client); getPlayerData(client).streamingRadioStation = -1; - + //logToConsole(LOG_DEBUG, `[VRR.Misc] ${getPlayerDisplayForConsole(client)} exited business ${inBusiness.name}[${inBusiness.index}/${inBusiness.databaseId}]`); return true; } @@ -306,7 +307,6 @@ function getPlayerInfoCommand(command, params, client) { `{MAINCOLOUR}Skin: {ALTCOLOUR}${getSkinNameFromModel(getPlayerCurrentSubAccount(targetClient).skin)}[${getPlayerCurrentSubAccount(targetClient).skin}]`, `{MAINCOLOUR}Clan: {ALTCOLOUR}${clan}`, `{MAINCOLOUR}Job: {ALTCOLOUR}${job}`, - ] let chunkedList = splitArrayIntoChunks(stats, 6); @@ -318,7 +318,7 @@ function getPlayerInfoCommand(command, params, client) { // =========================================================================== function playerChangeAFKState(client, afkState) { - getPlayerData(client).afk = afkState; + getPlayerData(client).afk = afkState; updateAllPlayerNameTags(); } @@ -480,15 +480,15 @@ function gpsCommand(command, params, client) { default: { let itemTypeId = getItemTypeFromParams(params); if(getItemTypeData(itemTypeId) != false) { - locationType = VRR_GPS_TYPE_BUSINESS; - blipColour = "businessBlue"; + locationType = VRR_GPS_TYPE_BUSINESS; + blipColour = "businessBlue"; useType = getItemTypeData(itemTypeId).useType; } else { - let gameLocationId = getGameLocationFromParams(params); - if(gameLocationId != false) { - position = getGameConfig().locations[getServerGame()][gameLocationId][1] - } - } + let gameLocationId = getGameLocationFromParams(params); + if(gameLocationId != false) { + position = getGameConfig().locations[getServerGame()][gameLocationId][1] + } + } } } @@ -509,87 +509,98 @@ function gpsCommand(command, params, client) { return false; } - hideAllBlipsForPlayerGPS(client); + hideAllBlipsForPlayerGPS(client); blinkGenericGPSBlipForPlayer(client, getBusinessData(businessId).entrancePosition, getBusinessData(businessId).entranceBlipModel, getColourByType(blipColour), 10); - messagePlayerSuccess(client, "Look for the blinking icon on your mini map"); + messagePlayerSuccess(client, "Look for the blinking icon on your mini map"); } - if(locationType == VRR_GPS_TYPE_GAMELOC) { - hideAllBlipsForPlayerGPS(client); - blinkGenericGPSBlipForPlayer(client, position, 0, getColourByType(blipColour), 10); - messagePlayerSuccess(client, "Look for the blinking icon on your mini map"); - return true; - } + if(locationType == VRR_GPS_TYPE_GAMELOC) { + hideAllBlipsForPlayerGPS(client); + blinkGenericGPSBlipForPlayer(client, position, 0, getColourByType(blipColour), 10); + messagePlayerSuccess(client, "Look for the blinking icon on your mini map"); + return true; + } } // =========================================================================== function stuckPlayerCommand(command, params, client) { - if((getCurrentUnixTimestamp()-getPlayerData(client).lastStuckCommand) < getGlobalConfig().stuckCommandInterval) { - messagePlayerError(client, "CantUseCommandYet"); - return false; - } + if((getCurrentUnixTimestamp()-getPlayerData(client).lastStuckCommand) < getGlobalConfig().stuckCommandInterval) { + messagePlayerError(client, "CantUseCommandYet"); + return false; + } - let dimension = getPlayerDimension(client); - let interior = getPlayerInterior(client); + let dimension = getPlayerDimension(client); + let interior = getPlayerInterior(client); - messagePlayerAlert(client, getLocaleString(client, "FixingStuck")); + messagePlayerAlert(client, getLocaleString(client, "FixingStuck")); - if(getGameConfig().skinChangePosition[getServerGame()].length > 0) { - if(getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == VRR_RETURNTO_TYPE_SKINSELECT) { - messagePlayerAlert(client, "You canceled the skin change."); - restorePlayerCamera(client); + if(getGameConfig().skinChangePosition[getServerGame()].length > 0) { + if(getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == VRR_RETURNTO_TYPE_SKINSELECT) { + messagePlayerAlert(client, "You canceled the skin change."); + restorePlayerCamera(client); - setPlayerPosition(client, getPlayerData(client).returnToPosition); - setPlayerHeading(client, getPlayerData(client).returnToHeading); - setPlayerInterior(client, getPlayerData(client).returnToInterior); - setPlayerDimension(client, getPlayerData(client).returnToDimension); + setPlayerPosition(client, getPlayerData(client).returnToPosition); + setPlayerHeading(client, getPlayerData(client).returnToHeading); + setPlayerInterior(client, getPlayerData(client).returnToInterior); + setPlayerDimension(client, getPlayerData(client).returnToDimension); - getPlayerData(client).returnToPosition = null; - getPlayerData(client).returnToHeading = null; - getPlayerData(client).returnToInterior = null; - getPlayerData(client).returnToDimension = null; + getPlayerData(client).returnToPosition = null; + getPlayerData(client).returnToHeading = null; + getPlayerData(client).returnToInterior = null; + getPlayerData(client).returnToDimension = null; - getPlayerData(client).returnToType = VRR_RETURNTO_TYPE_NONE; - } - } + getPlayerData(client).returnToType = VRR_RETURNTO_TYPE_NONE; + } + } - //if(getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == VRR_RETURNTO_TYPE_ADMINGET) { - // messagePlayerError(client, `You were teleported by an admin and can't use the stuck command`); - // return false; - //} + //if(getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == VRR_RETURNTO_TYPE_ADMINGET) { + // messagePlayerError(client, `You were teleported by an admin and can't use the stuck command`); + // return false; + //} - if(dimension > 0) { - let businesses = getServerData().businesses; - for(let i in businesses) { - if(businesses[i].exitDimension == dimension) { - setPlayerPosition(client, businesses[i].entrancePosition); - setPlayerDimension(client, businesses[i].entranceDimension); - setPlayerInterior(client, businesses[i].entranceInterior); + if(dimension > 0) { + let businesses = getServerData().businesses; + for(let i in businesses) { + if(businesses[i].exitDimension == dimension) { + setPlayerPosition(client, businesses[i].entrancePosition); + setPlayerDimension(client, businesses[i].entranceDimension); + setPlayerInterior(client, businesses[i].entranceInterior); - return true; - } - } + return true; + } + } - let houses = getServerData().houses; - for(let i in houses) { - if(houses[i].exitDimension == dimension) { - setPlayerPosition(client, houses[i].entrancePosition); - setPlayerDimension(client, houses[i].entranceDimension); - setPlayerInterior(client, houses[i].entranceInterior); + let houses = getServerData().houses; + for(let i in houses) { + if(houses[i].exitDimension == dimension) { + setPlayerPosition(client, houses[i].entrancePosition); + setPlayerDimension(client, houses[i].entranceDimension); + setPlayerInterior(client, houses[i].entranceInterior); - return true; - } - } - } else { - setPlayerDimension(client, 1); - setPlayerDimension(client, getGameConfig().mainWorldDimension[getGame()]); - setPlayerInterior(client, getGameConfig().mainWorldInterior[getGame()]); - setPlayerPosition(client, getPosAbovePos(getPlayerPosition(client), 2.0)); - } + return true; + } + } + } else { + setPlayerDimension(client, 1); + setPlayerDimension(client, getGameConfig().mainWorldDimension[getGame()]); + setPlayerInterior(client, getGameConfig().mainWorldInterior[getGame()]); + setPlayerPosition(client, getPosAbovePos(getPlayerPosition(client), 2.0)); + } - setPlayerInterior(client, 0); - setPlayerDimension(client, 0); + setPlayerInterior(client, 0); + setPlayerDimension(client, 0); +} + +// =========================================================================== + +function playerPedSpeakCommand(command, params, client) { + if(areParamsEmpty(params)) { + messagePlayerSyntax(client, getCommandSyntaxText(command)); + return false; + } + + makePlayerPedSpeak(client, params); } // =========================================================================== \ No newline at end of file diff --git a/scripts/server/npc.js b/scripts/server/npc.js index 4110b24a..43e7327c 100644 --- a/scripts/server/npc.js +++ b/scripts/server/npc.js @@ -24,7 +24,7 @@ function getNPCData(ped) { if(ped.getData("vrr.dataIndex")) { return ped.getData("vrr.dataIndex"); } - return false; + return false; } // =========================================================================== @@ -44,7 +44,7 @@ function createNPCCommand(client, command, params) { let position = getPosInFrontOfPos(getPlayerPosition(client), getPlayerHeading(client), 3); - let tempNPCData = new NPCData(false); + let tempNPCData = new NPCData(false); tempNPCData.position = position; tempNPCData.heading = getPlayerHeading(client); tempNPCData.skin = skinId; diff --git a/scripts/server/npc/taxi.js b/scripts/server/npc/taxi.js index 2c149011..df95c91d 100644 --- a/scripts/server/npc/taxi.js +++ b/scripts/server/npc/taxi.js @@ -8,21 +8,21 @@ // =========================================================================== function attemptToSignalToNearbyTaxi(client) { - if(!isPlayerLoggedIn(client)) { - return false; - } + if(!isPlayerLoggedIn(client)) { + return false; + } - if(!isPlayerSpawned(client)) { - return false; - } + if(!isPlayerSpawned(client)) { + return false; + } - let nearbyTaxis = getElementsByType(ELEMENT_VEHICLE).filter((v) > getPlayerPosition(client).distance(v.position) <= 15 && isTaxiVehicle(v)); + let nearbyTaxis = getElementsByType(ELEMENT_VEHICLE).filter((v) > getPlayerPosition(client).distance(v.position) <= 15 && isTaxiVehicle(v)); - let closestTaxi = nearbyTaxis.reduce((i, j) => (i.position.distance(pos) < j.position.distance(pos)) ? i : j); - if(!closestTaxi.getOccupant(0).isType(ELEMENT_PLAYER)) { - setVehicleCruiseSpeed(closestTaxi, 0.0); - setVehicleLockedState(closestTaxi, false); - } + let closestTaxi = nearbyTaxis.reduce((i, j) => (i.position.distance(pos) < j.position.distance(pos)) ? i : j); + if(!closestTaxi.getOccupant(0).isType(ELEMENT_PLAYER)) { + setVehicleCruiseSpeed(closestTaxi, 0.0); + setVehicleLocked(closestTaxi, false); + } } // =========================================================================== \ No newline at end of file diff --git a/scripts/server/radio.js b/scripts/server/radio.js index cb5899b3..3a3ca7a4 100644 --- a/scripts/server/radio.js +++ b/scripts/server/radio.js @@ -9,7 +9,7 @@ function initRadioScript() { logToConsole(LOG_INFO, "[VRR.Radio]: Initializing radio script ..."); - getServerData().radioStations = loadRadioStationsFromDatabase(); + getServerData().radioStations = loadRadioStationsFromDatabase(); setRadioStationIndexes(); logToConsole(LOG_INFO, "[VRR.Radio]: Radio script initialized successfully!"); return true; diff --git a/scripts/server/staff.js b/scripts/server/staff.js index e0946934..9cef4a76 100644 --- a/scripts/server/staff.js +++ b/scripts/server/staff.js @@ -20,11 +20,11 @@ function kickClientCommand(command, params, client) { return false; } - let targetClient = getPlayerFromParams(params); - if(!targetClient) { - messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); - return false; - } + let targetClient = getPlayerFromParams(params); + if(!targetClient) { + messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); + return false; + } // Prevent kicking admins with really high permissions if(doesPlayerHaveStaffPermission(targetClient, getStaffFlagValue("ManageServer")) || doesPlayerHaveStaffPermission(targetClient, getStaffFlagValue("Developer"))) { @@ -50,9 +50,9 @@ function setStaffTitleCommand(command, params, client) { let targetClient = getPlayerFromParams(getParam(params, " ", 1)); let staffTitle = splitParams.slice(1).join(" "); - if(!targetClient) { - messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); - return false; + if(!targetClient) { + messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); + return false; } // Prevent setting titles on staff with really high permissions @@ -77,11 +77,11 @@ function muteClientCommand(command, params, client) { return false; } - let targetClient = getPlayerFromParams(params); - if(!targetClient) { - messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); - return false; - } + let targetClient = getPlayerFromParams(params); + if(!targetClient) { + messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); + return false; + } // Prevent muting admins with really high permissions if(doesPlayerHaveStaffPermission(targetClient, getStaffFlagValue("ManageServer")) || doesPlayerHaveStaffPermission(targetClient, getStaffFlagValue("Developer"))) { @@ -104,14 +104,14 @@ function unMuteClientCommand(command, params, client) { return false; } - let targetClient = getPlayerFromParams(params); - if(!targetClient) { - messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); - return false; - } + let targetClient = getPlayerFromParams(params); + if(!targetClient) { + messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); + return false; + } // Prevent unmuting admins with really high permissions - if(doesPlayerHaveStaffPermission(targetClient, getStaffFlagValue("ManageServer")) || doesPlayerHaveStaffPermission(targetClient, getStaffFlagValue("Developer"))) { + if(doesPlayerHaveStaffPermission(targetClient, getStaffFlagValue("ManageServer")) || doesPlayerHaveStaffPermission(targetClient, getStaffFlagValue("Developer"))) { if(!doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageServer")) && !doesPlayerHaveStaffPermission(client, getStaffFlagValue("Developer"))) { messagePlayerError(client, "You cannot unmute this person!"); return false; @@ -130,14 +130,14 @@ function freezeClientCommand(command, params, client) { return false; } - let targetClient = getPlayerFromParams(params); - if(!targetClient) { - messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); - return false; - } + let targetClient = getPlayerFromParams(params); + if(!targetClient) { + messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); + return false; + } // Prevent freeze admins with really high permissions - if(doesPlayerHaveStaffPermission(targetClient, getStaffFlagValue("ManageServer")) || doesPlayerHaveStaffPermission(targetClient, getStaffFlagValue("Developer"))) { + if(doesPlayerHaveStaffPermission(targetClient, getStaffFlagValue("ManageServer")) || doesPlayerHaveStaffPermission(targetClient, getStaffFlagValue("Developer"))) { if(!doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageServer")) && !doesPlayerHaveStaffPermission(client, getStaffFlagValue("Developer"))) { messagePlayerError(client, "You cannot freeze this person!"); return false; @@ -157,14 +157,14 @@ function unFreezeClientCommand(command, params, client) { return false; } - let targetClient = getPlayerFromParams(params); - if(!targetClient) { - messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); - return false; - } + let targetClient = getPlayerFromParams(params); + if(!targetClient) { + messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); + return false; + } // Prevent unfreezing admins with really high permissions - if(doesPlayerHaveStaffPermission(targetClient, getStaffFlagValue("ManageServer")) || doesPlayerHaveStaffPermission(targetClient, getStaffFlagValue("Developer"))) { + if(doesPlayerHaveStaffPermission(targetClient, getStaffFlagValue("ManageServer")) || doesPlayerHaveStaffPermission(targetClient, getStaffFlagValue("Developer"))) { if(!doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageServer")) && !doesPlayerHaveStaffPermission(client, getStaffFlagValue("Developer"))) { messagePlayerError(client, "You cannot freeze this person!"); return false; @@ -184,11 +184,11 @@ function gotoPlayerCommand(command, params, client) { return false; } - let targetClient = getPlayerFromParams(params); - if(!targetClient) { - messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); - return false; - } + let targetClient = getPlayerFromParams(params); + if(!targetClient) { + messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); + return false; + } setPlayerVelocity(client, toVector3(0.0, 0.0, 0.0)); setPlayerPosition(client, getPosBehindPos(getPlayerPosition(targetClient), getPlayerHeading(targetClient), 2)); @@ -216,11 +216,11 @@ function getPlayerGeoIPInformationCommand(command, params, client) { return false; } - let targetClient = getPlayerFromParams(params); - if(!targetClient) { - messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); - return false; - } + let targetClient = getPlayerFromParams(params); + if(!targetClient) { + messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); + return false; + } let countryName = module.geoip.getCountryName(getGlobalConfig().geoIPCountryDatabaseFilePath, targetClient.ip); let subDivisionName = module.geoip.getSubdivisionName(getGlobalConfig().geoIPCityDatabaseFilePath, targetClient.ip); @@ -237,11 +237,11 @@ function getPlayerIPInformationCommand(command, params, client) { return false; } - let targetClient = getPlayerFromParams(params); - if(!targetClient) { - messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); - return false; - } + let targetClient = getPlayerFromParams(params); + if(!targetClient) { + messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); + return false; + } messagePlayerInfo(client, `{ALTCOLOUR}${targetClient.name}'s{MAINCOLOUR} IP is ${targetClient.ip}`); } @@ -633,10 +633,10 @@ function getPlayerCommand(command, params, client) { return false; } - let targetClient = getPlayerFromParams(params); - if(!targetClient) { - messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); - return false; + let targetClient = getPlayerFromParams(params); + if(!targetClient) { + messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); + return false; } removePlayerFromVehicle(targetClient); @@ -673,17 +673,17 @@ function returnPlayerCommand(command, params, client) { return false; } - let targetClient = getPlayerFromParams(params); - if(!targetClient) { - messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); - return false; + let targetClient = getPlayerFromParams(params); + if(!targetClient) { + messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); + return false; } removePlayerFromVehicle(targetClient); if(getPlayerData(targetClient).returnToPosition == null) { - messagePlayerError(client, "There is nowhere to return that player to!"); - return false; + messagePlayerError(client, "There is nowhere to return that player to!"); + return false; } setPlayerPosition(targetClient, getPlayerData(targetClient).returnToPosition); @@ -714,18 +714,18 @@ function addStaffFlagCommand(command, params, client) { let targetClient = getPlayerFromParams(getParam(params, " ", 1)); let flagName = getParam(params, " ", 2) || "None"; - if(!targetClient) { - messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); - return false; - } + if(!targetClient) { + messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); + return false; + } if(getStaffFlagValue(flagName) == false) { messagePlayerError(client, getLocaleString(client, "InvalidStaffFlag")); - return false; + return false; } // Prevent setting flags on admins with really high permissions - if(doesPlayerHaveStaffPermission(targetClient, getStaffFlagValue("ManageServer")) || doesPlayerHaveStaffPermission(targetClient, getStaffFlagValue("Developer"))) { + if(doesPlayerHaveStaffPermission(targetClient, getStaffFlagValue("ManageServer")) || doesPlayerHaveStaffPermission(targetClient, getStaffFlagValue("Developer"))) { if(!doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageServer")) && !doesPlayerHaveStaffPermission(client, getStaffFlagValue("Developer"))) { messagePlayerError(client, "You cannot give staff flags to this person!"); return false; @@ -747,18 +747,18 @@ function takeStaffFlagCommand(command, params, client) { let targetClient = getPlayerFromParams(getParam(params, " ", 1)); let flagName = getParam(params, " ", 2) || "None"; - if(!targetClient) { - messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); - return false; - } + if(!targetClient) { + messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); + return false; + } if(getStaffFlagValue(flagName) == false) { messagePlayerError(client, "That staff flag doesn't exist!"); - return false; + return false; } // Prevent setting flags on admins with really high permissions - if(doesPlayerHaveStaffPermission(targetClient, getStaffFlagValue("ManageServer")) || doesPlayerHaveStaffPermission(targetClient, getStaffFlagValue("Developer"))) { + if(doesPlayerHaveStaffPermission(targetClient, getStaffFlagValue("ManageServer")) || doesPlayerHaveStaffPermission(targetClient, getStaffFlagValue("Developer"))) { if(!doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageServer")) && !doesPlayerHaveStaffPermission(client, getStaffFlagValue("Developer"))) { messagePlayerError(client, "You cannot take staff flags from this person!"); return false; @@ -779,10 +779,10 @@ function clearStaffFlagsCommand(command, params, client) { let targetClient = getPlayerFromParams(getParam(params, " ", 1)); - if(!targetClient) { - messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); - return false; - } + if(!targetClient) { + messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); + return false; + } // Prevent setting flags on admins with really high permissions if(doesPlayerHaveStaffPermission(targetClient, getStaffFlagValue("ManageServer")) || doesPlayerHaveStaffPermission(targetClient, getStaffFlagValue("Developer"))) { @@ -818,9 +818,9 @@ function getStaffFlagsCommand(command, params, client) { let targetClient = getPlayerFromParams(getParam(params, " ", 1)); - if(!targetClient) { - messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); - return false; + if(!targetClient) { + messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); + return false; } let tempStaffFlags = []; @@ -861,9 +861,9 @@ function allStaffFlagsCommand(command, params, client) { let targetClient = getPlayerFromParams(getParam(params, " ", 1)); let flagName = getParam(params, " ", 2) || "None"; - if(!targetClient) { - messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); - return false; + if(!targetClient) { + messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); + return false; } let chunkedList = splitArrayIntoChunks(getServerBitFlagKeys().staffFlagKeys, 8); @@ -885,9 +885,9 @@ function givePlayerMoneyCommand(command, params, client) { let targetClient = getPlayerFromParams(getParam(params, " ", 1)); let amount = toInteger(getParam(params, " ", 2)); - if(!targetClient) { - messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); - return false; + if(!targetClient) { + messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); + return false; } givePlayerCash(targetClient, toInteger(amount)); @@ -908,9 +908,9 @@ function forcePlayerAccentCommand(command, params, client) { let targetClient = getPlayerFromParams(getParam(params, " ", 1)); let newAccent = getParam(params, " ", 2) || "None"; - if(!targetClient) { - messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); - return false; + if(!targetClient) { + messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); + return false; } if(toLowerCase(newAccent) == "None") { @@ -940,9 +940,9 @@ function forceCharacterNameChangeCommand(command, params, client) { let targetClient = getPlayerFromParams(getParam(params, " ", 1)); - if(!targetClient) { - messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); - return false; + if(!targetClient) { + messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); + return false; } getPlayerData(targetClient).changingCharacterName = true; @@ -968,9 +968,9 @@ function forceCharacterNameCommand(command, params, client) { let firstName = getParam(params, " ", 2); let lastName = getParam(params, " ", 3); - if(!targetClient) { - messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); - return false; + if(!targetClient) { + messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); + return false; } firstName = fixCharacterName(firstName); @@ -1003,14 +1003,14 @@ function forcePlayerSkinCommand(command, params, client) { let targetClient = getPlayerFromParams(splitParams[0]); let skinIndex = getSkinModelIndexFromParams(splitParams.slice(1).join(" "), getGame()); - if(!targetClient) { - messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); - return false; + if(!targetClient) { + messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); + return false; } if(!skinIndex) { - messagePlayerError(client, getLocaleString(client, "InvalidSkin")); - return false; + messagePlayerError(client, getLocaleString(client, "InvalidSkin")); + return false; } getPlayerCurrentSubAccount(targetClient).skin = skinIndex; @@ -1036,9 +1036,9 @@ function setPlayerHealthCommand(command, params, client) { let targetClient = getParam(params, " ", 1); let health = getParam(params, " ", 2); - if(!targetClient) { - messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); - return false; + if(!targetClient) { + messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); + return false; } setPlayerHealth(targetClient, health); @@ -1054,12 +1054,12 @@ function setPlayerArmourCommand(command, params, client) { return false; } - let targetClient = getParam(params, " ", 1); + let targetClient = getParam(params, " ", 1); let armour = getParam(params, " ", 2); - if(!targetClient) { - messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); - return false; + if(!targetClient) { + messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); + return false; } setPlayerArmour(targetClient, armour); @@ -1075,20 +1075,20 @@ function setPlayerInfiniteRunCommand(command, params, client) { return false; } - let targetClient = getParam(params, " ", 1); + let targetClient = getParam(params, " ", 1); let state = getParam(params, " ", 2) || 0; - if(!targetClient) { - messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); - return false; + if(!targetClient) { + messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); + return false; } - if(isNaN(state)) { - messagePlayerError(client, `The infinite run state must be a number!`); - return false; - } + if(isNaN(state)) { + messagePlayerError(client, `The infinite run state must be a number!`); + return false; + } - state = toInteger(state); + state = toInteger(state); setPlayerInfiniteRun(targetClient, intToBool(state)); messageAdmins(`${getPlayerName(client)}{MAINCOLOUR} ${getBoolRedGreenInlineColour(state)}${(state) ? "enabled" : "disabled"}{MAINCOLOUR} infinite run for {ALTCOLOUR}${getPlayerName(targetClient)}`); @@ -1105,9 +1105,9 @@ function forcePlayerWantedLevelCommand(command, params, client) { let targetClient = getPlayerFromParams(getParam(params, " ", 1)); let wantedLevel = getParam(params, " ", 2); - if(!targetClient) { - messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); - return false; + if(!targetClient) { + messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); + return false; } forcePlayerWantedLevel(targetClient, wantedLevel); @@ -1125,9 +1125,9 @@ function getAllVehiclesOwnedByPlayerCommand(command, params, client) { let targetClient = getPlayerFromParams(params); - if(!targetClient) { - messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); - return false; + if(!targetClient) { + messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); + return false; } let vehicles = getAllVehiclesOwnedByPlayer(targetClient); @@ -1148,9 +1148,9 @@ function getAllBusinessesOwnedByPlayerCommand(command, params, client) { let targetClient = getPlayerFromParams(params); - if(!targetClient) { - messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); - return false; + if(!targetClient) { + messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); + return false; } let businesses = getAllBusinessesOwnedByPlayer(targetClient); @@ -1171,9 +1171,9 @@ function getAllHousesOwnedByPlayerCommand(command, params, client) { let targetClient = getPlayerFromParams(params); - if(!targetClient) { - messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); - return false; + if(!targetClient) { + messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); + return false; } let houses = getAllHousesOwnedByPlayer(targetClient); @@ -1194,9 +1194,9 @@ function forceAccountPasswordResetCommand(command, params, client) { let targetClient = getPlayerFromParams(params); - if(!targetClient) { - messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); - return false; + if(!targetClient) { + messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); + return false; } } @@ -1210,9 +1210,9 @@ function toggleSyncForElementsSpawnedByPlayer(command, params, client) { let targetClient = getPlayerFromParams(params); - if(!targetClient) { - messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); - return false; + if(!targetClient) { + messagePlayerError(client, getLocaleString(client, "InvalidPlayer")); + return false; } if(!hasBitFlag(getPlayerData(client).accountData.flags.moderation, getModerationFlagValue("DontSyncClientElements"))) { diff --git a/scripts/server/subaccount.js b/scripts/server/subaccount.js index 6f6ebfba..aff83af5 100644 --- a/scripts/server/subaccount.js +++ b/scripts/server/subaccount.js @@ -185,7 +185,7 @@ function saveSubAccountToDatabase(subAccountData) { freeDatabaseQuery(dbQuery); disconnectFromDatabase(dbConnection); - } + } } // =========================================================================== diff --git a/scripts/server/timers.js b/scripts/server/timers.js index d3fb0f68..3cfbb0c7 100644 --- a/scripts/server/timers.js +++ b/scripts/server/timers.js @@ -251,18 +251,18 @@ function showRandomTipToAllPlayers() { function checkInactiveVehicleRespawns() { let vehicles = getElementsByType(ELEMENT_VEHICLE); for(let i in vehicles) { - if(getVehicleData(vehicles[i] != false)) { - if(isVehicleUnoccupied(vehicles[i])) { - if(getVehicleData(vehicles[i]).lastActiveTime != false) { - if(getCurrentUnixTimestamp() - getVehicleData(vehicles[i]).lastActiveTime >= getGlobalConfig().vehicleInactiveRespawnDelay) { - respawnVehicle(vehicles[i]); - getVehicleData(vehicles[i]).lastActiveTime = false; - } - } - } else { - getVehicleData(vehicles[i]).lastActiveTime = getCurrentUnixTimestamp(); - } - } + if(getVehicleData(vehicles[i] != false)) { + if(isVehicleUnoccupied(vehicles[i])) { + if(getVehicleData(vehicles[i]).lastActiveTime != false) { + if(getCurrentUnixTimestamp() - getVehicleData(vehicles[i]).lastActiveTime >= getGlobalConfig().vehicleInactiveRespawnDelay) { + respawnVehicle(vehicles[i]); + getVehicleData(vehicles[i]).lastActiveTime = false; + } + } + } else { + getVehicleData(vehicles[i]).lastActiveTime = getCurrentUnixTimestamp(); + } + } } } diff --git a/scripts/server/trigger.js b/scripts/server/trigger.js index 4662d408..d6c24653 100644 --- a/scripts/server/trigger.js +++ b/scripts/server/trigger.js @@ -8,44 +8,44 @@ // =========================================================================== const triggerTypes = [ - "onBusinessOwnerChange", - "onBusinessNameChange", - "onBusinessLockChange", - "onBusinessPlayerEnter", - "onBusinessPlayerExit", - "onBusinessBotEnter", - "onBusinessBotExit", - "onBusinessDamage", - "onBusinessRobbed", - "onBusinessPlayerPurchase", - "onBusinessBotPurchase", - "onHouseOwnerChange", - "onHouseNameChange", - "onHouseLockChange", - "onHousePlayerEnter", - "onHousePlayerExit", - "onHouseBotEnter", - "onHouseBotExit", - "onHouseDamage", - "onHouseRobbed", - "onVehicleOwnerChange", - "onVehiclePlayerEnter", - "onVehiclePlayerExit", - "onVehicleBotEnter", - "onVehicleBotExit", - "onVehicleCollision", - "onVehicleDamaged", - "onVehicleShot", - "onVehicleTrunkChange", - "onVehicleItemTaken", - "onVehicleItemStored", - "onVehicleEngineChange", - "onVehicleLightsChange", - "onVehicleSirenChange", - "onVehicleLockChange", - "onVehicleRepaired", - "onVehicleColourChange", - "onVehicleExtraChange", + "onBusinessOwnerChange", + "onBusinessNameChange", + "onBusinessLockChange", + "onBusinessPlayerEnter", + "onBusinessPlayerExit", + "onBusinessBotEnter", + "onBusinessBotExit", + "onBusinessDamage", + "onBusinessRobbed", + "onBusinessPlayerPurchase", + "onBusinessBotPurchase", + "onHouseOwnerChange", + "onHouseNameChange", + "onHouseLockChange", + "onHousePlayerEnter", + "onHousePlayerExit", + "onHouseBotEnter", + "onHouseBotExit", + "onHouseDamage", + "onHouseRobbed", + "onVehicleOwnerChange", + "onVehiclePlayerEnter", + "onVehiclePlayerExit", + "onVehicleBotEnter", + "onVehicleBotExit", + "onVehicleCollision", + "onVehicleDamaged", + "onVehicleShot", + "onVehicleTrunkChange", + "onVehicleItemTaken", + "onVehicleItemStored", + "onVehicleEngineChange", + "onVehicleLightsChange", + "onVehicleSirenChange", + "onVehicleLockChange", + "onVehicleRepaired", + "onVehicleColourChange", + "onVehicleExtraChange", ]; // =========================================================================== diff --git a/scripts/server/tutorial.js b/scripts/server/tutorial.js index 37530e18..8fa238ab 100644 --- a/scripts/server/tutorial.js +++ b/scripts/server/tutorial.js @@ -10,8 +10,8 @@ // =========================================================================== function startTutorial(client) { - getPlayerData(client).tutorialItem = createGroundItem(tutorialItem[0], tutorialItem[1], tutorialItem[3]); - getPlayerData(client).tutorialVehicle = createGroundItem(tutorialItem[0], tutorialItem[1], tutorialItem[3]); + getPlayerData(client).tutorialItem = createGroundItem(tutorialItem[0], tutorialItem[1], tutorialItem[3]); + getPlayerData(client).tutorialVehicle = createGroundItem(tutorialItem[0], tutorialItem[1], tutorialItem[3]); } // =========================================================================== diff --git a/scripts/server/utilities.js b/scripts/server/utilities.js index b4f71220..e23bd23c 100644 --- a/scripts/server/utilities.js +++ b/scripts/server/utilities.js @@ -82,7 +82,7 @@ function initAllClients() { function updateServerRules() { logToConsole(LOG_DEBUG, `[VRR.Utilities]: Updating all server rules ...`); - + logToConsole(LOG_DEBUG, `[VRR.Utilities]: Time support: ${isTimeSupported()}`); if(isTimeSupported()) { if(getServerConfig() != false) { @@ -363,7 +363,7 @@ function updateConnectionLogOnClientInfoReceive(client, clientVersion, screenWid let safeClientVersion = escapeDatabaseString(dbConnection, clientVersion); let safeScreenWidth = escapeDatabaseString(dbConnection, toString(screenWidth)); let safeScreenHeight = escapeDatabaseString(dbConnection, toString(screenHeight)); - quickDatabaseQuery(`UPDATE conn_main SET conn_client_version='${safeClientVersion}', conn_screen_width='${safeScreenWidth}', conn_screen_height='${safeScreenHeight}' WHERE conn_id = ${getPlayerData(client).sessionId}`); + quickDatabaseQuery(`UPDATE conn_main SET conn_client_version='${safeClientVersion}', conn_screen_width='${safeScreenWidth}', conn_screen_height='${safeScreenHeight}' WHERE conn_id = ${getPlayerData(client).sessionId}`); } } @@ -445,9 +445,9 @@ function clearTemporaryPeds() { // =========================================================================== function kickAllClients() { - getClients().forEach((client) => { - client.disconnect(); - }) + getClients().forEach((client) => { + client.disconnect(); + }) } // =========================================================================== diff --git a/scripts/server/vehicle.js b/scripts/server/vehicle.js index 097f9ad6..bdd6b137 100644 --- a/scripts/server/vehicle.js +++ b/scripts/server/vehicle.js @@ -560,7 +560,7 @@ function buyVehicleCommand(command, params, client) { getPlayerData(client).buyingVehicle = vehicle; getVehicleData(vehicle).engine = true; vehicle.engine = true; - setEntityData(vehicle, "vrr.engine", getVehicleData(vehicle).engine, true); + setEntityData(vehicle, "vrr.engine", getVehicleData(vehicle).engine, true); getVehicleData(vehicle).needsSaved = true; setPlayerBuyingVehicleState(client, VRR_VEHBUYSTATE_TESTDRIVE, vehicle.id, getVehiclePosition(vehicle)); @@ -1081,10 +1081,10 @@ function reloadAllVehiclesCommand(command, params, client) { // =========================================================================== function respawnVehicleCommand(command, params, client) { - if(isPlayerInAnyVehicle(client)) { - removeAllOccupantsFromVehicle(getPlayerVehicle(client)); - respawnVehicle(getPlayerVehicle(client)); - } + if(isPlayerInAnyVehicle(client)) { + removeAllOccupantsFromVehicle(getPlayerVehicle(client)); + respawnVehicle(getPlayerVehicle(client)); + } setAllVehicleIndexes(); @@ -1135,7 +1135,7 @@ function respawnJobVehiclesCommand(command, params, client) { if(getServerData().vehicles[i].ownerType == VRR_VEHOWNER_JOB) { respawnVehicle(getServerData().vehicles[i].vehicle); } - } + } messageAdminAction(`All job vehicles have been respawned by an admin!`); } @@ -1147,7 +1147,7 @@ function respawnClanVehiclesCommand(command, params, client) { if(getServerData().vehicles[i].ownerType == VRR_VEHOWNER_CLAN) { respawnVehicle(getServerData().vehicles[i].vehicle); } - } + } messageAdminAction(`All clan vehicles have been respawned by an admin!`); } @@ -1159,7 +1159,7 @@ function respawnPlayerVehiclesCommand(command, params, client) { if(getServerData().vehicles[i].ownerType == VRR_VEHOWNER_PLAYER) { respawnVehicle(getServerData().vehicles[i].vehicle); } - } + } messageAdminAction(`All player-owned vehicles have been respawned by an admin!`); } @@ -1171,7 +1171,7 @@ function respawnPublicVehiclesCommand(command, params, client) { if(getServerData().vehicles[i].ownerType == VRR_VEHOWNER_PUBLIC) { respawnVehicle(getServerData().vehicles[i].vehicle); } - } + } messageAdminAction(`All public vehicles have been respawned by an admin!`); } @@ -1183,7 +1183,7 @@ function respawnBusinessVehiclesCommand(command, params, client) { if(getServerData().vehicles[i].ownerType == VRR_VEHOWNER_BIZ) { respawnVehicle(getServerData().vehicles[i].vehicle); } - } + } messageAdminAction(`All business-owned vehicles have been respawned by an admin!`); } @@ -1417,64 +1417,64 @@ function createPermanentVehicle(modelIndex, position, heading, interior = 0, dim // =========================================================================== function processVehiclePurchasing() { - if(!getGlobalConfig().useServerSideVehiclePurchaseCheck) { - return false; - } + if(!getGlobalConfig().useServerSideVehiclePurchaseCheck) { + return false; + } - getClients().forEach((client) => { - if(!isPlayerLoggedIn(client)) { - setPlayerBuyingVehicleState(client, VRR_VEHBUYSTATE_NONE, null, null); - return false; - } + getClients().forEach((client) => { + if(!isPlayerLoggedIn(client)) { + setPlayerBuyingVehicleState(client, VRR_VEHBUYSTATE_NONE, null, null); + return false; + } - if(!isPlayerSpawned(client)) { - setPlayerBuyingVehicleState(client, VRR_VEHBUYSTATE_NONE, null, null); - return false; - } + if(!isPlayerSpawned(client)) { + setPlayerBuyingVehicleState(client, VRR_VEHBUYSTATE_NONE, null, null); + return false; + } - if(!getPlayerData(client)) { - setPlayerBuyingVehicleState(client, VRR_VEHBUYSTATE_NONE, null, null); - return false; - } + if(!getPlayerData(client)) { + setPlayerBuyingVehicleState(client, VRR_VEHBUYSTATE_NONE, null, null); + return false; + } - if(!getPlayerData(client).buyingVehicle) { - setPlayerBuyingVehicleState(client, VRR_VEHBUYSTATE_NONE, null, null); - return false; - } + if(!getPlayerData(client).buyingVehicle) { + setPlayerBuyingVehicleState(client, VRR_VEHBUYSTATE_NONE, null, null); + return false; + } - if(!isPlayerInAnyVehicle(client)) { - if(getPlayerData(client).buyingVehicle != false) { - messagePlayerError(client, getLocaleString(client, "DealershipPurchaseExitedVehicle")); - respawnVehicle(getPlayerData(client).buyingVehicle); - getPlayerData(client).buyingVehicle = false; - setPlayerBuyingVehicleState(client, VRR_VEHBUYSTATE_NONE, null, null); - } - return false; - } + if(!isPlayerInAnyVehicle(client)) { + if(getPlayerData(client).buyingVehicle != false) { + messagePlayerError(client, getLocaleString(client, "DealershipPurchaseExitedVehicle")); + respawnVehicle(getPlayerData(client).buyingVehicle); + getPlayerData(client).buyingVehicle = false; + setPlayerBuyingVehicleState(client, VRR_VEHBUYSTATE_NONE, null, null); + } + return false; + } - if(getDistance(getVehiclePosition(getPlayerData(client).buyingVehicle), getVehicleData(getPlayerData(client).buyingVehicle).spawnPosition) > getGlobalConfig().buyVehicleDriveAwayDistance) { - if(getPlayerCurrentSubAccount(client).cash < getVehicleData(getPlayerData(client).buyingVehicle).buyPrice) { - messagePlayerError(client, getLocaleString(client, "VehiclePurchaseNotEnoughMoney")); - respawnVehicle(getPlayerData(client).buyingVehicle); - getPlayerData(client).buyingVehicle = false; - setPlayerBuyingVehicleState(client, VRR_VEHBUYSTATE_NONE, null, null); - return false; - } + if(getDistance(getVehiclePosition(getPlayerData(client).buyingVehicle), getVehicleData(getPlayerData(client).buyingVehicle).spawnPosition) > getGlobalConfig().buyVehicleDriveAwayDistance) { + if(getPlayerCurrentSubAccount(client).cash < getVehicleData(getPlayerData(client).buyingVehicle).buyPrice) { + messagePlayerError(client, getLocaleString(client, "VehiclePurchaseNotEnoughMoney")); + respawnVehicle(getPlayerData(client).buyingVehicle); + getPlayerData(client).buyingVehicle = false; + setPlayerBuyingVehicleState(client, VRR_VEHBUYSTATE_NONE, null, null); + return false; + } - createNewDealershipVehicle(getVehicleData(getPlayerData(client).buyingVehicle).model, getVehicleData(getPlayerData(client).buyingVehicle).spawnPosition, getVehicleData(getPlayerData(client).buyingVehicle).spawnRotation, getVehicleData(getPlayerData(client).buyingVehicle).buyPrice, getVehicleData(getPlayerData(client).buyingVehicle).ownerId); - takePlayerCash(client, getVehicleData(getPlayerData(client).buyingVehicle).buyPrice); - updatePlayerCash(client); - getVehicleData(getPlayerData(client).buyingVehicle).ownerId = getPlayerCurrentSubAccount(client).databaseId; - getVehicleData(getPlayerData(client).buyingVehicle).ownerType = VRR_VEHOWNER_PLAYER; - getVehicleData(getPlayerData(client).buyingVehicle).buyPrice = 0; - getVehicleData(getPlayerData(client).buyingVehicle).rentPrice = 0; - getVehicleData(getPlayerData(client).buyingVehicle).spawnLocked = false; - getPlayerData(client).buyingVehicle = false; - messagePlayerSuccess(client, getLocaleString(client, "VehiclePurchaseComplete")); - setPlayerBuyingVehicleState(client, VRR_VEHBUYSTATE_NONE, null, null); - return true; - } - }); + createNewDealershipVehicle(getVehicleData(getPlayerData(client).buyingVehicle).model, getVehicleData(getPlayerData(client).buyingVehicle).spawnPosition, getVehicleData(getPlayerData(client).buyingVehicle).spawnRotation, getVehicleData(getPlayerData(client).buyingVehicle).buyPrice, getVehicleData(getPlayerData(client).buyingVehicle).ownerId); + takePlayerCash(client, getVehicleData(getPlayerData(client).buyingVehicle).buyPrice); + updatePlayerCash(client); + getVehicleData(getPlayerData(client).buyingVehicle).ownerId = getPlayerCurrentSubAccount(client).databaseId; + getVehicleData(getPlayerData(client).buyingVehicle).ownerType = VRR_VEHOWNER_PLAYER; + getVehicleData(getPlayerData(client).buyingVehicle).buyPrice = 0; + getVehicleData(getPlayerData(client).buyingVehicle).rentPrice = 0; + getVehicleData(getPlayerData(client).buyingVehicle).spawnLocked = false; + getPlayerData(client).buyingVehicle = false; + messagePlayerSuccess(client, getLocaleString(client, "VehiclePurchaseComplete")); + setPlayerBuyingVehicleState(client, VRR_VEHBUYSTATE_NONE, null, null); + return true; + } + }); return false; } @@ -1484,9 +1484,9 @@ function processVehiclePurchasing() { function processVehicleBurning() { let vehicles = getElementsByType(ELEMENT_VEHICLE); for(let i in vehicles) { - if(vehicles[i].health <= 250) { - return false; - } + if(vehicles[i].health <= 250) { + return false; + } } } @@ -1524,19 +1524,19 @@ function setAllVehicleIndexes() { // =========================================================================== function doesVehicleHaveMegaphone(vehicle) { - if(getVehicleData(vehicle).ownerType == VRR_VEHOWNER_JOB) { - if(getJobType(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)) == VRR_JOB_POLICE) { - return true; - } + if(getVehicleData(vehicle).ownerType == VRR_VEHOWNER_JOB) { + if(getJobType(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)) == VRR_JOB_POLICE) { + return true; + } - if(getJobType(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)) == VRR_JOB_FIRE) { - return true; - } + if(getJobType(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)) == VRR_JOB_FIRE) { + return true; + } - if(getJobType(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)) == VRR_JOB_MEDICAL) { - return true; - } - } + if(getJobType(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)) == VRR_JOB_MEDICAL) { + return true; + } + } return false; } @@ -1581,11 +1581,11 @@ function getVehicleTrunkPosition(vehicle) { // =========================================================================== function removeAllOccupantsFromVehicle(vehicle) { - for(let i = 0 ; i <= 16 ; i++) { - if(vehicle.getOccupant(i) != null) { - removePlayerFromVehicle(vehicle.getOccupant(i)); - } - } + for(let i = 0 ; i <= 16 ; i++) { + if(vehicle.getOccupant(i) != null) { + removePlayerFromVehicle(vehicle.getOccupant(i)); + } + } } // =========================================================================== \ No newline at end of file diff --git a/scripts/shared/gamedata.js b/scripts/shared/gamedata.js index a39525ec..54038dcd 100644 --- a/scripts/shared/gamedata.js +++ b/scripts/shared/gamedata.js @@ -10,291 +10,291 @@ let supportedFeatures = { pickups: [null, true, true, true, false, false, false, null, null, null, false, false, false, false], worldLabels: [null, true, true, true, false, false, false, null, null, null, false, false, false, false], blips: [null, true, true, true, false, false, false, null, null, null, false, false, false, false], - fightStyles: [null, false, false, true, false, false, false, null, null, null, false, false, false, false], - markers: [null, true, true, true, false, false, false, null, null, null, false, false, false, false], - vehicleColours: [null, true, true, true, false, false, false, null, null, null, false, false, false, false], - objects: [null, true, true, true, false, false, false, null, null, null, false, false, false, false], + fightStyles: [null, false, false, true, false, false, false, null, null, null, false, false, false, false], + markers: [null, true, true, true, false, false, false, null, null, null, false, false, false, false], + vehicleColours: [null, true, true, true, false, false, false, null, null, null, false, false, false, false], + objects: [null, true, true, true, false, false, false, null, null, null, false, false, false, false], }; // =========================================================================== let extraContentResource = [ - "", - "connectedrp-gta3", - "connectedrp-gtavc", - "connectedrp-gtasa", - "connectedrp-gtaiv", - "connectedrp-gtaiv", - "", - "", - "", - "connectedrp-mafia1", - "connectedrp-mafia2", - "connectedrp-mafia3", - "connectedrp-mafia1de", + "", + "connectedrp-gta3", + "connectedrp-gtavc", + "connectedrp-gtasa", + "connectedrp-gtaiv", + "connectedrp-gtaiv", + "", + "", + "", + "connectedrp-mafia1", + "connectedrp-mafia2", + "connectedrp-mafia3", + "connectedrp-mafia1de", ]; // =========================================================================== let gameData = { - weaponNames: [ - ["Unknown"], // Game 0 is invalid (GTA 3 is the first game, and is ID 1) + weaponNames: [ + ["Unknown"], // Game 0 is invalid (GTA 3 is the first game, and is ID 1) - [ // GTA III - "Fist", - "Bat", - "Pistol", - "Uzi", - "Shotgun", - "AK47", - "M16", - "Sniper Rifle", - "Rocket Launcher", - "Flamethrower", - "Molotov", - "Grenade" - ], + [ // GTA III + "Fist", + "Bat", + "Pistol", + "Uzi", + "Shotgun", + "AK47", + "M16", + "Sniper Rifle", + "Rocket Launcher", + "Flamethrower", + "Molotov", + "Grenade" + ], - [ // GTA VC - "Fist", - "Brass Knuckles", - "Screwdriver", - "Golf Club", - "Nitestick", - "Knife", - "Baseball Bat", - "Hammer", - "Meat Cleaver", - "Machete", - "Katana", - "Chainsaw", - "Grenade", - "Remote Grenade", - "Teargas", - "Molotov Cocktail", - "Missile", - "Colt .45", - "Python", - "Shotgun", - "Spaz Shotgun", - "Stubby Shotgun", - "Tec-9", - "Uzi", - "Ingram", - "MP5", - "M4", - "Ruger", - "Sniper Rifle", - "Laser Sniper", - "RPG", - "Flame Thrower", - "M60", - "Minigun" - ], + [ // GTA VC + "Fist", + "Brass Knuckles", + "Screwdriver", + "Golf Club", + "Nitestick", + "Knife", + "Baseball Bat", + "Hammer", + "Meat Cleaver", + "Machete", + "Katana", + "Chainsaw", + "Grenade", + "Remote Grenade", + "Teargas", + "Molotov Cocktail", + "Missile", + "Colt .45", + "Python", + "Shotgun", + "Spaz Shotgun", + "Stubby Shotgun", + "Tec-9", + "Uzi", + "Ingram", + "MP5", + "M4", + "Ruger", + "Sniper Rifle", + "Laser Sniper", + "RPG", + "Flame Thrower", + "M60", + "Minigun" + ], - [ // GTA San Andreas - "Fist", - "Brass Knuckles", - "Golf Club", - "Nightstick", - "Knife", - "Baseball Bat", - "Shovel", - "Pool Cue", - "Katana", - "Chainsaw", - "Purple Dildo", - "Dildo", - "Vibrator", - "Silver Vibrator", - "Flowers", - "Cane", - "Grenade", - "Teargas", - "Molotov Cocktail", - "Unknown", - "Unknown", - "Unknown", - "9mm", - "Silenced 9mm", - "Desert Eagle", - "Shotgun", - "Sawnoff Shotgun", - "Combat Shotgun", - "Uzi", - "MP5", - "AK-47", - "M4", - "Tec-9", - "Country Rifle", - "Sniper Rifle", - "RPG", - "HS Rocket", - "Flamethrower", - "Minigun", - "Satchel Charge", - "Detonator", - "Spraycan", - "Fire Extinguisher", - "Camera", - "Night Vision Goggles", - "Thermal Goggles", - "Parachute", - "Cellphone", - "Jetpack", - "Skateboard" - ], + [ // GTA San Andreas + "Fist", + "Brass Knuckles", + "Golf Club", + "Nightstick", + "Knife", + "Baseball Bat", + "Shovel", + "Pool Cue", + "Katana", + "Chainsaw", + "Purple Dildo", + "Dildo", + "Vibrator", + "Silver Vibrator", + "Flowers", + "Cane", + "Grenade", + "Teargas", + "Molotov Cocktail", + "Unknown", + "Unknown", + "Unknown", + "9mm", + "Silenced 9mm", + "Desert Eagle", + "Shotgun", + "Sawnoff Shotgun", + "Combat Shotgun", + "Uzi", + "MP5", + "AK-47", + "M4", + "Tec-9", + "Country Rifle", + "Sniper Rifle", + "RPG", + "HS Rocket", + "Flamethrower", + "Minigun", + "Satchel Charge", + "Detonator", + "Spraycan", + "Fire Extinguisher", + "Camera", + "Night Vision Goggles", + "Thermal Goggles", + "Parachute", + "Cellphone", + "Jetpack", + "Skateboard" + ], - [ // GTA Underground - "Fist", - "Brass Knuckles", - "Golf Club", - "Nightstick", - "Knife", - "Baseball Bat", - "Shovel", - "Pool Cue", - "Katana", - "Chainsaw", - "Purple Dildo", - "Dildo", - "Vibrator", - "Silver Vibrator", - "Flowers", - "Cane", - "Grenade", - "Teargas", - "Molotov Cocktail", - "Unknown", - "Unknown", - "Unknown", - "9mm", - "Silenced 9mm", - "Desert Eagle", - "Shotgun", - "Sawnoff Shotgun", - "Combat Shotgun", - "Uzi", - "MP5", - "AK-47", - "M4", - "Tec-9", - "Country Rifle", - "Sniper Rifle", - "RPG", - "HS Rocket", - "Flamethrower", - "Minigun", - "Satchel Charge", - "Detonator", - "Spraycan", - "Fire Extinguisher", - "Camera", - "Night Vision Goggles", - "Thermal Goggles", - "Parachute", - "Cellphone", - "Jetpack", - "Skateboard", - ], + [ // GTA Underground + "Fist", + "Brass Knuckles", + "Golf Club", + "Nightstick", + "Knife", + "Baseball Bat", + "Shovel", + "Pool Cue", + "Katana", + "Chainsaw", + "Purple Dildo", + "Dildo", + "Vibrator", + "Silver Vibrator", + "Flowers", + "Cane", + "Grenade", + "Teargas", + "Molotov Cocktail", + "Unknown", + "Unknown", + "Unknown", + "9mm", + "Silenced 9mm", + "Desert Eagle", + "Shotgun", + "Sawnoff Shotgun", + "Combat Shotgun", + "Uzi", + "MP5", + "AK-47", + "M4", + "Tec-9", + "Country Rifle", + "Sniper Rifle", + "RPG", + "HS Rocket", + "Flamethrower", + "Minigun", + "Satchel Charge", + "Detonator", + "Spraycan", + "Fire Extinguisher", + "Camera", + "Night Vision Goggles", + "Thermal Goggles", + "Parachute", + "Cellphone", + "Jetpack", + "Skateboard", + ], - [ // GTA IV - "Fist", - "Bat", - "Pool Cue", - "Knife", - "Grenade", - "Molotov", - "Rocket", - "Pistol", - "UNUSED", - "Desert Eagle", - "Stubby Shotgun", - "Baretta Shotgun", - "Micro Uzi", - "MP5", - "AK-47", - "M4", - "Combat Sniper", - "M40A1", - "RPG", - "Flamethrower", - "Minigun", - "EFLC Weapon 1", - "EFLC Weapon 2", - "EFLC Weapon 3", - "EFLC Weapon 4", - "EFLC Weapon 5", - "EFLC Weapon 6", - "EFLC Weapon 7", - "EFLC Weapon 8", - "EFLC Weapon 9", - "EFLC Weapon 10", - "EFLC Weapon 11", - "EFLC Weapon 12", - "EFLC Weapon 13", - "EFLC Weapon 14", - "EFLC Weapon 15", - "EFLC Weapon 16", - "EFLC Weapon 17", - "EFLC Weapon 18", - "EFLC Weapon 19", - "EFLC Weapon 20", - "EFLC Weapon 21", - "EFLC Weapon 22", - "EFLC Weapon 23", - "EFLC Weapon 24", - "Camera", - ], + [ // GTA IV + "Fist", + "Bat", + "Pool Cue", + "Knife", + "Grenade", + "Molotov", + "Rocket", + "Pistol", + "UNUSED", + "Desert Eagle", + "Stubby Shotgun", + "Baretta Shotgun", + "Micro Uzi", + "MP5", + "AK-47", + "M4", + "Combat Sniper", + "M40A1", + "RPG", + "Flamethrower", + "Minigun", + "EFLC Weapon 1", + "EFLC Weapon 2", + "EFLC Weapon 3", + "EFLC Weapon 4", + "EFLC Weapon 5", + "EFLC Weapon 6", + "EFLC Weapon 7", + "EFLC Weapon 8", + "EFLC Weapon 9", + "EFLC Weapon 10", + "EFLC Weapon 11", + "EFLC Weapon 12", + "EFLC Weapon 13", + "EFLC Weapon 14", + "EFLC Weapon 15", + "EFLC Weapon 16", + "EFLC Weapon 17", + "EFLC Weapon 18", + "EFLC Weapon 19", + "EFLC Weapon 20", + "EFLC Weapon 21", + "EFLC Weapon 22", + "EFLC Weapon 23", + "EFLC Weapon 24", + "Camera", + ], - [ // GTA IV (EFLC) - "Fist", - "Bat", - "Pool Cue", - "Knife", - "Grenade", - "Molotov", - "UNUSED", - "Pistol", - "Desert Eagle", - "Stubby Shotgun", - "Baretta Shotgun", - "Shotgun", - "Micro Uzi", - "MP5", - "AK-47", - "M4", - "Combat Sniper", - "M40A1", - "RPG", - "Flamethrower", - "Minigun", - "EFLC Weapon 1", - "EFLC Weapon 2", - "EFLC Weapon 3", - "EFLC Weapon 4", - "EFLC Weapon 5", - "EFLC Weapon 6", - "EFLC Weapon 7", - "EFLC Weapon 8", - "EFLC Weapon 9", - "EFLC Weapon 10", - "EFLC Weapon 11", - "EFLC Weapon 12", - "EFLC Weapon 13", - "EFLC Weapon 14", - "EFLC Weapon 15", - "EFLC Weapon 16", - "EFLC Weapon 17", - "EFLC Weapon 18", - "EFLC Weapon 19", - "EFLC Weapon 20", - "EFLC Weapon 21", - "EFLC Weapon 22", - "EFLC Weapon 23", - "EFLC Weapon 24", - "Camera", - ], + [ // GTA IV (EFLC) + "Fist", + "Bat", + "Pool Cue", + "Knife", + "Grenade", + "Molotov", + "UNUSED", + "Pistol", + "Desert Eagle", + "Stubby Shotgun", + "Baretta Shotgun", + "Shotgun", + "Micro Uzi", + "MP5", + "AK-47", + "M4", + "Combat Sniper", + "M40A1", + "RPG", + "Flamethrower", + "Minigun", + "EFLC Weapon 1", + "EFLC Weapon 2", + "EFLC Weapon 3", + "EFLC Weapon 4", + "EFLC Weapon 5", + "EFLC Weapon 6", + "EFLC Weapon 7", + "EFLC Weapon 8", + "EFLC Weapon 9", + "EFLC Weapon 10", + "EFLC Weapon 11", + "EFLC Weapon 12", + "EFLC Weapon 13", + "EFLC Weapon 14", + "EFLC Weapon 15", + "EFLC Weapon 16", + "EFLC Weapon 17", + "EFLC Weapon 18", + "EFLC Weapon 19", + "EFLC Weapon 20", + "EFLC Weapon 21", + "EFLC Weapon 22", + "EFLC Weapon 23", + "EFLC Weapon 24", + "Camera", + ], [], // INVALID [], // INVALID [], // INVALID @@ -531,2092 +531,2092 @@ let gameData = { [], // Mafia 3 [], // Mafia Definitive Edition ], - skins: [ - [], - [ // GTA III - [0 , "Claude" , false], - [1 , "Police Officer" , false], - [2 , "SWAT Officer" , false], - [3 , "FBI Agent" , false], - [4 , "Army Soldier" , false], - [5 , "Paramedic" , false], - [6 , "Firefighter" , false], - [7 , "Wise Guy" , true ], - [8 , "Taxi Driver" , false], - [9 , "Pimp" , true ], - [10 , "Mafia Member" , true ], - [11 , "Mafia Member" , true ], - [12 , "Triad Member" , true ], - [13 , "Triad Member" , true ], - [14 , "Diablo Member" , true ], - [15 , "Diablo Member" , true ], - [16 , "Yakuza Member" , true ], - [17 , "Yakuza Member" , true ], - [18 , "Yardie Member" , true ], - [19 , "Yardie Member" , true ], - [20 , "Cartel Soldier" , true ], - [21 , "Cartel Soldier" , true ], - [22 , "Red Jacks Thug" , true ], - [23 , "Purple Nines Thug" , true ], - [24 , "Street Criminal" , true ], - [25 , "Street Criminal" , true ], - [30 , "Male Client" , true ], - [31 , "Random Guy" , true ], - [32 , "Vacationist" , true ], - [33 , "DJ" , true ], - [34 , "Young Woman" , true ], - [35 , "Young Woman" , true ], - [36 , "Business Woman" , true ], - [37 , "Elder Woman" , true ], - [38 , "Elder Woman" , true ], - [39 , "Prostitute" , true ], - [40 , "Prostitute" , true ], - [41 , "Random Guy" , true ], - [42 , "Diseased Man" , true ], - [43 , "Deseased Woman" , true ], - [44 , "Young Woman" , true ], - [45 , "Old Man" , true ], - [46 , "Random Guy" , true ], - [47 , "Old Woman" , true ], - [48 , "Old Woman" , true ], - [49 , "Old Man" , true ], - [50 , "Random Guy" , true ], - [51 , "Old Woman" , true ], - [52 , "Young Woman" , true ], - [53 , "Docks Worker" , true ], - [54 , "Docks Worker" , true ], - [55 , "Male Street Bum" , true ], - [56 , "Female Street Bum" , true ], - [57 , "Delivery Guy" , true ], - [58 , "Delivery Guy" , true ], - [59 , "Business Man" , true ], - [60 , "Marty Chonks" , true ], - [61 , "CIA Agent" , true ], - [62 , "Female Client" , true ], - [63 , "Young Woman" , true ], - [64 , "Business Woman" , true ], - [65 , "Business Man" , true ], - [66 , "Female Client" , true ], - [67 , "Male Steward" , true ], - [68 , "Female Steward" , true ], - [69 , "Male Cocks Fan" , true ], - [70 , "Male Cocks Fan" , true ], - [71 , "Female Cocks Fan" , true ], - [72 , "Male Paramedics Assistant" , true ], - [73 , "Female Paramedics Assistant", true ], - [74 , "Construction Worker" , true ], - [75 , "Construction Worker" , true ], - [76 , "Zip Customer" , true ], - [77 , "Party Woman" , true ], - [78 , "Party Woman" , true ], - [80 , "Female College Student" , true ], - [81 , "Old Man" , true ], - [82 , "Female Jogger" , true ], - [83 , "Asuka Kasen" , true ], - [84 , "Spank Suicide Bomber" , true ], - [85 , "Salvatore's Butler" , true ], - [86 , "Catalina" , true ], - [87 , "Lee Chong" , true ], - [88 , "Colombian Cartel Member" , true ], - [89 , "Colombian Cartel Member" , true ], - [90 , "Colombian Cartel Member" , true ], - [91 , "Colombian Cartel Member" , true ], - [92 , "Police Officer" , false], - [93 , "Curly Bob" , true ], - [94 , "Phil Cassidy" , true ], - [95 , "Detective" , true ], - [96 , "8-Ball" , true ], - [97 , "8-Ball" , true ], - [98 , "Salvatore Leone" , true ], - [99 , "Mafia Member" , true ], - [100, "Joey Leone" , true ], - [101, "Joey Leone" , true ], - [102, "Bar Owner" , true ], - [103, "Kenji Kasen" , true ], - [104, "Mike Forelli" , true ], - [105, "Donald Love" , true ], - [106, "Donald Love" , true ], - [107, "Luigi Goterelli" , true ], - [108, "Maria Latore" , true ], - [109, "Mickey Hamfists" , true ], - [110, "Miguel" , true ], - [111, "Misty" , true ], - [112, "Old Oriental Gentleman" , true ], - [113, "Old Oriental Gentleman" , true ], - [114, "Old Oriental Gentleman" , true ], - [115, "Ray Machowski" , true ], - [116, "Mafia Member" , true ], - [118, "Tanner" , true ], - [119, "Toni Cipriani" , true ], - [120, "Darkel" , true ], - [121, "Chuff Security Officer" , false], - ], - [ // GTA Vice City - [0 , "Tommy Vercetti" , false], - [1 , "Police Officer" , false], - [2 , "SWAT Officer" , false], - [3 , "FBI Agent" , false], - [4 , "Army Soldier" , false], - [5 , "Paramedic" , false], - [6 , "Fireman" , false], - [7 , "Golfer" , true ], - [9 , "Random Lady" , true], - [10 , "Bum" , true], - [11 , "Greaser" , true], - [12 , "Random Guy" , true], - [13 , "Random Guy" , true], - [14 , "Random Lady" , true], - [15 , "Random Guy" , true], - [16 , "Random Guy" , true], - [17 , "Beach Girl" , true], - [18 , "Fat Beach Lady" , true ], - [19 , "Beach Guy" , true ], - [20 , "Fat Beach Guy" , true ], - [21 , "Random Lady" , true ], - [22 , "Random Lady" , true ], - [23 , "Random Lady" , true ], - [24 , "Prostitute" , true ], - [25 , "Bum" , true ], - [26 , "Bum" , true ], - [27 , "Random Guy" , true ], - [28 , "Taxi Driver" , true ], - [29 , "Haitian" , true ], - [30 , "Criminal" , true ], - [31 , "Random Lady" , true ], - [32 , "Random Lady" , true ], - [33 , "Random Guy" , true ], - [34 , "Random Guy" , true ], - [35 , "Random Lady" , true ], - [36 , "Random Lady" , true ], - [37 , "Random Guy" , true ], - [38 , "Beach Lady" , true ], - [39 , "Beach Guy" , true ], - [40 , "Beach Lady" , true ], - [41 , "Beach Guy" , true ], - [42 , "Random Guy" , true ], - [43 , "Prostitute" , true ], - [44 , "Bum" , true ], - [45 , "Bum" , true ], - [46 , "Random Guy" , true ], - [47 , "Random Guy" , true ], - [48 , "Punk" , true ], - [49 , "Prostitute" , true ], - [50 , "Random Old Lady" , true ], - [51 , "Punk" , true ], - [52 , "Random Guy" , true ], - [53 , "Random Lady" , true ], - [54 , "Random Lady" , true ], - [55 , "Random Guy" , true ], - [56 , "Random Guy" , true ], - [57 , "Beach Lady" , true ], - [58 , "Beach Guy" , true ], - [59 , "Beach Lady" , true ], - [60 , "Beach Guy" , true ], - [61 , "Construction Worker" , true ], - [62 , "Golfer" , true ], - [63 , "Golfer" , true ], - [64 , "Golfer" , true ], - [65 , "Beach Lady" , true ], - [66 , "Beach Guy" , true ], - [67 , "Random Lady" , true ], - [68 , "Random Guy" , true ], - [69 , "Random Guy" , true ], - [70 , "Prostitute" , true ], - [71 , "Bum Lady" , true ], - [72 , "Random Guy" , true ], - [73 , "Random Guy" , true ], - [74 , "Taxi Driver" , true ], - [75 , "Random Woman" , true ], - [76 , "Skater Guy" , true ], - [77 , "Beach Lady" , true ], - [78 , "Skater Guy" , true ], - [79 , "Young Woman Shopper" , true ], - [80 , "Old Women Shopper" , true ], - [81 , "Tourist" , true ], - [82 , "Tourist" , true ], - [83 , "Cuban" , true ], - [84 , "Cuban" , true ], - [85 , "Haitian" , true ], - [86 , "Haitian" , true ], - [87 , "Shark" , true ], - [88 , "Shark" , true ], - [89 , "Diaz Guy" , true ], - [90 , "Diaz Guy" , true ], - [91 , "Security Guard" , false], - [92 , "Security Guard" , false], - [93 , "Biker" , true ], - [94 , "Biker" , true ], - [95 , "Vercetti Guy" , true ], - [96 , "Vercetti Guy" , true ], - [97 , "Undercover Cop" , false], - [98 , "Undercover Cop" , false], - [99 , "Undercover Cop" , false], - [100, "Undercover Cop " , false], - [101, "Undercover Cop" , false], - [102, "Undercover Cop" , false], - [103, "Random Guy" , true ], - [104, "Bodyguard" , true ], - [105, "Prostitute" , true ], - [106, "Prostitute" , false], - [107, "Ricardo Diaz" , true ], - [108, "Love Fist Guy" , true ], - [109, "Ken Rosenburg" , true ], - [110, "Candy Suxx" , true ], - [111, "Hilary" , true ], - [112, "Love Fist" , true ], - [113, "Phil" , true ], - [114, "Rockstar Guy" , true ], - [115, "Sonny" , true ], - [116, "Lance" , true ], - [117, "Mercedes" , true ], - [118, "Love Fist" , true ], - [119, "Alex Scrub" , true ], - [120, "Officer Lance Vance" , false], - [121, "Lance Vance" , true ], - [122, "Cortez" , true ], - [123, "SWAT 2" , false], - [124, "Columbian" , true ], - [125, "Hilary" , true ], - [126, "Mercedes" , true ], - [127, "Cam" , true ], - [128, "Cam" , true ], - [129, "Phil" , true ], - [130, "Phil" , true ], - [131, "Bodyguard" , true ], - [132, "Pizza Worker" , true ], - [133, "Taxi Driver" , true ], - [134, "Taxi Driver" , true ], - [135, "Sailor" , true ], - [136, "Sailor" , true ], - [137, "Sailor" , true ], - [138, "Chef" , true ], - [139, "Criminal" , true ], - //[140, "French Guy" , true ], - //[141, "Worker" , true ], - [142, "Haitian" , true ], - [143, "Waitress" , true ], - [144, "Forelli Member" , true ], - [145, "Forelli Member" , true ], - [146, "Forelli Member" , true ], - [147, "Columbian" , true ], - [148, "Random Guy" , true ], - [149, "Beach Guy" , true ], - [150, "Random Guy" , true ], - [151, "Random Guy" , true ], - [152, "Random Guy" , true ], - [153, "Drag Queen" , true ], - [154, "Diaz Traitor" , true ], - [155, "Random Guy" , true ], - [156, "Random Guy" , true ], - [157, "Stripper" , true ], - [158, "Stripper" , true ], - [159, "Stripper" , true ], - [160, "Store Clerk" , true ], - [161, "Tommy Vercetti" , true ], - [162, "Tommy Vercetti (Business Suit)" , true ], - [163, "Tommy Vercetti (SpandEx Overalls)" , true ], - [164, "Tommy Vercetti (Golfer)" , true ], - [165, "Tommy Vercetti (Cuban)" , true ], - [166, "Tommy Vercetti (Cop)" , false], - [167, "Tommy Vercetti (Robbery Suit)" , true ], - [168, "Tommy Vercetti (T-Shirt and Jeans)", true ], - [169, "Tommy Vercetti (Striped Suit)" , true ], - [170, "Tommy Vercetti (Black Tracksuit)" , true ], - [171, "Tommy Vercetti (Red Tracksuit)" , true ], - [172, "Club Bouncer" , true ], - [173, "Club Bouncer" , true ], - [174, "Stripclub Dancer" , true ], - [175, "Random Guy" , true ], - [176, "Stripclub Dancer" , true ], - [177, "Stripclub Dancer" , true ], - [178, "Stripclub Dancer" , true ], - [179, "Gang Member" , true ], - [180, "Tommy Vercetti (Endgame T-Shirt)" , true ], - [181, "Forelli Thug" , true ], - [182, "Forelli Thug" , true ], - [183, "Random Lady" , true ], - [184, "Gang Member" , true ], - [185, "Party Waitress" , true ], - [186, "Kent Paul" , true ], - [187, "Big Head Taxi Driver" , true ], - ], + skins: [ + [], + [ // GTA III + [0 , "Claude" , false], + [1 , "Police Officer" , false], + [2 , "SWAT Officer" , false], + [3 , "FBI Agent" , false], + [4 , "Army Soldier" , false], + [5 , "Paramedic" , false], + [6 , "Firefighter" , false], + [7 , "Wise Guy" , true ], + [8 , "Taxi Driver" , false], + [9 , "Pimp" , true ], + [10 , "Mafia Member" , true ], + [11 , "Mafia Member" , true ], + [12 , "Triad Member" , true ], + [13 , "Triad Member" , true ], + [14 , "Diablo Member" , true ], + [15 , "Diablo Member" , true ], + [16 , "Yakuza Member" , true ], + [17 , "Yakuza Member" , true ], + [18 , "Yardie Member" , true ], + [19 , "Yardie Member" , true ], + [20 , "Cartel Soldier" , true ], + [21 , "Cartel Soldier" , true ], + [22 , "Red Jacks Thug" , true ], + [23 , "Purple Nines Thug" , true ], + [24 , "Street Criminal" , true ], + [25 , "Street Criminal" , true ], + [30 , "Male Client" , true ], + [31 , "Random Guy" , true ], + [32 , "Vacationist" , true ], + [33 , "DJ" , true ], + [34 , "Young Woman" , true ], + [35 , "Young Woman" , true ], + [36 , "Business Woman" , true ], + [37 , "Elder Woman" , true ], + [38 , "Elder Woman" , true ], + [39 , "Prostitute" , true ], + [40 , "Prostitute" , true ], + [41 , "Random Guy" , true ], + [42 , "Diseased Man" , true ], + [43 , "Deseased Woman" , true ], + [44 , "Young Woman" , true ], + [45 , "Old Man" , true ], + [46 , "Random Guy" , true ], + [47 , "Old Woman" , true ], + [48 , "Old Woman" , true ], + [49 , "Old Man" , true ], + [50 , "Random Guy" , true ], + [51 , "Old Woman" , true ], + [52 , "Young Woman" , true ], + [53 , "Docks Worker" , true ], + [54 , "Docks Worker" , true ], + [55 , "Male Street Bum" , true ], + [56 , "Female Street Bum" , true ], + [57 , "Delivery Guy" , true ], + [58 , "Delivery Guy" , true ], + [59 , "Business Man" , true ], + [60 , "Marty Chonks" , true ], + [61 , "CIA Agent" , true ], + [62 , "Female Client" , true ], + [63 , "Young Woman" , true ], + [64 , "Business Woman" , true ], + [65 , "Business Man" , true ], + [66 , "Female Client" , true ], + [67 , "Male Steward" , true ], + [68 , "Female Steward" , true ], + [69 , "Male Cocks Fan" , true ], + [70 , "Male Cocks Fan" , true ], + [71 , "Female Cocks Fan" , true ], + [72 , "Male Paramedics Assistant" , true ], + [73 , "Female Paramedics Assistant", true ], + [74 , "Construction Worker" , true ], + [75 , "Construction Worker" , true ], + [76 , "Zip Customer" , true ], + [77 , "Party Woman" , true ], + [78 , "Party Woman" , true ], + [80 , "Female College Student" , true ], + [81 , "Old Man" , true ], + [82 , "Female Jogger" , true ], + [83 , "Asuka Kasen" , true ], + [84 , "Spank Suicide Bomber" , true ], + [85 , "Salvatore's Butler" , true ], + [86 , "Catalina" , true ], + [87 , "Lee Chong" , true ], + [88 , "Colombian Cartel Member" , true ], + [89 , "Colombian Cartel Member" , true ], + [90 , "Colombian Cartel Member" , true ], + [91 , "Colombian Cartel Member" , true ], + [92 , "Police Officer" , false], + [93 , "Curly Bob" , true ], + [94 , "Phil Cassidy" , true ], + [95 , "Detective" , true ], + [96 , "8-Ball" , true ], + [97 , "8-Ball" , true ], + [98 , "Salvatore Leone" , true ], + [99 , "Mafia Member" , true ], + [100, "Joey Leone" , true ], + [101, "Joey Leone" , true ], + [102, "Bar Owner" , true ], + [103, "Kenji Kasen" , true ], + [104, "Mike Forelli" , true ], + [105, "Donald Love" , true ], + [106, "Donald Love" , true ], + [107, "Luigi Goterelli" , true ], + [108, "Maria Latore" , true ], + [109, "Mickey Hamfists" , true ], + [110, "Miguel" , true ], + [111, "Misty" , true ], + [112, "Old Oriental Gentleman" , true ], + [113, "Old Oriental Gentleman" , true ], + [114, "Old Oriental Gentleman" , true ], + [115, "Ray Machowski" , true ], + [116, "Mafia Member" , true ], + [118, "Tanner" , true ], + [119, "Toni Cipriani" , true ], + [120, "Darkel" , true ], + [121, "Chuff Security Officer" , false], + ], + [ // GTA Vice City + [0 , "Tommy Vercetti" , false], + [1 , "Police Officer" , false], + [2 , "SWAT Officer" , false], + [3 , "FBI Agent" , false], + [4 , "Army Soldier" , false], + [5 , "Paramedic" , false], + [6 , "Fireman" , false], + [7 , "Golfer" , true ], + [9 , "Random Lady" , true], + [10 , "Bum" , true], + [11 , "Greaser" , true], + [12 , "Random Guy" , true], + [13 , "Random Guy" , true], + [14 , "Random Lady" , true], + [15 , "Random Guy" , true], + [16 , "Random Guy" , true], + [17 , "Beach Girl" , true], + [18 , "Fat Beach Lady" , true ], + [19 , "Beach Guy" , true ], + [20 , "Fat Beach Guy" , true ], + [21 , "Random Lady" , true ], + [22 , "Random Lady" , true ], + [23 , "Random Lady" , true ], + [24 , "Prostitute" , true ], + [25 , "Bum" , true ], + [26 , "Bum" , true ], + [27 , "Random Guy" , true ], + [28 , "Taxi Driver" , true ], + [29 , "Haitian" , true ], + [30 , "Criminal" , true ], + [31 , "Random Lady" , true ], + [32 , "Random Lady" , true ], + [33 , "Random Guy" , true ], + [34 , "Random Guy" , true ], + [35 , "Random Lady" , true ], + [36 , "Random Lady" , true ], + [37 , "Random Guy" , true ], + [38 , "Beach Lady" , true ], + [39 , "Beach Guy" , true ], + [40 , "Beach Lady" , true ], + [41 , "Beach Guy" , true ], + [42 , "Random Guy" , true ], + [43 , "Prostitute" , true ], + [44 , "Bum" , true ], + [45 , "Bum" , true ], + [46 , "Random Guy" , true ], + [47 , "Random Guy" , true ], + [48 , "Punk" , true ], + [49 , "Prostitute" , true ], + [50 , "Random Old Lady" , true ], + [51 , "Punk" , true ], + [52 , "Random Guy" , true ], + [53 , "Random Lady" , true ], + [54 , "Random Lady" , true ], + [55 , "Random Guy" , true ], + [56 , "Random Guy" , true ], + [57 , "Beach Lady" , true ], + [58 , "Beach Guy" , true ], + [59 , "Beach Lady" , true ], + [60 , "Beach Guy" , true ], + [61 , "Construction Worker" , true ], + [62 , "Golfer" , true ], + [63 , "Golfer" , true ], + [64 , "Golfer" , true ], + [65 , "Beach Lady" , true ], + [66 , "Beach Guy" , true ], + [67 , "Random Lady" , true ], + [68 , "Random Guy" , true ], + [69 , "Random Guy" , true ], + [70 , "Prostitute" , true ], + [71 , "Bum Lady" , true ], + [72 , "Random Guy" , true ], + [73 , "Random Guy" , true ], + [74 , "Taxi Driver" , true ], + [75 , "Random Woman" , true ], + [76 , "Skater Guy" , true ], + [77 , "Beach Lady" , true ], + [78 , "Skater Guy" , true ], + [79 , "Young Woman Shopper" , true ], + [80 , "Old Women Shopper" , true ], + [81 , "Tourist" , true ], + [82 , "Tourist" , true ], + [83 , "Cuban" , true ], + [84 , "Cuban" , true ], + [85 , "Haitian" , true ], + [86 , "Haitian" , true ], + [87 , "Shark" , true ], + [88 , "Shark" , true ], + [89 , "Diaz Guy" , true ], + [90 , "Diaz Guy" , true ], + [91 , "Security Guard" , false], + [92 , "Security Guard" , false], + [93 , "Biker" , true ], + [94 , "Biker" , true ], + [95 , "Vercetti Guy" , true ], + [96 , "Vercetti Guy" , true ], + [97 , "Undercover Cop" , false], + [98 , "Undercover Cop" , false], + [99 , "Undercover Cop" , false], + [100, "Undercover Cop " , false], + [101, "Undercover Cop" , false], + [102, "Undercover Cop" , false], + [103, "Random Guy" , true ], + [104, "Bodyguard" , true ], + [105, "Prostitute" , true ], + [106, "Prostitute" , false], + [107, "Ricardo Diaz" , true ], + [108, "Love Fist Guy" , true ], + [109, "Ken Rosenburg" , true ], + [110, "Candy Suxx" , true ], + [111, "Hilary" , true ], + [112, "Love Fist" , true ], + [113, "Phil" , true ], + [114, "Rockstar Guy" , true ], + [115, "Sonny" , true ], + [116, "Lance" , true ], + [117, "Mercedes" , true ], + [118, "Love Fist" , true ], + [119, "Alex Scrub" , true ], + [120, "Officer Lance Vance" , false], + [121, "Lance Vance" , true ], + [122, "Cortez" , true ], + [123, "SWAT 2" , false], + [124, "Columbian" , true ], + [125, "Hilary" , true ], + [126, "Mercedes" , true ], + [127, "Cam" , true ], + [128, "Cam" , true ], + [129, "Phil" , true ], + [130, "Phil" , true ], + [131, "Bodyguard" , true ], + [132, "Pizza Worker" , true ], + [133, "Taxi Driver" , true ], + [134, "Taxi Driver" , true ], + [135, "Sailor" , true ], + [136, "Sailor" , true ], + [137, "Sailor" , true ], + [138, "Chef" , true ], + [139, "Criminal" , true ], + //[140, "French Guy" , true ], + //[141, "Worker" , true ], + [142, "Haitian" , true ], + [143, "Waitress" , true ], + [144, "Forelli Member" , true ], + [145, "Forelli Member" , true ], + [146, "Forelli Member" , true ], + [147, "Columbian" , true ], + [148, "Random Guy" , true ], + [149, "Beach Guy" , true ], + [150, "Random Guy" , true ], + [151, "Random Guy" , true ], + [152, "Random Guy" , true ], + [153, "Drag Queen" , true ], + [154, "Diaz Traitor" , true ], + [155, "Random Guy" , true ], + [156, "Random Guy" , true ], + [157, "Stripper" , true ], + [158, "Stripper" , true ], + [159, "Stripper" , true ], + [160, "Store Clerk" , true ], + [161, "Tommy Vercetti" , true ], + [162, "Tommy Vercetti (Business Suit)" , true ], + [163, "Tommy Vercetti (SpandEx Overalls)" , true ], + [164, "Tommy Vercetti (Golfer)" , true ], + [165, "Tommy Vercetti (Cuban)" , true ], + [166, "Tommy Vercetti (Cop)" , false], + [167, "Tommy Vercetti (Robbery Suit)" , true ], + [168, "Tommy Vercetti (T-Shirt and Jeans)", true ], + [169, "Tommy Vercetti (Striped Suit)" , true ], + [170, "Tommy Vercetti (Black Tracksuit)" , true ], + [171, "Tommy Vercetti (Red Tracksuit)" , true ], + [172, "Club Bouncer" , true ], + [173, "Club Bouncer" , true ], + [174, "Stripclub Dancer" , true ], + [175, "Random Guy" , true ], + [176, "Stripclub Dancer" , true ], + [177, "Stripclub Dancer" , true ], + [178, "Stripclub Dancer" , true ], + [179, "Gang Member" , true ], + [180, "Tommy Vercetti (Endgame T-Shirt)" , true ], + [181, "Forelli Thug" , true ], + [182, "Forelli Thug" , true ], + [183, "Random Lady" , true ], + [184, "Gang Member" , true ], + [185, "Party Waitress" , true ], + [186, "Kent Paul" , true ], + [187, "Big Head Taxi Driver" , true ], + ], - [ // GTA San Andreas - [0 , "Carl 'CJ' Johnson" , false], - [1 , "The Truth" , true], - [2 , "Maccer" , true], - [6 , "Taxi Driver/Train Driver" , true], - [9 , "Normal Ped" , true], - [10 , "Old Woman" , true], - [11 , "Casino Croupier" , false], - [12 , "Rich Woman" , true], - [13 , "Street Girl" , true], - [14 , "Normal Ped" , true], - [15 , "Mr.Whittaker (RS Haul Owner)" , true], - [16 , "Airport Ground Worker" , true], - [17 , "Businessman" , true], - [18 , "Beach Visitor" , true], - [19 , "DJ" , true], - [20 , "Rich Guy (Madd Doggs Manager)" , true], - [21 , "Normal Ped" , true], - [22 , "Normal Ped" , true], - [23 , "Bmxer" , true], - [24 , "Madd Dogg Bodyguard" , true], - [25 , "Madd Dogg Bodyguard" , true], - [26 , "Backpacker" , true], - [27 , "Construction Worker" , true], - [28 , "Drug Dealer" , true], - [29 , "Drug Dealer" , true], - [30 , "Drug Dealer" , true], - [31 , "Farm-Town Inhabitant" , true], - [32 , "Farm-Town Inhabitant" , true], - [33 , "Farm-Town Inhabitant" , true], - [34 , "Farm-Town Inhabitant" , true], - [35 , "Gardener" , true], - [36 , "Golfer" , true], - [37 , "Golfer" , true], - [38 , "Normal Ped" , true], - [39 , "Normal Ped" , true], - [40 , "Normal Ped" , true], - [41 , "Normal Ped" , true], - [43 , "Normal Ped" , true], - [44 , "Normal Ped" , true], - [45 , "Beach Visitor" , true], - [46 , "Normal Ped" , true], - [47 , "Normal Ped" , true], - [48 , "Normal Ped" , true], - [49 , "Snakehead (Da Nang)" , true], - [50 , "Mechanic" , true], - [51 , "Mountain Biker" , true], - [52 , "Mountain Biker" , true], - [53 , "Unknown" , true], - [54 , "Normal Ped" , true], - [55 , "Normal Ped" , true], - [56 , "Normal Ped" , true], - [57 , "Oriental Ped" , true], - [58 , "Oriental Ped" , true], - [59 , "Normal Ped" , true], - [60 , "Normal Ped" , true], - [61 , "Pilot" , false], - [62 , "Colonel Fuhrberger" , true], - [63 , "Prostitute" , true], - [64 , "Prostitute" , true], - [66 , "Pool Player" , true], - [67 , "Pool Player" , true], - [68 , "Priest/Preacher" , true], - [69 , "Normal Ped" , true], - [70 , "Scientist" , true], - [71 , "Security Guard" , false], - [72 , "Hippy" , true], - [73 , "Hippy" , true], - [75 , "Prostitute" , true], - [76 , "Stewardess" , true], - [77 , "Homeless" , true], - [78 , "Homeless" , true], - [79 , "Homeless" , true], - [80 , "Boxer" , true], - [81 , "Boxer" , true], - [82 , "Black Elvis" , true], - [83 , "White Elvis" , true], - [84 , "Blue Elvis" , true], - [85 , "Prostitute" , true], - [87 , "Stripper" , true], - [88 , "Normal Ped" , true], - [89 , "Normal Ped" , true], - [90 , "Jogger" , true], - [91 , "Rich Woman" , true], - [92 , "Rollerskater" , true], - [93 , "Normal Ped" , true], - [94 , "Normal Ped" , true], - [95 , "Normal Ped" , true], - [96 , "Jogger" , true], - [97 , "Lifeguard" , true], - [98 , "Normal Ped" , true], - [99 , "Rollerskater" , true], - [100, "Biker" , true], - [101, "Normal Ped" , true], - [102, "Ballas Gang Member" , true], - [103, "Ballas Gang Member" , true], - [104, "Ballas Gang Member" , true], - [105, "Grove Street Families Gang Member" , true], - [106, "Grove Street Families Gang Member" , true], - [107, "Grove Street Families Gang Member" , true], - [108, "Los Santos Vagos Gang Member" , true], - [109, "Los Santos Vagos Gang Member" , true], - [110, "Los Santos Vagos Gang Member" , true], - [111, "Russian Mafioso" , true], - [112, "Russian Mafioso" , true], - [113, "Russian Mafioso" , true], - [114, "Varios Los Aztecas Gang Member" , true], - [115, "Varios Los Aztecas Gang Member" , true], - [116, "Varios Los Aztecas Gang Member" , true], - [117, "Triad" , true], - [118, "Triad" , true], - [120, "Triad Boss" , true], - [121, "Da Nang Boy" , true], - [122, "Da Nang Boy" , true], - [123, "Da Nang Boy" , true], - [124, "Italian Mafioso" , true], - [125, "Italian Mafioso" , true], - [126, "Italian Mafioso" , true], - [127, "Italian Mafioso" , true], - [128, "Farm Inhabitant" , true], - [129, "Farm Inhabitant" , true], - [130, "Farm Inhabitant" , true], - [131, "Farm Inhabitant" , true], - [132, "Farm Inhabitant" , true], - [133, "Farm Inhabitant" , true], - [134, "Homeless" , true], - [135, "Homeless" , true], - [136, "Normal Ped" , true], - [137, "Homeless" , true], - [138, "Beach Visitor" , true], - [139, "Beach Visitor" , true], - [140, "Beach Visitor" , true], - [141, "Businesswoman" , true], - [142, "Taxi Driver" , true], - [143, "Crack Maker" , true], - [144, "Crack Maker" , true], - [145, "Crack Maker" , true], - [146, "Crack Maker" , true], - [147, "Businessman" , true], - [148, "Businesswoman" , true], - [150, "Businesswoman" , true], - [151, "Normal Ped" , true], - [152, "Prostitute" , true], - [153, "Construction Worker" , true], - [154, "Beach Visitor" , true], - [155, "Well Stacked Pizza Worker" , true], - [156, "Barber" , true], - [157, "Hillbilly" , true], - [158, "Farmer" , true], - [159, "Hillbilly" , true], - [160, "Hillbilly" , true], - [161, "Farmer" , true], - [162, "Hillbilly" , true], - [163, "Black Bouncer" , true], - [164, "White Bouncer" , true], - [165, "White MIB Agent" , false], - [166, "Black MIB Agent" , false], - [167, "Cluckin Bell Worker" , true], - [168, "Hotdog/Chilli Dog Vendor" , true], - [169, "Normal Ped" , true], - [170, "Normal Ped" , true], - [171, "Blackjack Dealer" , true], - [172, "Casino Croupier" , true], - [173, "San Fierro Rifa" , true], - [174, "San Fierro Rifa" , true], - [175, "San Fierro Rifa" , true], - [176, "Barber" , true], - [177, "Barber" , true], - [178, "Whore" , true], - [179, "Ammunation Salesman" , true], - [180, "Tattoo Artist" , true], - [181, "Punk" , true], - [182, "Cab Driver" , true], - [183, "Normal Ped" , true], - [184, "Normal Ped" , true], - [185, "Normal Ped" , true], - [186, "Normal Ped" , true], - [187, "Businessman" , true], - [188, "Normal Ped" , true], - [189, "Valet" , true], - [190, "Barbara Schternvart" , true], - [191, "Helena Wankstein" , true], - [192, "Michelle Cannes" , true], - [193, "Katie Zhan" , true], - [194, "Millie Perkins" , true], - [195, "Denise Robinson" , true], - [196, "Farm-Town Inhabitant" , true], - [197, "Hillbilly" , true], - [198, "Farm-Town Inhabitant" , true], - [199, "Farm-Town Inhabitant" , true], - [200, "Hillbilly" , true], - [201, "Farmer" , true], - [202, "Farmer" , true], - [203, "Karate Teacher" , true], - [204, "Karate Teacher" , true], - [205, "Burger Shot Cashier" , true], - [206, "Cab Driver" , true], - [207, "Prostitute" , true], - [209, "Oriental Noodle Stand Vendor" , true], - [210, "Oriental Boating School Instructor", true], - [211, "Clothes Shop Staff" , true], - [212, "Homeless" , true], - [213, "Weird Old Man" , true], - [214, "Waitress (Maria Latore)" , true], - [215, "Normal Ped" , true], - [216, "Normal Ped" , true], - [217, "Clothes Shop Staff" , true], - [218, "Normal Ped" , true], - [219, "Rich Woman" , true], - [220, "Cab Driver" , true], - [221, "Normal Ped" , true], - [222, "Normal Ped" , true], - [223, "Normal Ped" , true], - [224, "Normal Ped" , true], - [225, "Normal Ped" , true], - [226, "Normal Ped" , true], - [227, "Oriental Businessman" , true], - [228, "Oriental Ped" , true], - [229, "Oriental Ped" , true], - [230, "Homeless" , true], - [231, "Normal Ped" , true], - [232, "Normal Ped" , true], - [233, "Normal Ped" , true], - [234, "Cab Driver" , true], - [235, "Normal Ped" , true], - [236, "Normal Ped" , true], - [237, "Prostitute" , true], - [238, "Prostitute" , true], - [239, "Homeless" , true], - [240, "The D.A" , true], - [241, "Afro-American" , true], - [242, "Mexican" , true], - [243, "Prostitute" , true], - [244, "Stripper" , true], - [245, "Prostitute" , true], - [246, "Stripper" , true], - [247, "Biker" , true], - [248, "Biker" , true], - [249, "Pimp" , true], - [250, "Normal Ped" , true], - [251, "Lifeguard" , true], - [252, "Naked Valet" , true], - [253, "Bus Driver" , false], - [254, "Biker Drug Dealer" , true], - [255, "Chauffeur (Limo Driver)" , true], - [256, "Stripper" , true], - [257, "Stripper" , true], - [258, "Heckler" , true], - [259, "Heckler" , true], - [260, "Construction Worker" , true], - [261, "Cab Driver" , true], - [262, "Cab Driver" , true], - [263, "Normal Ped" , true], - [264, "Clown (Ice-Cream Van Driver)" , true], - [265, "Officer Frank Tenpenny" , false], - [266, "Officer Eddie Pulaski" , false], - [267, "Officer Jimmy Hernandez" , false], - [268, "Dwaine/Dwayne" , true], - [269, "Melvin Big Smoke Harris (Mission)" , true], - [270, "Sean Sweet Johnson" , true], - [271, "Lance Ryder Wilson" , true], - [272, "Mafia Boss" , true], - [274, "Paramedic" , false], - [275, "Paramedic" , false], - [276, "Paramedic" , false], - [277, "Firefighter" , false], - [278, "Firefighter" , false], - [279, "Firefighter" , false], - [280, "Los Santos Police Officer" , false], - [281, "San Fierro Police Officer" , false], - [282, "Las Venturas Police Officer" , false], - [283, "County Sheriff" , false], - [284, "Motorbike Cop" , false], - [285, "S.W.A.T." , false], - [286, "Federal Agent" , false], - [287, "Army Soldier" , false], - [288, "Desert Sheriff" , false], - [290, "Ken Rosenberg" , true], - [291, "Kent Paul" , true], - [292, "Cesar Vialpando" , true], - [293, "Jeffery Og Loc Martin/Cross" , true], - [294, "Wu Zi Mu (Woozie)" , true], - [295, "Michael Toreno" , true], - [296, "Jizzy B." , true], - [297, "Madd Dogg" , true], - [298, "Catalina" , true], - [299, "Claude Speed" , true], - [300, "Lance Ryder Wilson" , true], - [301, "Lance Ryder Wilson (robbery mask)" , true], - [302, "Emmet" , true], - [303, "Unknown" , false], - [304, "Denise" , true], - [305, "Jethro" , true], - [306, "Zero" , true], - [307, "T-Bone Mendez" , true], - [308, "Forelli" , true], - [309, "Mechanic" , true], - [310, "Barry Big Bear Thorne (Skinny)" , true], - [311, "Melvin Big Smoke Harris (Vest)" , true], - [312, "Army Guy" , true], - [313, "Barry Big Bear Thorne (Fat)" , true], - ], + [ // GTA San Andreas + [0 , "Carl 'CJ' Johnson" , false], + [1 , "The Truth" , true], + [2 , "Maccer" , true], + [6 , "Taxi Driver/Train Driver" , true], + [9 , "Normal Ped" , true], + [10 , "Old Woman" , true], + [11 , "Casino Croupier" , false], + [12 , "Rich Woman" , true], + [13 , "Street Girl" , true], + [14 , "Normal Ped" , true], + [15 , "Mr.Whittaker (RS Haul Owner)" , true], + [16 , "Airport Ground Worker" , true], + [17 , "Businessman" , true], + [18 , "Beach Visitor" , true], + [19 , "DJ" , true], + [20 , "Rich Guy (Madd Doggs Manager)" , true], + [21 , "Normal Ped" , true], + [22 , "Normal Ped" , true], + [23 , "Bmxer" , true], + [24 , "Madd Dogg Bodyguard" , true], + [25 , "Madd Dogg Bodyguard" , true], + [26 , "Backpacker" , true], + [27 , "Construction Worker" , true], + [28 , "Drug Dealer" , true], + [29 , "Drug Dealer" , true], + [30 , "Drug Dealer" , true], + [31 , "Farm-Town Inhabitant" , true], + [32 , "Farm-Town Inhabitant" , true], + [33 , "Farm-Town Inhabitant" , true], + [34 , "Farm-Town Inhabitant" , true], + [35 , "Gardener" , true], + [36 , "Golfer" , true], + [37 , "Golfer" , true], + [38 , "Normal Ped" , true], + [39 , "Normal Ped" , true], + [40 , "Normal Ped" , true], + [41 , "Normal Ped" , true], + [43 , "Normal Ped" , true], + [44 , "Normal Ped" , true], + [45 , "Beach Visitor" , true], + [46 , "Normal Ped" , true], + [47 , "Normal Ped" , true], + [48 , "Normal Ped" , true], + [49 , "Snakehead (Da Nang)" , true], + [50 , "Mechanic" , true], + [51 , "Mountain Biker" , true], + [52 , "Mountain Biker" , true], + [53 , "Unknown" , true], + [54 , "Normal Ped" , true], + [55 , "Normal Ped" , true], + [56 , "Normal Ped" , true], + [57 , "Oriental Ped" , true], + [58 , "Oriental Ped" , true], + [59 , "Normal Ped" , true], + [60 , "Normal Ped" , true], + [61 , "Pilot" , false], + [62 , "Colonel Fuhrberger" , true], + [63 , "Prostitute" , true], + [64 , "Prostitute" , true], + [66 , "Pool Player" , true], + [67 , "Pool Player" , true], + [68 , "Priest/Preacher" , true], + [69 , "Normal Ped" , true], + [70 , "Scientist" , true], + [71 , "Security Guard" , false], + [72 , "Hippy" , true], + [73 , "Hippy" , true], + [75 , "Prostitute" , true], + [76 , "Stewardess" , true], + [77 , "Homeless" , true], + [78 , "Homeless" , true], + [79 , "Homeless" , true], + [80 , "Boxer" , true], + [81 , "Boxer" , true], + [82 , "Black Elvis" , true], + [83 , "White Elvis" , true], + [84 , "Blue Elvis" , true], + [85 , "Prostitute" , true], + [87 , "Stripper" , true], + [88 , "Normal Ped" , true], + [89 , "Normal Ped" , true], + [90 , "Jogger" , true], + [91 , "Rich Woman" , true], + [92 , "Rollerskater" , true], + [93 , "Normal Ped" , true], + [94 , "Normal Ped" , true], + [95 , "Normal Ped" , true], + [96 , "Jogger" , true], + [97 , "Lifeguard" , true], + [98 , "Normal Ped" , true], + [99 , "Rollerskater" , true], + [100, "Biker" , true], + [101, "Normal Ped" , true], + [102, "Ballas Gang Member" , true], + [103, "Ballas Gang Member" , true], + [104, "Ballas Gang Member" , true], + [105, "Grove Street Families Gang Member" , true], + [106, "Grove Street Families Gang Member" , true], + [107, "Grove Street Families Gang Member" , true], + [108, "Los Santos Vagos Gang Member" , true], + [109, "Los Santos Vagos Gang Member" , true], + [110, "Los Santos Vagos Gang Member" , true], + [111, "Russian Mafioso" , true], + [112, "Russian Mafioso" , true], + [113, "Russian Mafioso" , true], + [114, "Varios Los Aztecas Gang Member" , true], + [115, "Varios Los Aztecas Gang Member" , true], + [116, "Varios Los Aztecas Gang Member" , true], + [117, "Triad" , true], + [118, "Triad" , true], + [120, "Triad Boss" , true], + [121, "Da Nang Boy" , true], + [122, "Da Nang Boy" , true], + [123, "Da Nang Boy" , true], + [124, "Italian Mafioso" , true], + [125, "Italian Mafioso" , true], + [126, "Italian Mafioso" , true], + [127, "Italian Mafioso" , true], + [128, "Farm Inhabitant" , true], + [129, "Farm Inhabitant" , true], + [130, "Farm Inhabitant" , true], + [131, "Farm Inhabitant" , true], + [132, "Farm Inhabitant" , true], + [133, "Farm Inhabitant" , true], + [134, "Homeless" , true], + [135, "Homeless" , true], + [136, "Normal Ped" , true], + [137, "Homeless" , true], + [138, "Beach Visitor" , true], + [139, "Beach Visitor" , true], + [140, "Beach Visitor" , true], + [141, "Businesswoman" , true], + [142, "Taxi Driver" , true], + [143, "Crack Maker" , true], + [144, "Crack Maker" , true], + [145, "Crack Maker" , true], + [146, "Crack Maker" , true], + [147, "Businessman" , true], + [148, "Businesswoman" , true], + [150, "Businesswoman" , true], + [151, "Normal Ped" , true], + [152, "Prostitute" , true], + [153, "Construction Worker" , true], + [154, "Beach Visitor" , true], + [155, "Well Stacked Pizza Worker" , true], + [156, "Barber" , true], + [157, "Hillbilly" , true], + [158, "Farmer" , true], + [159, "Hillbilly" , true], + [160, "Hillbilly" , true], + [161, "Farmer" , true], + [162, "Hillbilly" , true], + [163, "Black Bouncer" , true], + [164, "White Bouncer" , true], + [165, "White MIB Agent" , false], + [166, "Black MIB Agent" , false], + [167, "Cluckin Bell Worker" , true], + [168, "Hotdog/Chilli Dog Vendor" , true], + [169, "Normal Ped" , true], + [170, "Normal Ped" , true], + [171, "Blackjack Dealer" , true], + [172, "Casino Croupier" , true], + [173, "San Fierro Rifa" , true], + [174, "San Fierro Rifa" , true], + [175, "San Fierro Rifa" , true], + [176, "Barber" , true], + [177, "Barber" , true], + [178, "Whore" , true], + [179, "Ammunation Salesman" , true], + [180, "Tattoo Artist" , true], + [181, "Punk" , true], + [182, "Cab Driver" , true], + [183, "Normal Ped" , true], + [184, "Normal Ped" , true], + [185, "Normal Ped" , true], + [186, "Normal Ped" , true], + [187, "Businessman" , true], + [188, "Normal Ped" , true], + [189, "Valet" , true], + [190, "Barbara Schternvart" , true], + [191, "Helena Wankstein" , true], + [192, "Michelle Cannes" , true], + [193, "Katie Zhan" , true], + [194, "Millie Perkins" , true], + [195, "Denise Robinson" , true], + [196, "Farm-Town Inhabitant" , true], + [197, "Hillbilly" , true], + [198, "Farm-Town Inhabitant" , true], + [199, "Farm-Town Inhabitant" , true], + [200, "Hillbilly" , true], + [201, "Farmer" , true], + [202, "Farmer" , true], + [203, "Karate Teacher" , true], + [204, "Karate Teacher" , true], + [205, "Burger Shot Cashier" , true], + [206, "Cab Driver" , true], + [207, "Prostitute" , true], + [209, "Oriental Noodle Stand Vendor" , true], + [210, "Oriental Boating School Instructor", true], + [211, "Clothes Shop Staff" , true], + [212, "Homeless" , true], + [213, "Weird Old Man" , true], + [214, "Waitress (Maria Latore)" , true], + [215, "Normal Ped" , true], + [216, "Normal Ped" , true], + [217, "Clothes Shop Staff" , true], + [218, "Normal Ped" , true], + [219, "Rich Woman" , true], + [220, "Cab Driver" , true], + [221, "Normal Ped" , true], + [222, "Normal Ped" , true], + [223, "Normal Ped" , true], + [224, "Normal Ped" , true], + [225, "Normal Ped" , true], + [226, "Normal Ped" , true], + [227, "Oriental Businessman" , true], + [228, "Oriental Ped" , true], + [229, "Oriental Ped" , true], + [230, "Homeless" , true], + [231, "Normal Ped" , true], + [232, "Normal Ped" , true], + [233, "Normal Ped" , true], + [234, "Cab Driver" , true], + [235, "Normal Ped" , true], + [236, "Normal Ped" , true], + [237, "Prostitute" , true], + [238, "Prostitute" , true], + [239, "Homeless" , true], + [240, "The D.A" , true], + [241, "Afro-American" , true], + [242, "Mexican" , true], + [243, "Prostitute" , true], + [244, "Stripper" , true], + [245, "Prostitute" , true], + [246, "Stripper" , true], + [247, "Biker" , true], + [248, "Biker" , true], + [249, "Pimp" , true], + [250, "Normal Ped" , true], + [251, "Lifeguard" , true], + [252, "Naked Valet" , true], + [253, "Bus Driver" , false], + [254, "Biker Drug Dealer" , true], + [255, "Chauffeur (Limo Driver)" , true], + [256, "Stripper" , true], + [257, "Stripper" , true], + [258, "Heckler" , true], + [259, "Heckler" , true], + [260, "Construction Worker" , true], + [261, "Cab Driver" , true], + [262, "Cab Driver" , true], + [263, "Normal Ped" , true], + [264, "Clown (Ice-Cream Van Driver)" , true], + [265, "Officer Frank Tenpenny" , false], + [266, "Officer Eddie Pulaski" , false], + [267, "Officer Jimmy Hernandez" , false], + [268, "Dwaine/Dwayne" , true], + [269, "Melvin Big Smoke Harris (Mission)" , true], + [270, "Sean Sweet Johnson" , true], + [271, "Lance Ryder Wilson" , true], + [272, "Mafia Boss" , true], + [274, "Paramedic" , false], + [275, "Paramedic" , false], + [276, "Paramedic" , false], + [277, "Firefighter" , false], + [278, "Firefighter" , false], + [279, "Firefighter" , false], + [280, "Los Santos Police Officer" , false], + [281, "San Fierro Police Officer" , false], + [282, "Las Venturas Police Officer" , false], + [283, "County Sheriff" , false], + [284, "Motorbike Cop" , false], + [285, "S.W.A.T." , false], + [286, "Federal Agent" , false], + [287, "Army Soldier" , false], + [288, "Desert Sheriff" , false], + [290, "Ken Rosenberg" , true], + [291, "Kent Paul" , true], + [292, "Cesar Vialpando" , true], + [293, "Jeffery Og Loc Martin/Cross" , true], + [294, "Wu Zi Mu (Woozie)" , true], + [295, "Michael Toreno" , true], + [296, "Jizzy B." , true], + [297, "Madd Dogg" , true], + [298, "Catalina" , true], + [299, "Claude Speed" , true], + [300, "Lance Ryder Wilson" , true], + [301, "Lance Ryder Wilson (robbery mask)" , true], + [302, "Emmet" , true], + [303, "Unknown" , false], + [304, "Denise" , true], + [305, "Jethro" , true], + [306, "Zero" , true], + [307, "T-Bone Mendez" , true], + [308, "Forelli" , true], + [309, "Mechanic" , true], + [310, "Barry Big Bear Thorne (Skinny)" , true], + [311, "Melvin Big Smoke Harris (Vest)" , true], + [312, "Army Guy" , true], + [313, "Barry Big Bear Thorne (Fat)" , true], + ], - [ // Underground + [ // Underground - ], + ], - [ // GTA IV - [-2020305438,"Male Multiplayer" , false], - [-641875910 ,"Female Multiplayer" , false], - [-1370810922,"MODEL_SUPERLOD" , false], - [ 1853617247,"Anna" , true], - [-1646893330,"Anthony" , true], - [ 1495769888,"Badman" , true], - [ 1500493064,"Bernie Crane" , true], - [ 1731510984,"Bledar" , true], - [ 422305098 ,"Brian" , true], - [-1729980128,"Brucie" , true], - [ 237511807 ,"Bulgarin" , true], - [ 88667657 ,"Charise" , true], - [-1328445565,"Charlie Undercover" , false], - [ 1343144208,"Clarence" , true], - [ 1468450703,"Dardan" , true], - [ 386513184 ,"Darko" , true], - [ 1169442297,"Derric" , true], - [ 237497537 ,"Dmitri" , true], - [-617264103 ,"Dwayne" , true], - [-1600585231,"Eddie" , true], - [ 57218969 ,"Faustin" , true], - [ 1710545037,"Francis" , true], - [ 1424670436,"French Tom" , true], - [ 2129490787,"Gordon" , true], - [-357652594 ,"Gracie" , true], - [ 980768434 ,"Hossan" , true], - [-835225126 ,"Ilyena" , true], - [-479595866 ,"Issac" , true], - [ 1166762483,"Ivan" , true], - [ 364686627 ,"Jay" , true], - [ 170756246 ,"Jason" , true], - [ 390357829 ,"Jeff" , true], - [-366421228 ,"Jimmy" , true], - [-911507684 ,"Johnny Klebitz" , true], - [-773750838 ,"Kate" , true], - [ 995576506 ,"Kenny" , true], - [ 1487004273,"Lil Jacob" , true], - [-1275031987,"Lil Jacob 2," , true], - [-681942840 ,"Luca" , true], - [-492470690 ,"Luis" , true], - [-1040287406,"Mallorie" , true], - [-322700377 ,"Mam" , true], - [ 1445589009,"Manny" , true], - [ 411185872 ,"Marnie" , true], - [-807339118 ,"Mel" , true], - [ 735211577 ,"Michael" , true], - [-1080659212,"Michelle" , true], - [-636669566 ,"Mickey" , true], - [ 1690783035,"Packie" , true], - [-165448092 ,"Pathos" , true], - [-1947682830,"Petrovic" , true], - [-1826458934,"Phil Bell" , true], - [ 1794146792,"Playboy X" , true], - [ 954215094 ,"Ray Boccino" , true], - [-587324132 ,"Ricky" , true], - [-1992728631,"Roman" , true], - [ 558221221 ,"Roman 2," , true], - [-17823883 ,"Sarah" , true], - [ 1384833284,"Tuna" , true], - [-1014976873,"Vinny Spaz" , true], - [ 896408642 ,"Vlad" , true], - [-301223260 ,"Black Street Thug 1," , true], - [-1143910864,"Black Street Thug 2," , true], - [ 869501081 ,"Black Street OG 1," , true], - [ 632613980 ,"Black Street OG 1," , true], - [-503930010 ,"Albanian Thug 1," , true], - [-235584669 ,"Albanian Thug 2," , true], - [ 207714363 ,"Albanian Thug 3," , true], - [ 514268366 ,"Albanian Thug 4," , true], - [ 43005364 ,"Biker 1," , true], - [ 1346668127,"Biker 2," , true], - [-1677255197,"Biker 3," , true], - [-1461281345,"Biker 4," , true], - [ 1574850459,"Biker 5," , true], - [-1953289472,"Biker 6," , true], - [ 280474699 ,"Irish Man 1," , true], - [-19263344 ,"Irish Man 2," , true], - [ 1844702918,"Irish Man 3," , true], - [ 1609755055,"Jamaican OG 1," , true], - [-330497431 ,"Jamaican OG 2," , true], - [ 1117105909,"Jamaican OG 3," , true], - [-1500397869,"Jamaican Thug 1," , true], - [-881358690 ,"Jamaican Thug 2," , true], - [ 1540383669,"Asian Man 1," , true], - [ 764249904 ,"Asian Man 2," , true], - [ 492147228 ,"Hispanic Man 1," , true], - [-1926041127,"Hispanic Man 2," , true], - [ 1168388225,"Hispanic Man 3," , true], - [-1746774780,"Hispanic Man 4," , true], - [-302362397 ,"Fat Italian Mafia Boss" , true], - [-1616890832,"Italian Mafia Boss" , true], - [ 64730935 ,"Italian Mafia Associate" , true], - [ 510389335 ,"Fat Italian Mafia Associate" , true], - [-1836006237,"Russian Thug 1," , true], - [-2088164056,"Russian Thug 2," , true], - [ 1976502708,"Russian Thug 3," , true], - [ 1543404628,"Russian Thug 4," , true], - [ 1865532596,"Russian Thug 5," , true], - [ 431692232 ,"Russian Thug 6," , true], - [ 1724587620,"Russian Thug 7," , true], - [-1180674815,"Russian Thug 8," , true], - [ 871281791 ,"Triad Boss 1," , true], - [ 683712035 ,"Triad Boss 2," , true], - [-1084007777,"Triad Member 3," , true], - [-164935626 ,"Triad Member 4," , true], - [-751071255 ,"Female Maid" , true], - [-109247258 ,"Female Binco Worker" , false], - [ 1366257926,"Female Bank Teller" , true], - [ 346338575 ,"Female Doctor" , true], - [ 1350216795,"Female Gym Worker" , true], - [ 924926104 ,"Female Burger Shot Worker" , false], - [-346378101 ,"Female Cluckin Bell Worker" , false], - [-2104311883,"Female Rockstar Cafe Worker" , false], - [ 212900845 ,"Female TW@ Cafe Worker" , false], - [-290070895 ,"Female Well Stacked Pizza Worker", false], - [ 552542187 ,"Hooker" , true], - [ 996267216 ,"Hooker 2," , true], - [-1193778389,"Nurse" , true], - [ 1113677074,"Stripper 1," , true], - [ 1353709999,"Stripper 2," , true], - [ 24233425 ,"Waitress" , true], - [-1761003415,"Alcoholic Man" , true], - [ 1075583233,"Armoured Truck Driver" , false], - [ 134077503 ,"Bus Driver" , false], - [ 757349871 ,"Generic Asian Man" , true], - [-1827421800,"Black Crackhead" , true], - [ 219393781 ,"Doctor (Scrubs)" , true], - [-1186940778,"Doctor" , true], - [ 375732086 ,"Doctor (Blood Covered Coat)" , true], - [ 2105015949,"Cook" , true], - [-200234085 ,"Italian Mob Enforcer" , true], - [ 800131009 ,"Factory Worker" , true], - [-999506922 ,"FIB Agent" , false], - [-1993909080,"Fat Delivery Driver" , true], - [ 610888851 ,"Fire Chief" , false], - [ 486302863 ,"Mercenary Soldier" , false], - [-778316080 ,"Helicopter Pilot" , false], - [ 624314380 ,"Hotel Doorman" , true], - [-1784833142,"Korean Cook" , true], - [-1852976689,"Lawyer 1," , true], - [-1134712978,"Lawyer 2," , true], - [ 379171768 ,"Loony Black Man" , true], - [-1945168882,"Pilot" , false], - [ 807236245 ,"Generic Man" , true], - [-284362863 ,"Postal Worker" , true], - [-1188246269,"Saxophone Player" , true], - [-1870989171,"Security Guard" , false], - [ 420915580 ,"Stadium Food Vendor" , true], - [ 1878085135,"Stadium Food Cook" , true], - [ 142730876 ,"Street Food Vendor" , true], - [-690681764 ,"Street Sweeper Driver" , true], - [ 8772846 ,"Taxi Driver" , true], - [ 1186270890,"Telephone Company Worker" , true], - [-379234846 ,"Tennis Player" , true], - [ 1159759556,"Train Conductor" , false], - [-142386662 ,"Homeless Black Man" , true], - [-46564867 ,"Trucker" , true], - [-1284047560,"Janitor" , true], - [ 22944263 ,"Hotel Doorman 2," , true], - [ 1178487645,"Mob Boss" , true], - [-1464712858,"Airport Worker" , false], - [-2139064254,"Bartender" , true], - [-1780698891,"Biker Bouncer" , true], - [-409283472 ,"High End Club Bouncer" , true], - [-799229885 ,"Bowling Alley Worker" , true], - [-434183225 ,"Bowling Alley Worker 2," , true], - [ 768442188 ,"Chinese Food Vendor" , true], - [ 676448572 ,"Club Security" , true], - [-722019798 ,"Construction Worker" , true], - [-1015957728,"Construction Worker 2," , true], - [-714220780 ,"Construction Worker 3," , true], - [-183203150 ,"Police Officer" , false], - [-1518937979,"Traffic Officer" , false], - [-370395528 ,"Fat Police Officer" , false], - [-1371133859,"Courier" , true], - [-573788283 ,"Cowboy 1," , true], - [-1283406538,"Drug Dealer 1," , true], - [ 1448755353,"Drug Dealer 2," , true], - [ 989485 ,"Male Burger Shot Worker" , true], - [-1011530423,"Male Cluckin Bell Worker" , true], - [ 1979561477,"Male Rockstar Cafe Worker" , true], - [-786449781 ,"Male TW@ Cafe Worker" , true], - [ 206941425 ,"Male Well Stacked Pizza Worker" , true], - [-610224615 ,"Firefighter" , false], - [ 1136499716,"Garbage Collector" , false], - [ 897868981 ,"Goon" , true], - [-1902758612,"Male Gym Worker" , true], - [-356904519 ,"Mechanic 2," , true], - [-1056268969,"Male Modo Worker" , true], - [ 1201610759,"Helicopter Pilot 2" , false], - [-151000142 ,"Perseus" , true], - [ 501136335 ,"Generic Male 1," , true], - [ 186619473 ,"Generic Male 2," , true], - [-111611196 ,"Generic Male 3," , true], - [-1175077216,"Paramedic" , false], - [-1676937780,"Prisoner" , false], - [ 215190023 ,"Prisoner 2," , false], - [ 1552970117,"Roman's Taxi Service Driver" , true], - [-1481923910,"Male Runner" , true], - [ 357919731 ,"Male Shop Assistant 1," , true], - [-89302119 ,"State Trooper" , false], - [-1004762946,"SWAT" , false], - [-64233032 ,"Sword Swallower" , true], - [-1292254815,"Thief" , true], - [ 271284208 ,"Valet" , true], - [-186113957 ,"Vendor" , true], - [-2015686009,"French Tom" , true], - [ 1977784957,"Jim Fitz" , true], - [-203833294 ,"East European Woman" , true], - [ 189853472 ,"East European Woman 2," , true], - [-349043578 ,"Woman" , true], - [-114937692 ,"Jersey Woman" , true], - [-1697333660,"Oriental Woman" , true], - [ 100706569 ,"Rich Woman" , true], - [ 155063868 ,"Business Woman 1," , true], - [ 394310337 ,"Business Woman 2," , true], - [ 1375728805,"Chinatown Woman" , true], - [-284229525 ,"Business Woman 3," , true], - [ 677687516 ,"East European Woman 3," , true], - [-1188238883,"Fat Black Woman" , true], - [-2075220936,"Jersey Woman 1," , true], - [-1356924456,"Jersey Woman 2," , true], - [ 812112483 ,"Fat Hispanic Woman 1," , true], - [-129242580 ,"Fat Hispanic Woman 2," , true], - [ 852423121 ,"White Manhattan Woman" , true], - [ 76551508 ,"Black Manhattan Woman" , true], - [-2118501976,"Old Asian Woman" , true], - [ 1616769823,"Old Rich Woman" , true], - [ 453889158 ,"Business Woman 4," , true], - [ 824245375 ,"Asian Woman in Dress" , true], - [-1362442041,"Fat Black Bronx Woman" , true], - [-1788328884,"Random White Woman" , true], - [-1523915823,"Random Hispanic Woman" , true], - [-949987237 ,"Random Eastern European Woman" , true], - [-1926577323,"Random Black Woman" , true], - [ 168065679 ,"Black Harlem Woman 1," , true], - [ 441464 ,"Fat Jersey Woman 1," , true], - [ 54114008 ,"Fat Hispanic Woman 3," , true], - [-292713088 ,"Hispanic Woman 1," , true], - [ 1743814728,"Hispanic Woman 2," , true], - [ 1670568326,"Manhattan Woman 1," , true], - [ 1354281938,"Manhattan Woman 2," , true], - [ 1056837725,"Manhattan Woman 1," , true], - [-1193633577,"Asian Woman 1," , true], - [ 713691120 ,"Black Woman 2," , true], - [-1780385799,"Rich White Woman 1," , true], - [-952185135 ,"Asian Woman" , true], - [ 1586287288,"Female Shopper 1," , true], - [ 1848013291,"Female Shopper 2," , true], - [-1702036227,"Female Shopper 3," , true], - [ 1182843182,"Female Socialite 1," , true], - [-900623157 ,"Street Woman 1," , true], - [ 286007875 ,"Street Woman 2," , true], - [ 1473654742,"Street Woman 3," , true], - [-1850743775,"Street Woman 4," , true], - [ 1290755317,"Street Woman 5," , true], - [ 1872110126,"Street Woman 6," , true], - [ 1754440500,"Tourist Woman 1," , true], - [ 761763258 ,"MODEL_F_Y_VILLBO_01," , true], - [-636579119 ,"Business Man 1," , true], - [-1754526315,"Business Man 2," , true], - [-1516474414,"Street Criminal 1," , true], - [-1821258883,"Street Criminal 2," , true], - [ 1952671026,"Obese Mafia Thug" , true], - [-1991603022,"Gay Man 1," , true], - [-1080673049,"Homeless Bum 1," , true], - [ 495499562 ,"Loony White Man 1," , true], - [-1984134881,"MODEL_M_M_MIDTOWN_01," , true], - [ 1063816580,"Business Man 2," , true], - [ 208763854 ,"Eastern European Man 1," , true], - [-1020237172,"Fat Black Man 2," , true], - [ 1782277836,"MODEL_M_M_PINDUS_02," , true], - [-1402442039,"Fat Italian Man 1," , true], - [-1628417063,"Italian Man 2," , true], - [ 1158569407,"Hispanic Man 1," , true], - [ 1969438324,"Hispanic Man 2," , true], - [ 1621955848,"Hispanic Man 3," , true], - [-657489059 ,"Tourist Man 1," , true], - [-1307068958,"Black Business Man 1," , true], - [ 734334931 ,"Asian Man 3," , true], - [ 1865082075,"MODEL_M_M_PRICH_01," , true], - [-432593815 ,"MODEL_M_O_EASTEURO_01," , true], - [-1639359785,"Hasidic Jewish Man 1," , true], - [ 1656087115,"Old Man 1," , true], - [ 2034185905,"MODEL_M_O_PEASTEURO_02," , true], - [ 1316404726,"MODEL_M_O_PHARBRON_01," , true], - [ 980990533 ,"MODEL_M_O_PJERSEY_01," , true], - [-1298691925,"MODEL_M_O_STREET_01," , true], - [ 243672348 ,"Old Business Man" , true], - [ 2085884255,"MODEL_M_Y_BOHO_01," , true], - [ 221246143 ,"MODEL_M_Y_BOHOGUY_01," , true], - [ 52357603 ,"MODEL_M_Y_BRONX_01," , true], - [ 1530937394,"Black Business Man 2," , true], - [ 690281432 ,"Black Business Man 3," , true], - [-1149743642,"Asian Man 4," , true], - [-314369597 ,"Chopshop Mechanic 1," , true], - [-552829610 ,"Chopshop Mechanic 2," , true], - [-1097188138,"MODEL_M_Y_DODGY_01," , true], - [-1775659292,"MODEL_M_Y_DORK_02," , true], - [ 1207402441,"MODEL_M_Y_DOWNTOWN_01," , true], - [ 1500619449,"MODEL_M_Y_DOWNTOWN_02," , true], - [ 594261682 ,"MODEL_M_Y_DOWNTOWN_03," , true], - [-747824291 ,"MODEL_M_Y_GAYYOUNG" , true], - [-677160979 ,"MODEL_M_Y_GENSTREET_11," , true], - [-1678614360,"MODEL_M_Y_GENSTREET_16," , true], - [ 989044076 ,"MODEL_M_Y_GENSTREET_20," , true], - [ 1180218190,"MODEL_M_Y_GENSTREET_34," , true], - [-1420592428,"MODEL_M_Y_HARDMAN_01," , true], - [-1222963415,"MODEL_M_Y_HARLEM_01," , true], - [-1746153269,"MODEL_M_Y_HARLEM_02," , true], - [ 2104499156,"MODEL_M_Y_HARLEM_04," , true], - [-1874580889,"Hasidic Jewish Man 2," , true], - [-1055386282,"MODEL_M_Y_LEASTSIDE_01," , true], - [ 575808580 ,"MODEL_M_Y_PBRONX_01," , true], - [-71980543 ,"MODEL_M_Y_PCOOL_01," , true], - [-195159218 ,"MODEL_M_Y_PCOOL_02," , true], - [ 697247370 ,"MODEL_M_Y_PEASTEURO_01," , true], - [ 670406267 ,"MODEL_M_Y_PHARBRON_01," , true], - [ 26615298 ,"MODEL_M_Y_PHARLEM_01," , true], - [ 1542927558,"MODEL_M_Y_PJERSEY_01," , true], - [-1806886352,"MODEL_M_Y_PLATIN_01," , true], - [-1022920796,"MODEL_M_Y_PLATIN_02," , true], - [-1326394505,"MODEL_M_Y_PLATIN_03," , true], - [ 607901190 ,"MODEL_M_Y_PMANHAT_01," , true], - [ 1968470106,"MODEL_M_Y_PMANHAT_02," , true], - [-344136289 ,"MODEL_M_Y_PORIENT_01," , true], - [ 560413584 ,"MODEL_M_Y_PQUEENS_01," , true], - [ 1352017873,"MODEL_M_Y_PRICH_01," , true], - [ 223726252 ,"MODEL_M_Y_PVILLBO_01," , true], - [-1252681043,"MODEL_M_Y_PVILLBO_02," , true], - [-1562020391,"MODEL_M_Y_PVILLBO_03," , true], - [ 1223224881,"MODEL_M_Y_QUEENSBRIDGE" , true], - [-1220737489,"MODEL_M_Y_SHADY_02," , true], - [ 1755322862,"MODEL_M_Y_SKATEBIKE_01," , true], - [ 386690478 ,"MODEL_M_Y_SOHO_01," , true], - [ 62496225 ,"MODEL_M_Y_STREET_01," , true], - [ 523785438 ,"MODEL_M_Y_STREET_03," , true], - [ 813889395 ,"MODEL_M_Y_STREET_04," , true], - [-1552214124,"MODEL_M_Y_STREETBLK_02," , true], - [-650575089 ,"MODEL_M_Y_STREETBLK_03," , true], - [-740078918 ,"Street Punk 1," , true], - [-1927496394,"Street Punk 2," , true], - [ 1374242512,"Street Punk 3," , true], - [-1139941790,"Tough Guy" , true], - [ 809067472 ,"Male Tourist" , true] - ], - [], // GTA IV EFLC - [], // Unknown - [], // Unknown - [], // Unknown - [ // Mafia 1 - ["Tommy.i3d" , "Tommy Angelo" , true ], - ["TommyBOXER.i3d" , "Tommy Angelo" , true ], - ["TommyCOAT.i3d" , "Tommy Angelo" , false], - ["TommyCOATHAT.i3d" , "Tommy Angelo" , true ], - ["TommyDELNIK.i3d" , "Tommy Angelo" , true ], - ["TommyDELNIKHIGH.i3d" , "Tommy Angelo" , true ], - ["TommyFREERIDER.i3d" , "Tommy Angelo" , true ], - ["TommyGUN.i3d" , "Tommy Angelo" , true ], - ["TommyHAT.i3d" , "Tommy Angelo" , true ], - ["TommyHIGH.i3d" , "Tommy Angelo" , true ], - ["TommyHIGHBLOOD.i3d" , "Tommy Angelo" , false], - ["TommyHighCOATHAT.i3d" , "Tommy Angelo" , true ], - ["TommyHighHAT.i3d" , "Tommy Angelo" , true ], - ["TommyNAHAC.i3d" , "Tommy Angelo (Naked)" , false], - ["TommyOLD.i3d" , "Tommy Angelo (Old)" , true ], - ["TommyOLDBLOOD.i3d" , "Tommy Angelo (Old)" , false], - ["TommyPYTEL.i3d" , "Tommy Angelo (With Bag)" , true ], - ["TommyRACER.i3d" , "Tommy Angelo (Racer)" , true ], - ["TommyRACER2.i3d" , "Tommy Angelo (Racer)" , true ], - ["TommyRUKAV.i3d" , "Tommy Angelo (Suit)" , true ], - ["TommySAILOR.i3d" , "Tommy Angelo (Sailor)" , true ], - ["TommyTAXIDRIVER.i3d" , "Tommy Angelo (Taxi Driver)" , true ], - ["TommyTAXIdriverHIGH.i3d" , "Tommy Angelo (Taxi Driver)" , true ], - ["AsisPZ1.i3d" , "Generic Man" , true ], - ["Barman01.i3d" , "Bartender" , true ], - ["Bclerk01.i3d" , "Generic Man" , true ], - ["Bclerk02.i3d" , "Generic Man" , true ], - ["Bguard01.i3d" , "Bodyguard" , true ], - ["Bguard01M.i3d" , "Bodyguard" , true ], - ["Bguard02.i3d" , "Bodyguard" , true ], - ["Bguard03.i3d" , "Bodyguard" , true ], - ["Bguard03M.i3d" , "Bodyguard" , true ], - ["Biff.i3d" , "Biff" , true ], - ["BigDig.i3d" , "Generic Man" , true ], - ["BnkO01.i3d" , "Security Guard" , false], - ["BnkO02.i3d" , "Security Guard" , false], - ["BnkO03.i3d" , "Security Guard" , false], - ["BobAut01.i3d" , "Generic Man" , true ], - ["Bookmaker01.i3d" , "Generic Man" , true ], - ["Bookmaker02.i3d" , "Generic Man" , true ], - ["Boxer01.i3d" , "Boxer" , true ], - ["Boxer02.i3d" , "Boxer" , true ], - ["Boxer03.i3d" , "Boxer" , true ], - ["Boxer04.i3d" , "Boxer04" , false], - ["Carlo.i3d" , "Carlo" , true ], - ["China1.i3d" , "China1" , false], - ["Chulig1.i3d" , "Generic Man" , true ], - ["Chulig1b.i3d" , "Generic Man" , true ], - ["David.i3d" , "David" , true ], - ["Delnik01.i3d" , "Generic Man" , true ], - ["Delnik02.i3d" , "Generic Man" , true ], - ["Delnik03.i3d" , "Generic Man" , true ], - ["Detektiv01.i3d" , "Detective" , false], - ["Detektiv02.i3d" , "Detective" , false], - ["Detektiv03.i3d" , "Detective" , false], - ["Enemy01+.i3d" , "Generic Man" , true ], - ["Enemy01.i3d" , "Generic Man" , true ], - ["Enemy02+.i3d" , "Generic Man" , true ], - ["Enemy02.i3d" , "Generic Man" , true ], - ["Enemy03+.i3d" , "Generic Man" , true ], - ["Enemy03.i3d" , "Generic Man" , true ], - ["Enemy04.i3d" , "Generic Man" , true ], - ["Enemy04BLOOD.i3d" , "Generic Man" , false], - ["Enemy04K.i3d" , "Generic Man" , true ], - ["Enemy05.i3d" , "Generic Man" , true ], - ["Enemy06+.i3d" , "Generic Man" , true ], - ["Enemy06.i3d" , "Generic Man" , true ], - ["Enemy07+.i3d" , "Generic Man" , true ], - ["Enemy07.i3d" , "Generic Man" , true ], - ["Enemy08+.i3d" , "Generic Man" , true ], - ["Enemy08.i3d" , "Generic Man" , true ], - ["Enemy08K.i3d" , "Generic Man" , true ], - ["Enemy09+.i3d" , "Generic Man" , true ], - ["Enemy09.i3d" , "Generic Man" , true ], - ["Enemy09K.i3d" , "Generic Man" , true ], - ["Enemy10+.i3d" , "Generic Man" , true ], - ["Enemy10.i3d" , "Generic Man" , true ], - ["Enemy10K.i3d" , "Generic Man" , true ], - ["Enemy11K.i3d" , "Generic Man" , true ], - ["Enemy12.i3d" , "Generic Man" , true ], - ["Enemy12K.i3d" , "Generic Man" , true ], - ["Enemy13C.i3d" , "Generic Man" , true ], - ["Enemy91.i3d" , "Generic Man" , true ], - ["Enemy92.i3d" , "Generic Man" , true ], - ["FMVENemy11K.i3d" , "Gangster" , true ], - ["FREEgang01.i3d" , "Gangster" , true ], - ["FREEgang02.i3d" , "Gangster" , true ], - ["FrankHIGH.i3d" , "Frank" , true ], - ["Friend1.i3d" , "Generic Man" , true ], - ["Friend2.i3d" , "Generic Man" , true ], - ["Gangster01.i3d" , "Generic Man" , true ], - ["Gangster02.i3d" , "Generic Man" , true ], - ["Gangster03.i3d" , "Generic Man" , true ], - ["Gangster04.i3d" , "Generic Man" , true ], - ["Gangster05.i3d" , "Generic Man" , true ], - ["GodzMan1.i3d" , "Generic Man" , true ], - ["Guard01.i3d" , "Bodyguard" , true ], - ["Guard02.i3d" , "Bodyguard" , true ], - ["Hasic01.i3d" , "Firefighter" , true ], - ["HighCivil.i3d" , "Generic Man" , true ], - ["HighCivilBLOOD.i3d" , "Generic Man" , false], - ["Homeless01.i3d" , "Generic Man" , true ], - ["Hoolig01.i3d" , "Generic Man" , true ], - ["Hoolig02.i3d" , "Generic Man" , true ], - ["Hoolig03.i3d" , "Generic Man" , true ], - ["Hoolig04.i3d" , "Generic Man" , true ], - ["Hoolig05.i3d" , "Generic Man" , true ], - ["Hoolig06.i3d" , "Generic Man" , true ], - ["I04Delnik01+.i3d" , "I04Delnik01+" , false], - ["I04Delnik01.i3d" , "Generic Man" , true ], - ["Joe.i3d" , "Joe" , true ], - ["Kasar.i3d" , "Generic Man" , true ], - ["Knez.i3d" , "Preacher" , true ], - ["LifeG01.i3d" , "Sailor" , false], - ["Lucas.i3d" , "Lucas" , true ], - ["Luigi.i3d" , "Luigi" , true ], - ["Malticka1.i3d" , "Generic Man" , true ], - ["MorelloHIGH.i3d" , "Morello" , true ], - ["MorelloLOW.i3d" , "Morello" , true ], - ["NormanHIGH.i3d" , "Norman" , true ], - ["Organizator01.i3d" , "Generic Man" , true ], - ["Paulie.i3d" , "Paulie" , true ], - ["PaulieCOATHAT.i3d" , "Paulie" , true ], - ["PaulieCTHIGH.i3d" , "Paulie" , true ], - ["PaulieCorpse.i3d" , "Paulie" , false], - ["PaulieHIGH.i3d" , "Paulie" , true ], - ["Pepe.i3d" , "Pepe" , true ], - ["PoliceMan01.i3d" , "Police Officer" , false], - ["PoliceMan02.i3d" , "Police Officer" , false], - ["Politik.i3d" , "Generic Man" , true ], - ["PortGuard01.i3d" , "Port Guard" , false], - ["PortGuard02.i3d" , "Port Guard" , false], - ["ProdZ1.i3d" , "Generic Man" , true ], - ["Prokur.i3d" , "Prosecutor" , true ], - ["Radni01.i3d" , "Worker" , true ], - ["Radni02.i3d" , "Worker" , true ], - ["Ralph.i3d" , "Ralph" , true ], - ["RalphHIGH.i3d" , "Ralph" , true ], - ["ReditelB.i3d" , "Director" , true ], - ["ReditelH.i3d" , "Director" , true ], - ["RidicNakladaku.i3d" , "Truck Driver" , false], - ["SalMan01K.i3d" , "Gangster" , true ], - ["SalMan02K.i3d" , "Gangster" , true ], - ["SalMan03.i3d" , "Gangster" , true ], - ["SalMan03K.i3d" , "Gangster" , true ], - ["SalMan04.i3d" , "Gangster" , true ], - ["SalMan05.i3d" , "Gangster" , true ], - ["SalMan05K.i3d" , "Salieri" , true ], - ["Salieri2.i3d" , "Salieri" , true ], - ["SalieriHIGH.i3d" , "Salieri" , true ], - ["SalieriHIGH2.i3d" , "Salieri" , true ], - ["SalieriLOW.i3d" , "Salieri" , true ], - ["Sam.i3d" , "Sam" , true ], - ["SamCOATHAT.i3d" , "Sam" , true ], - ["SamHIGH.i3d" , "Sam" , true ], - ["SamHIGHblood1.i3d" , "SamHIGHblood1" , false], - ["SamHIGHblood2.i3d" , "SamHIGHblood2" , false], - ["SamHIGHblood3.i3d" , "SamHIGHblood3" , false], - ["SamHIGHblood4.i3d" , "SamHIGHblood4" , false], - ["Samblood1.i3d" , "Samblood1" , false], - ["Sergio.i3d" , "Sergio" , true ], - ["SergioBLOOD.i3d" , "SergioBLOOD" , false], - ["SynRad1.i3d" , "Generic Man" , true ], - ["SynRad1BLOOD.i3d" , "SynRad1BLOOD" , false], - ["SynRad1DEAD.i3d" , "SynRad1DEAD" , false], - ["Tony.i3d" , "Tony" , true ], - ["VincenzoHIGH.i3d" , "Vincenzo" , true ], - ["VincenzoLOW.i3d" , "Vincenzo" , true ], - ["Vrabec.i3d" , "Generic Man" , true ], - ["Vratny1.i3d" , "Generic Man" , true ], - ["Vypravci.i3d" , "Train Conductor" , false], - ["Vypravci2.i3d" , "Train Conductor" , false], - ["WillG1.i3d" , "Generic Man" , true ], - ["WillG2.i3d" , "Generic Man" , true ], - ["WillMan01.i3d" , "Generic Man" , true ], - ["WillMan02.i3d" , "Generic Man" , true ], - ["Zavod1.i3d" , "Racer" , true ], - ["Zavod2.i3d" , "Racer" , true ], - ["Zavod3.i3d" , "Racer" , true ], - ["ZavodFMV1.i3d" , "Racer" , true ], - ["ZavodFMV2.i3d" , "Racer" , true ], - ["civil02.i3d" , "Generic Man" , true ], - ["civil03.i3d" , "Generic Man" , true ], - ["civil04.i3d" , "Generic Man" , true ], - ["civil05.i3d" , "Generic Man" , true ], - ["civil06.i3d" , "Generic Man" , true ], - ["civil11.i3d" , "Generic Man" , true ], - ["civil11M.i3d" , "Generic Man" , true ], - ["civil12.i3d" , "Generic Man" , true ], - ["civil13.i3d" , "Generic Man" , true ], - ["civil14.i3d" , "Generic Man" , true ], - ["civil15.i3d" , "Generic Man" , true ], - ["civil16.i3d" , "Generic Man" , true ], - ["civil16M.i3d" , "Generic Man" , true ], - ["civil17.i3d" , "Generic Man" , true ], - ["civil18.i3d" , "Generic Man" , true ], - ["civil19.i3d" , "Generic Man" , true ], - ["civil19M.i3d" , "Generic Man" , true ], - ["civil21.i3d" , "Generic Man" , true ], - ["civil21N.i3d" , "Generic Man" , true ], - ["civil22.i3d" , "Generic Man" , true ], - ["civil31.i3d" , "Generic Man" , true ], - ["civil32.i3d" , "Generic Man" , true ], - ["civil33.i3d" , "Generic Man" , true ], - ["civil34.i3d" , "Generic Man" , true ], - ["civil35.i3d" , "Generic Man" , true ], - ["civil36.i3d" , "Generic Man" , true ], - ["civil36M.i3d" , "Generic Man" , true ], - ["civil37.i3d" , "Generic Man" , true ], - ["civil38.i3d" , "Generic Man" , true ], - ["civil39.i3d" , "Generic Man" , true ], - ["civil40.i3d" , "Generic Man" , true ], - ["civil41.i3d" , "Generic Man" , true ], - ["civil42.i3d" , "Generic Man" , true ], - ["civil42M.i3d" , "Generic Man" , true ], - ["civil43.i3d" , "Generic Man" , true ], - ["civil44.i3d" , "Generic Man" , true ], - ["civil51.i3d" , "Generic Man" , true ], - ["civil51M.i3d" , "Generic Man" , true ], - ["civil52.i3d" , "Generic Man" , true ], - ["civil53.i3d" , "Generic Man" , true ], - ["civil54.i3d" , "Generic Man" , true ], - ["civil54M.i3d" , "Generic Man" , true ], - ["civil55.i3d" , "Generic Man" , true ], - ["civil55M.i3d" , "Generic Man" , true ], - ["civil56.i3d" , "Generic Man" , true ], - ["civil56M.i3d" , "Generic Man" , true ], - ["civil57.i3d" , "Generic Man" , true ], - ["civil57M.i3d" , "Generic Man" , true ], - ["civil60.i3d" , "Generic Man" , true ], - ["civil61.i3d" , "Generic Man" , true ], - ["civil62.i3d" , "Generic Man" , true ], - ["civil63.i3d" , "Generic Man" , true ], - ["civil70.i3d" , "Generic Man" , true ], - ["civil70M.i3d" , "Generic Man" , true ], - ["civil71.i3d" , "Generic Man" , true ], - ["civil72.i3d" , "Generic Man" , true ], - ["frank.i3d" , "frank" , true ], - ["ohorelec01.i3d" , "Dead Guy" , false], - ["pianist1.i3d" , "Pianist" , true ], - ["pol01.i3d" , "Police Officer" , false], - ["pol02.i3d" , "Police Officer" , false], - ["pol03.i3d" , "Police Officer" , false], - ["pol11.i3d" , "Police Officer" , false], - ["pol12.i3d" , "Police Officer" , false], - ["pol13.i3d" , "Police Officer" , false], - ["polim62.i3d" , "Police Officer" , false], - ["pumpar01.i3d" , "Fuel Pumper" , true ], - ["recep.i3d" , "recep" , true ], - ["sailor01.i3d" , "Sailor" , false], - ["sailor01M.i3d" , "Sailor" , false], - ["sailor02.i3d" , "Sailor" , false], - ["sailor02M.i3d" , "Sailor" , false], - ["sailor03.i3d" , "Sailor" , false], - ["waiter01.i3d" , "Waiter" , true ], - ["waiter01M.i3d" , "Waiter" , true ], - ["waiter02.i3d" , "Waiter" , true ], - ["waiter02M.i3d" , "Waiter" , true ], - ["waiter03.i3d" , "Waiter" , true ], - ["Alice1.i3d" , "Alice" , true ], - ["Berta.i3d" , "Berta" , true ], - ["Bitch01.i3d" , "Generic Woman" , true ], - ["Bitch02.i3d" , "Generic Woman" , true ], - ["Bitch02Mask.i3d" , "Generic Woman" , true ], - ["Bitch03M.i3d" , "Generic Woman" , true ], - ["CarlZen1.i3d" , "CarlZen1" , true ], - ["Czena01.i3d" , "Generic Woman" , true ], - ["Czena02.i3d" , "Generic Woman" , true ], - ["Czena03.i3d" , "Generic Woman" , true ], - ["Czena04.i3d" , "Generic Woman" , true ], - ["Czena05.i3d" , "Generic Woman" , true ], - ["Czena06.i3d" , "Generic Woman" , true ], - ["Czena07.i3d" , "Generic Woman" , true ], - ["Czena07M.i3d" , "Generic Woman" , true ], - ["Czena08.i3d" , "Generic Woman" , true ], - ["Czena09.i3d" , "Generic Woman" , true ], - ["Czena09M.i3d" , "Generic Woman" , true ], - ["Czena10.i3d" , "Generic Woman" , true ], - ["Czena10M.i3d" , "Generic Woman" , true ], - ["Czena11.i3d" , "Generic Woman" , true ], - ["Czena11M.i3d" , "Generic Woman" , true ], - ["Czena12.i3d" , "Generic Woman" , true ], - ["Czena13.i3d" , "Generic Woman" , true ], - ["FMVCzena03.i3d" , "Generic Woman" , true ], - ["FMVCzena04.i3d" , "Generic Woman" , true ], - ["March1.i3d" , "Generic Woman" , true ], - ["Michelle.i3d" , "Michelle Naked" , false], - ["MichelleLOW.i3d" , "Michelle" , true ], - ["Milenka1.i3d" , "Milenka" , true ], - ["Sarah1.i3d" , "Sarah Naked" , false], - ["Sarah1Obl.i3d" , "Sarah" , true ], - ["Sarah2.i3d" , "Sarah" , true ], - ["Sarah2HIGH.i3d" , "Sarah" , true ], - ["Sarah2HIGHnaha.i3d" , "Sarah Naked" , false], - ["Sarah2LOW.i3d" , "Sarah" , true ], - ["Serv01.i3d" , "Maid" , true ], - ], - [], // Mafia 2 - [], // Mafia 3 - [], // Mafia Definitive Edition - ], - vehicles: [ - [], // INVALID - [ - [90, "Landstalker"], - [91, "Idaho"], - [92, "Stinger"], - [93, "Linerunner"], - [94, "Perennial"], - [95, "Sentinel"], - [96, "Patriot"], - [97, "Fire Truck"], - [98, "Trashmaster"], - [99, "Stretch"], - [100, "Manana"], - [101, "Infernus"], - [102, "Blista"], - [103, "Pony"], - [104, "Mule"], - [105, "Cheetah"], - [106, "Ambulance"], - [107, "FBI Car"], - [108, "Moonbeam"], - [109, "Esperanto"], - [110, "Taxi"], - [111, "Kuruma"], - [112, "Bobcat"], - [113, "Mr. Whoopee"], - [114, "BF Injection"], - [115, "Manana (Corpse)"], - [116, "Police Car"], - [117, "Enforcer"], - [118, "Securicar"], - [119, "Banshee"], - [120, "Predator"], - [121, "Bus"], - [122, "Rhino"], - [123, "Barracks OL"], - [124, "Train"], - [125, "Police Helicopter"], - [126, "Dodo"], - [127, "Coach"], - [128, "Cabbie"], - [129, "Stallion"], - [130, "Rumpo"], - [131, "RC Bandit"], - [132, "Bellyup"], - [133, "Mr. Wongs"], - [134, "Mafia Sentinel"], - [135, "Yardie Lobo"], - [136, "Yakuza Stinger"], - [137, "Diablo Stallion"], - [138, "Cartel Cruiser"], - [139, "Hoods Rumpo XL"], - [140, "Air Train"], - [141, "Dead Dodo"], - [142, "Speeder"], - [143, "Reefer"], - [144, "Panlantic"], - [145, "Flatbed"], - [146, "Yankee"], - [147, "Escape"], - [148, "Borgnine Taxi"], - [149, "Toyz Van"], - [150, "Ghost"], - ], - [ // GTA VC - [130, "Landstalker"], - [131, "Idaho"], - [132, "Stinger"], - [133, "Linerunner"], - [134, "Perennial"], - [135, "Sentinel"], - [136, "Rio"], - [137, "Firetruck"], - [138, "Trashmaster"], - [139, "Stretch"], - [140, "Manana"], - [141, "Infernus"], - [142, "Voodoo"], - [143, "Pony"], - [144, "Mule"], - [145, "Cheetah"], - [146, "Ambulance"], - [147, "FBI Washington"], - [148, "Moonbeam"], - [149, "Esperanto"], - [150, "Taxi"], - [151, "Washington"], - [152, "Bobcat"], - [153, "Mr.Whoopee"], - [154, "BF-Injection"], - [155, "Hunter"], - [156, "Police Car"], - [157, "Enforcer"], - [158, "Securicar"], - [159, "Banshee"], - [160, "Predator"], - [161, "Bus"], - [162, "Rhino"], - [163, "Barracks OL"], - [164, "Cuban Hermes"], - [165, "Helicopter"], - [166, "Angel"], - [167, "Coach"], - [168, "Cabbie"], - [169, "Stallion"], - [170, "Rumpo"], - [171, "RC Bandit"], - [172, "Romero's Hearse"], - [173, "Packer"], - [174, "Sentinel XS"], - [175, "Admiral"], - [176, "Squalo"], - [177, "Sea Sparrow"], - [178, "Pizza Boy"], - [179, "Gang Burrito"], - [180, "Airtrain"], - [181, "Deaddodo"], - [182, "Speeder"], - [183, "Reefer"], - [184, "Tropic"], - [185, "Flatbed"], - [186, "Yankee"], - [187, "Caddy"], - [188, "Zebra Cab"], - [189, "Top Fun"], - [190, "Skimmer"], - [191, "PCJ-600"], - [192, "Faggio"], - [193, "Freeway"], - [194, "RC Varon"], - [195, "RC Raider"], - [196, "Glendale"], - [197, "Oceanic"], - [198, "Sanchez"], - [199, "Sparrow"], - [200, "Patriot"], - [201, "Love Fist"], - [202, "Coast Guard"], - [203, "Dinghy"], - [204, "Hermes"], - [205, "Sabre"], - [206, "Sabre Turbo"], - [207, "Phoenix"], - [208, "Walton"], - [209, "Regina"], - [210, "Comet"], - [211, "Deluxo"], - [212, "Burrito"], - [213, "Spand Express"], - [214, "Marquis"], - [215, "Baggage Handler"], - [216, "Kaufman Cab"], - [217, "Maverick"], - [218, "VCN Maverick"], - [219, "Rancher"], - [220, "FBI Rancher"], - [221, "Virgo"], - [222, "Greenwood"], - [223, "Cuban Jetmax"], - [224, "Hotring Racer 1"], - [225, "Sandking"], - [226, "Blista Compact"], - [227, "Police Maverick"], - [228, "Boxville"], - [229, "Benson"], - [230, "Mesa Grande"], - [231, "RC Goblin"], - [232, "Hotring Racer 2"], - [233, "Hotring Racer 3"], - [234, "Bloodring Banger 1"], - [235, "Bloodring Banger 2"], - [236, "VCPD Cheetah"], - ], - [ // GTA San Andreas - [400, "Landstalker" ], - [401, "Bravura" ], - [402, "Buffalo" ], - [403, "Linerunner" ], - [404, "Pereniel" ], - [405, "Sentinel" ], - [406, "Dumper" ], - [407, "Firetruck" ], - [408, "Trashmaster" ], - [409, "Stretch" ], - [410, "Manana" ], - [411, "Infernus" ], - [412, "Voodoo" ], - [413, "Pony" ], - [414, "Mule" ], - [415, "Cheetah" ], - [416, "Ambulance" ], - [417, "Leviathan" ], - [418, "Moonbeam" ], - [419, "Esperanto" ], - [420, "Taxi" ], - [421, "Washington" ], - [422, "Bobcat" ], - [423, "Mr Whoopee" ], - [424, "BF Injection" ], - [425, "Hunter" ], - [426, "Premier" ], - [427, "Enforcer" ], - [428, "Securicar" ], - [429, "Banshee" ], - [430, "Predator" ], - [431, "Bus" ], - [432, "Rhino" ], - [433, "Barracks" ], - [434, "Hotknife" ], - [435, "Box Trailer" ], - [436, "Previon" ], - [437, "Coach" ], - [438, "Cabbie" ], - [439, "Stallion" ], - [440, "Rumpo" ], - [441, "RC Bandit" ], - [442, "Romero" ], - [443, "Packer" ], - [444, "Monster" ], - [445, "Admiral" ], - [446, "Squalo" ], - [447, "Seasparrow" ], - [448, "Pizzaboy" ], - [449, "Tram" ], - [450, "Grain Trailer" ], - [451, "Turismo" ], - [452, "Speeder" ], - [453, "Reefer" ], - [454, "Tropic" ], - [455, "Flatbed" ], - [456, "Yankee" ], - [457, "Caddy" ], - [458, "Solair" ], - [459, "Berkley's RC Van" ], - [460, "Skimmer" ], - [461, "PCJ-600" ], - [462, "Faggio" ], - [463, "Freeway" ], - [464, "RC Baron" ], - [465, "RC Raider" ], - [466, "Glendale" ], - [467, "Oceanic" ], - [468, "Sanchez" ], - [469, "Sparrow" ], - [470, "Patriot" ], - [471, "Quad" ], - [472, "Coastguard" ], - [473, "Dinghy" ], - [474, "Hermes" ], - [475, "Sabre" ], - [476, "Rustler" ], - [477, "ZR-350" ], - [478, "Walton" ], - [479, "Regina" ], - [480, "Comet" ], - [481, "BMX" ], - [482, "Burrito" ], - [483, "Camper" ], - [484, "Marquis" ], - [485, "Baggage" ], - [486, "Dozer" ], - [487, "Maverick" ], - [488, "News Maverick" ], - [489, "Rancher" ], - [490, "FBI Rancher" ], - [491, "Virgo" ], - [492, "Greenwood" ], - [493, "Jetmax" ], - [494, "Hotring-Racer A" ], - [495, "Sandking" ], - [496, "Blista" ], - [497, "Police Maverick" ], - [498, "Boxville" ], - [499, "Benson" ], - [500, "Mesa" ], - [501, "RC Goblin" ], - [502, "Hotring-Racer B" ], - [503, "Hotring-Racer C" ], - [504, "Bloodring-Banger" ], - [505, "Rancher" ], - [506, "Super-GT" ], - [507, "Elegant" ], - [508, "Journey" ], - [509, "Bike" ], - [510, "Mountain Bike" ], - [511, "Beagle" ], - [512, "Cropduster" ], - [513, "Stunt" ], - [514, "Tanker" ], - [515, "RoadTrain" ], - [516, "Nebula" ], - [517, "Majestic" ], - [518, "Buccaneer" ], - [519, "Shamal" ], - [520, "Hydra" ], - [521, "FCR-900" ], - [522, "NRG-500" ], - [523, "HPV1000" ], - [524, "Cement Truck" ], - [525, "Tow Truck" ], - [526, "Fortune" ], - [527, "Cadrona" ], - [528, "FBI Truck" ], - [529, "Willard" ], - [530, "Forklift" ], - [531, "Tractor" ], - [532, "Combine" ], - [533, "Feltzer" ], - [534, "Remington" ], - [535, "Slamvan" ], - [536, "Blade" ], - [537, "Freight" ], - [538, "Streak" ], - [539, "Vortex" ], - [540, "Vincent" ], - [541, "Bullet" ], - [542, "Clover" ], - [543, "Sadler" ], - [544, "Firetruck" ], - [545, "Hustler" ], - [546, "Intruder" ], - [547, "Primo" ], - [548, "Cargobob" ], - [549, "Tampa" ], - [550, "Sunrise" ], - [551, "Merit" ], - [552, "Utility" ], - [553, "Nevada" ], - [554, "Yosemite" ], - [555, "Windsor" ], - [556, "Monster Truck A" ], - [557, "Monster Truck B" ], - [558, "Uranus" ], - [559, "Jester" ], - [560, "Sultan" ], - [561, "Stratum" ], - [562, "Elegy" ], - [563, "Raindance" ], - [564, "RC Tiger" ], - [565, "Flash" ], - [566, "Tahoma" ], - [567, "Savanna" ], - [568, "Bandito" ], - [569, "Freight" ], - [570, "Trailer" ], - [571, "Kart" ], - [572, "Mower" ], - [573, "Duneride" ], - [574, "Sweeper" ], - [575, "Broadway" ], - [576, "Tornado" ], - [577, "AT-400" ], - [578, "DFT-30" ], - [579, "Huntley" ], - [580, "Stafford" ], - [581, "BF-400" ], - [582, "Newsvan" ], - [583, "Tug" ], - [584, "Tanker Trailer" ], - [585, "Emperor" ], - [586, "Wayfarer" ], - [587, "Euros" ], - [588, "Hotdog" ], - [589, "Club" ], - [590, "Freight Boxcar" ], - [591, "Short Box Trailer"], - [592, "Andromada" ], - [593, "Dodo" ], - [594, "RC Cam" ], - [595, "Launch" ], - [596, "Police Car (LSPD)"], - [597, "Police Car (SFPD)"], - [598, "Police Car (LVPD)"], - [599, "Police Ranger" ], - [600, "Picador" ], - [601, "S.W.A.T. Van" ], - [602, "Alpha" ], - [603, "Phoenix" ], - [604, "Broken Glendale" ], - [605, "Broken Sadler" ], - [606, "Luggage Trailer" ], - [607, "Luggage Trailer" ], - [608, "Stair Trailer" ], - [609, "Boxville" ], - [610, "Farm Plow" ], - [611, "Utility Trailer" ], - ], - [], // GTA UG - [ // GTA IV - [ 1264341792, "Admiral" ], - [ 1560980623, "Airtug" ], - [ 1171614426, "Ambulance" ], - [-1041692462, "Banshee" ], - [ 2053223216, "Benson" ], - [ 850991848 , "Biff" ], - [-344943009 , "Blista" ], - [ 1075851868, "Bobcat" ], - [-1987130134, "Boxville" ], - [-682211828 , "Buccaneer" ], - [-1346687836, "Burrito" ], - [-907477130 , "Burrito 2" ], - [-713569950 , "Bus" ], - [ 1884962369, "Cabby" ], - [ 2006918058, "Cavalcade" ], - [-67282078 , "Chavos" ], - [-2030171296, "Cognoscenti" ], - [ 1063483177, "Comet" ], - [ 108773431 , "Coquette" ], - [ 162883121 , "DF8" ], - [-1130810103, "Dillettante" ], - [ 723973206 , "Dukes" ], - [-1971955454, "E109" ], - [-685276541 , "Emperor" ], - [-1883002148, "Rusty Emperor" ], - [-276900515 , "Esperanto" ], - [-2119578145, "Faction" ], - [ 1127131465, "FIB Car" ], - [-1097828879, "Feltzer" ], - [ 974744810 , "Feroci" ], - [ 1026055242, "Airport Feroci" ], - [ 1938952078, "Firetruck" ], - [ 1353720154, "Flatbed" ], - [ 627033353 , "Fortune" ], - [ 1491375716, "Forklift" ], - [ 2016857647, "Futo" ], - [ 675415136 , "FXT" ], - [ 884422927 , "Habanero" ], - [-341892653 , "Hakumai" ], - [ 486987393 , "Huntley" ], - [ 418536135 , "Infernus" ], - [-1289722222, "Ingot" ], - [ 886934177 , "Intruder" ], - [ 1269098716, "Landstalker" ], - [-37030056 , "Lokus" ], - [-2124201592, "Manana" ], - [ 1304597482, "Marbella" ], - [-1260881538, "Merit" ], - [-310465116 , "Minivan" ], - [ 525509695 , "Moonbeam" ], - [ 583100975 , "Mr. Tasty" ], - [ 904750859 , "Mule" ], - [ 148777611 , "Noose Patrol Car" ], - [ 1911513875, "Noose Stockade" ], - [ 1348744438, "Oracle" ], - [ 569305213 , "Packer" ], - [-808457413 , "Patriot" ], - [-2077743597, "Perennial" ], - [-1590284256, "Airport Perennial"], - [ 1830407356, "Peyote" ], - [-2137348917, "Phantom" ], - [ 131140572 , "Pinnacle" ], - [ 1376298265, "PMP-600" ], - [ 2046537925, "Police Cruiser" ], - [-1627000575, "Police Patrol" ], - [-350085182 , "Police Patriot" ], - [-119658072 , "Pony" ], - [-1883869285, "Premier" ], - [-1962071130, "Presidente" ], - [-1150599089, "Primo" ], - [-1900572838, "Police Stockade" ], - [ 1390084576, "Rancher" ], - [ 83136452 , "Rebla" ], - [-845979911 , "Reply" ], - [ 627094268 , "Romero" ], - [-1932515764, "Roman's Taxi" ], - [-227741703 , "Ruiner" ], - [-449022887 , "Sabre" ], - [ 1264386590, "Sabre 2" ], - [-1685021548, "Sabre GT" ], - [-322343873 , "Schafter" ], - [ 1349725314, "Sentinel" ], - [ 1344573448, "Solair" ], - [-810318068 , "Speedo" ], - [ 1923400478, "Stallion" ], - [ 1677715180, "Steed" ], - [ 1747439474, "Stockade" ], - [ 1723137093, "Stratum" ], - [-1961627517, "Stretch" ], - [ 970598228 , "Sultan" ], - [-295689028 , "Sultan RS" ], - [ 1821991593, "Super GT" ], - [-956048545 , "Taxi" ], - [ 1208856469, "Taxi 2" ], - [ 1917016601, "Trashmaster" ], - [-1896659641, "Turismo" ], - [ 1534326199, "Uranus" ], - [-825837129 , "Vigero" ], - [-1758379524, "Vigero 2" ], - [-583281407 , "Vincent" ], - [-498054846 , "Virgo" ], - [ 2006667053, "Voodoo" ], - [ 1777363799, "Washington" ], - [ 1937616578, "Willard" ], - [-1099960214, "Yankee" ], - [-1830458836, "Bobber" ], - [-1842748181, "Faggio" ], - [ 584879743 , "Hellfury" ], - [ 1203311498, "NRG-900" ], - [-909201658 , "PCJ-600" ], - [ 788045382 , "Sanchez" ], - [-570033273 , "Zombie" ], - [ 837858166 , "Annihilator" ], - [-1660661558, "Maverick" ], - [ 353883353 , "Police Maverick" ], - [ 2027357303, "Tour Maverick" ], - [ 1033245328, "Dinghy" ], - [ 861409633 , "Jetmax" ], - [-1043459709, "Marquis" ], - [-488123221 , "Predator" ], - [ 1759673526, "Reefer" ], - [ 400514754 , "Squalo" ], - [ 1064455782, "Tuga" ], - [ 290013743 , "Tropic" ], - [-960289747 , "Cablecar" ], - [ 800869680 , "Subway" ], - [-1953988645, "El Train" ], - ], - [], // GTA IV EFLC - [], // INVALID - [], // INVALID - [], // INVALID - [ // Mafia 1 - ["fordtTud00.i3d" , "Blue Bolt Ace Tudor" ], - ["fordtTud01.i3d" , "Dark Blue Bolt Ace Tudor" ], - ["fordtTud02.i3d" , "Brown Bolt Ace Tudor" ], - ["fordtTud03.i3d" , "Green Bolt Ace Tudor" ], - ["fordtTud04.i3d" , "Red Bolt Ace Tudor" ], - ["fordtto00.i3d" , "Blue Bolt Ace Touring" ], - ["fordtto01.i3d" , "Dark Blue Bolt Ace Touring" ], - ["fordtto02.i3d" , "Brown Bolt Ace Touring" ], - ["fordtto03.i3d" , "Green Bolt Ace Touring" ], - ["fordtto04.i3d" , "Red Bolt Ace Touring" ], - ["fordtru00.i3d" , "Blue Bolt Ace Runabout" ], - ["fordtru01.i3d" , "Dark Blue Bolt Ace Runabout" ], - ["fordtru02.i3d" , "Brown Bolt Ace Runabout" ], - ["fordtru03.i3d" , "Green Bolt Ace Runabout" ], - ["fordtru04.i3d" , "Red Bolt Ace Runabout" ], - ["fordtpi00.i3d" , "Blue Bolt Ace Pickup" ], - ["fordtpi01.i3d" , "Dark Blue Bolt Ace Pickup" ], - ["fordtpi02.i3d" , "Brown Bolt Ace Pickup" ], - ["fordtpi03.i3d" , "Green Bolt Ace Pickup" ], - ["fordtpi04.i3d" , "Red Bolt Ace Pickup" ], - ["fordtFor00.i3d" , "Blue Bolt Ace Fordor" ], - ["fordtFor01.i3d" , "Dark Blue Bolt Ace Fordor" ], - ["fordtFor02.i3d" , "Brown Bolt Ace Fordor" ], - ["fordtFor03.i3d" , "Green Bolt Ace Fordor" ], - ["fordtFor04.i3d" , "Red Bolt Ace Fordor" ], - ["fordtco00.i3d" , "Blue Bolt Ace Coupe" ], - ["fordtco01.i3d" , "Dark Blue Bolt Ace Coupe" ], - ["fordtco02.i3d" , "Brown Bolt Ace Coupe" ], - ["fordtco03.i3d" , "Green Bolt Ace Coupe" ], - ["fordtco04.i3d" , "Red Bolt Ace Coupe" ], - ["forAtu00.i3d" , "Brown Bolt Model B Tudor" ], - ["ForAtu01.i3d" , "Red Bolt Model B Tudor" ], - ["ForAtu02.i3d" , "Green Bolt Model B Tudor" ], - ["ForAtu03.i3d" , "Dark Blue Bolt Model B Tudor" ], - ["ForAro00.i3d" , "Brown Bolt Model B Roadster" ], - ["ForAro01.i3d" , "Red Bolt Model B Roadster" ], - ["ForAro02.i3d" , "Green Bolt Model B Roadster" ], - ["ForAro03.i3d" , "Dark Blue Bolt Model B Roadster" ], - ["ForApic00.i3d" , "Brown Bolt Model B Pickup" ], - ["ForApic01.i3d" , "Red Bolt Model B Pickup" ], - ["ForApic02.i3d" , "Green Bolt Model B Pickup" ], - ["ForApic03.i3d" , "Dark Blue Bolt Model B Pickup" ], - ["ForAfo00.i3d" , "Brown Bolt Model B Fordor" ], - ["ForAfo01.i3d" , "Red Bolt Model B Fordor" ], - ["ForAfo02.i3d" , "Green Bolt Model B Fordor" ], - ["ForAfo03.i3d" , "Dark Blue Bolt Model B Fordor" ], - ["ForAde00.i3d" , "Brown Bolt Model B Delivery" ], - ["ForAde01.i3d" , "Red Bolt Model B Delivery" ], - ["ForAde02.i3d" , "Green Bolt Model B Delivery" ], - ["ForAde03.i3d" , "Dark Blue Bolt Model B Delivery" ], - ["ForAcou00.i3d" , "Brown Bolt Model B Coupe" ], - ["ForAcou01.i3d" , "Red Bolt Model B Coupe" ], - ["ForAcou02.i3d" , "Green Bolt Model B Coupe" ], - ["ForAcou03.i3d" , "Dark Blue Bolt Model B Coupe" ], - ["ForAtu00.i3d" , "Brown Bolt Model B Tudor" ], - ["ForAtu01.i3d" , "Red Bolt Model B Tudor" ], - ["ForAtu02.i3d" , "Green Bolt Model B Tudor" ], - ["ForAtu03.i3d" , "Dark Blue Bolt Model B Tudor" ], - ["forVco00.i3d" , "Green Bolt V8 Coupe" ], - ["forVco01.i3d" , "Red Bolt V8 Coupe" ], - ["forVco02.i3d" , "Blue Bolt V8 Coupe" ], - ["forVco03.i3d" , "Grey Bolt V8 Coupe" ], - ["forVfor00.i3d" , "Green Bolt V8 Forder" ], - ["forVfor01.i3d" , "Red Bolt V8 Forder" ], - ["forVfor02.i3d" , "Blue Bolt V8 Forder" ], - ["forVfor03.i3d" , "Grey Bolt V8 Forder" ], - ["forVro00.i3d" , "Green Bolt V8 Roadster" ], - ["forVro01.i3d" , "Red Bolt V8 Roadster" ], - ["forVro02.i3d" , "Blue Bolt V8 Roadster" ], - ["forVro03.i3d" , "Grey Bolt V8 Roadster" ], - ["forVto00.i3d" , "Green Bolt V8 Touring" ], - ["forVto01.i3d" , "Red Bolt V8 Touring" ], - ["forVto02.i3d" , "Blue Bolt V8 Touring" ], - ["forVto03.i3d" , "Grey Bolt V8 Touring" ], - ["forVtud00.i3d" , "Green Bolt V8 Tudor" ], - ["forVtud01.i3d" , "Red Bolt V8 Tudor" ], - ["forVtud02.i3d" , "Blue Bolt V8 Tudor" ], - ["forVtud03.i3d" , "Grey Bolt V8 Tudor" ], - ["miller00.i3d" , "Brubaker" ], - ["speedster00.i3d" , "Silver Bruno Speedster 851" ], - ["speedster01.i3d" , "Red Bruno Speedster 851" ], - ["speedster02.i3d" , "Green Bruno Speedster 851" ], - ["alfa00.i3d" , "Caesar 8C 2300 Racing" ], - ["alfa8C00.i3d" , "Red Caesar 8C Mostro" ], - ["alfa8C01.i3d" , "Black Caesar 8C Mostro" ], - ["merced500K00.i3d" , "White Celeste Marque 500" ], - ["merced500K01.i3d" , "Brown Celeste Marque 500" ], - ["bugatti00.i3d" , "Blue Corrozella C-Otto" ], - ["bugatti01.i3d" , "Green Corrozella C-Otto" ], - ["pontFor00.i3d" , "Blue Crusader Chromium Forder" ], - ["pontFor01.i3d" , "Violet Crusader Chromium Forder" ], - ["pontTud00.i3d" , "Green Crusader Chromium Forder" ], - ["pontTud01.i3d" , "Dark Blue Crusader Chromium Forder"], - ["blackha00.i3d" , "Blue Falconer" ], - ["blackha01.i3d" , "Red Falconer" ], - ["black00.i3d" , "Gangster Falconer" ], - ["taxi00.i3d" , "Falconer Yellowcar" ], - ["hudcou00.i3d" , "Umber Guardian Terraplane Coupe" ], - ["hudcou01.i3d" , "Beige Guardian Terraplane Coupe" ], - ["hudcou02.i3d" , "Black Guardian Terraplane Coupe" ], - ["hudfor00.i3d" , "Umber Guardian Terraplane Fordor" ], - ["hudfor01.i3d" , "Beige Guardian Terraplane Fordor" ], - ["hudfor02.i3d" , "Black Guardian Terraplane Fordor" ], - ["hudtu00.i3d" , "Umber Guardian Terraplane Tudor" ], - ["hudtu01.i3d" , "Beige Guardian Terraplane Tudor" ], - ["hudtu02.i3d" , "Black Guardian Terraplane Tudor" ], - ["cad_ford00.i3d" , "Lassister Fordor" ], - ["cad_phaeton00", "Lassister Phaeton" ], - ["cad_road00.i3d" , "Lassister Roadster" ], - ["hartmann00.i3d" , "Lassister Appolyon" ], - ["hearseCa00.i3d" , "Lassister Charon" ], - ["polCad00.i3d" , "Lassister Police" ], - ["chemaFor00.i3d" , "Green Shubert Extra Six Fordor" ], - ["chemaFor01.i3d" , "White Shubert Extra Six Fordor" ], - ["chemaFor02.i3d" , "Blue Shubert Extra Six Fordor" ], - ["polimFor00.i3d" , "Shubert Extra Six Fordor Police" ], - ["chematud00.i3d" , "Green Shubert Extra Six Tudor" ], - ["chematud01.i3d" , "White Shubert Extra Six Tudor" ], - ["chematud02.i3d" , "Blue Shubert Extra Six Tudor" ], - ["polimTud00.i3d" , "Shubert Extra Six Tudor Police" ], - ["chev00.i3d" , "Red Shubert Six" ], - ["chev01.i3d" , "White Shubert Six" ], - ["chev02.i3d" , "Black Shubert Six" ], - ["poli00.i3d" , "Shubert Six Police" ], - ["arrow00.i3d" , "Silver Fletcher" ], - ["cordca00.i3d" , "Orange Thor 810 Cabriolet" ], - ["cordca01.i3d" , "Black Thor 810 Cabriolet" ], - ["cordph00.i3d" , "Orange Thor 810 Phaeton" ], - ["cordph01.i3d" , "Black Thor 810 Phaeton" ], - ["cordse00.i3d" , "Orange Thor 810 Sedan" ], - ["cordse01.i3d" , "Black Thor 810 Sedan" ], - ["deuseJco00.i3d" , "Trautenberg Model J" ], - ["duesenberg00.i3d" , "Trautenberg Racer 4WD" ], - ["airflFor00.i3d" , "Yellow Ulver Airstream Fordor" ], - ["airflFor01.i3d" , "Green Ulver Airstream Fordor" ], - ["airfltud00.i3d" , "Yellow Ulver Airstream Tudor" ], - ["airfltud01.i3d" , "Green Ulver Airstream Tudor" ], - ["buiCou00.i3d" , "Blue Wright Coupe" ], - ["buiCou01.i3d" , "Red Wright Coupe" ], - ["buiCou02.i3d" , "Green Wright Coupe" ], - ["buigang00.i3d" , "Gangster Wright Coupe" ], - ["buikFor00.i3d" , "Blue Wright Fordor" ], - ["buikFor01.i3d" , "Red Wright Fordor" ], - ["buikFor02.i3d" , "Green Wright Fordor" ], - ["Ambulance00.i3d" , "Bolt Ambulance" ], - ["fire00.i3d" , "Bolt Firetruck" ], - ["hearseA00.i3d" , "Bolt Hearse" ], - ["truckA00.i3d" , "Bolt Truck Flatbed" ], - ["truckB00.i3d" , "Bolt Truck Covered" ], - ["TruckBxx00.i3d" , "Bolt Truck(Atlantic Import)" ], - ["truckBx00.i3d" , "Bolt Truck" ], - ], + [ // GTA IV + [-2020305438,"Male Multiplayer" , false], + [-641875910 ,"Female Multiplayer" , false], + [-1370810922,"MODEL_SUPERLOD" , false], + [ 1853617247,"Anna" , true], + [-1646893330,"Anthony" , true], + [ 1495769888,"Badman" , true], + [ 1500493064,"Bernie Crane" , true], + [ 1731510984,"Bledar" , true], + [ 422305098 ,"Brian" , true], + [-1729980128,"Brucie" , true], + [ 237511807 ,"Bulgarin" , true], + [ 88667657 ,"Charise" , true], + [-1328445565,"Charlie Undercover" , false], + [ 1343144208,"Clarence" , true], + [ 1468450703,"Dardan" , true], + [ 386513184 ,"Darko" , true], + [ 1169442297,"Derric" , true], + [ 237497537 ,"Dmitri" , true], + [-617264103 ,"Dwayne" , true], + [-1600585231,"Eddie" , true], + [ 57218969 ,"Faustin" , true], + [ 1710545037,"Francis" , true], + [ 1424670436,"French Tom" , true], + [ 2129490787,"Gordon" , true], + [-357652594 ,"Gracie" , true], + [ 980768434 ,"Hossan" , true], + [-835225126 ,"Ilyena" , true], + [-479595866 ,"Issac" , true], + [ 1166762483,"Ivan" , true], + [ 364686627 ,"Jay" , true], + [ 170756246 ,"Jason" , true], + [ 390357829 ,"Jeff" , true], + [-366421228 ,"Jimmy" , true], + [-911507684 ,"Johnny Klebitz" , true], + [-773750838 ,"Kate" , true], + [ 995576506 ,"Kenny" , true], + [ 1487004273,"Lil Jacob" , true], + [-1275031987,"Lil Jacob 2," , true], + [-681942840 ,"Luca" , true], + [-492470690 ,"Luis" , true], + [-1040287406,"Mallorie" , true], + [-322700377 ,"Mam" , true], + [ 1445589009,"Manny" , true], + [ 411185872 ,"Marnie" , true], + [-807339118 ,"Mel" , true], + [ 735211577 ,"Michael" , true], + [-1080659212,"Michelle" , true], + [-636669566 ,"Mickey" , true], + [ 1690783035,"Packie" , true], + [-165448092 ,"Pathos" , true], + [-1947682830,"Petrovic" , true], + [-1826458934,"Phil Bell" , true], + [ 1794146792,"Playboy X" , true], + [ 954215094 ,"Ray Boccino" , true], + [-587324132 ,"Ricky" , true], + [-1992728631,"Roman" , true], + [ 558221221 ,"Roman 2," , true], + [-17823883 ,"Sarah" , true], + [ 1384833284,"Tuna" , true], + [-1014976873,"Vinny Spaz" , true], + [ 896408642 ,"Vlad" , true], + [-301223260 ,"Black Street Thug 1," , true], + [-1143910864,"Black Street Thug 2," , true], + [ 869501081 ,"Black Street OG 1," , true], + [ 632613980 ,"Black Street OG 1," , true], + [-503930010 ,"Albanian Thug 1," , true], + [-235584669 ,"Albanian Thug 2," , true], + [ 207714363 ,"Albanian Thug 3," , true], + [ 514268366 ,"Albanian Thug 4," , true], + [ 43005364 ,"Biker 1," , true], + [ 1346668127,"Biker 2," , true], + [-1677255197,"Biker 3," , true], + [-1461281345,"Biker 4," , true], + [ 1574850459,"Biker 5," , true], + [-1953289472,"Biker 6," , true], + [ 280474699 ,"Irish Man 1," , true], + [-19263344 ,"Irish Man 2," , true], + [ 1844702918,"Irish Man 3," , true], + [ 1609755055,"Jamaican OG 1," , true], + [-330497431 ,"Jamaican OG 2," , true], + [ 1117105909,"Jamaican OG 3," , true], + [-1500397869,"Jamaican Thug 1," , true], + [-881358690 ,"Jamaican Thug 2," , true], + [ 1540383669,"Asian Man 1," , true], + [ 764249904 ,"Asian Man 2," , true], + [ 492147228 ,"Hispanic Man 1," , true], + [-1926041127,"Hispanic Man 2," , true], + [ 1168388225,"Hispanic Man 3," , true], + [-1746774780,"Hispanic Man 4," , true], + [-302362397 ,"Fat Italian Mafia Boss" , true], + [-1616890832,"Italian Mafia Boss" , true], + [ 64730935 ,"Italian Mafia Associate" , true], + [ 510389335 ,"Fat Italian Mafia Associate" , true], + [-1836006237,"Russian Thug 1," , true], + [-2088164056,"Russian Thug 2," , true], + [ 1976502708,"Russian Thug 3," , true], + [ 1543404628,"Russian Thug 4," , true], + [ 1865532596,"Russian Thug 5," , true], + [ 431692232 ,"Russian Thug 6," , true], + [ 1724587620,"Russian Thug 7," , true], + [-1180674815,"Russian Thug 8," , true], + [ 871281791 ,"Triad Boss 1," , true], + [ 683712035 ,"Triad Boss 2," , true], + [-1084007777,"Triad Member 3," , true], + [-164935626 ,"Triad Member 4," , true], + [-751071255 ,"Female Maid" , true], + [-109247258 ,"Female Binco Worker" , false], + [ 1366257926,"Female Bank Teller" , true], + [ 346338575 ,"Female Doctor" , true], + [ 1350216795,"Female Gym Worker" , true], + [ 924926104 ,"Female Burger Shot Worker" , false], + [-346378101 ,"Female Cluckin Bell Worker" , false], + [-2104311883,"Female Rockstar Cafe Worker" , false], + [ 212900845 ,"Female TW@ Cafe Worker" , false], + [-290070895 ,"Female Well Stacked Pizza Worker", false], + [ 552542187 ,"Hooker" , true], + [ 996267216 ,"Hooker 2," , true], + [-1193778389,"Nurse" , true], + [ 1113677074,"Stripper 1," , true], + [ 1353709999,"Stripper 2," , true], + [ 24233425 ,"Waitress" , true], + [-1761003415,"Alcoholic Man" , true], + [ 1075583233,"Armoured Truck Driver" , false], + [ 134077503 ,"Bus Driver" , false], + [ 757349871 ,"Generic Asian Man" , true], + [-1827421800,"Black Crackhead" , true], + [ 219393781 ,"Doctor (Scrubs)" , true], + [-1186940778,"Doctor" , true], + [ 375732086 ,"Doctor (Blood Covered Coat)" , true], + [ 2105015949,"Cook" , true], + [-200234085 ,"Italian Mob Enforcer" , true], + [ 800131009 ,"Factory Worker" , true], + [-999506922 ,"FIB Agent" , false], + [-1993909080,"Fat Delivery Driver" , true], + [ 610888851 ,"Fire Chief" , false], + [ 486302863 ,"Mercenary Soldier" , false], + [-778316080 ,"Helicopter Pilot" , false], + [ 624314380 ,"Hotel Doorman" , true], + [-1784833142,"Korean Cook" , true], + [-1852976689,"Lawyer 1," , true], + [-1134712978,"Lawyer 2," , true], + [ 379171768 ,"Loony Black Man" , true], + [-1945168882,"Pilot" , false], + [ 807236245 ,"Generic Man" , true], + [-284362863 ,"Postal Worker" , true], + [-1188246269,"Saxophone Player" , true], + [-1870989171,"Security Guard" , false], + [ 420915580 ,"Stadium Food Vendor" , true], + [ 1878085135,"Stadium Food Cook" , true], + [ 142730876 ,"Street Food Vendor" , true], + [-690681764 ,"Street Sweeper Driver" , true], + [ 8772846 ,"Taxi Driver" , true], + [ 1186270890,"Telephone Company Worker" , true], + [-379234846 ,"Tennis Player" , true], + [ 1159759556,"Train Conductor" , false], + [-142386662 ,"Homeless Black Man" , true], + [-46564867 ,"Trucker" , true], + [-1284047560,"Janitor" , true], + [ 22944263 ,"Hotel Doorman 2," , true], + [ 1178487645,"Mob Boss" , true], + [-1464712858,"Airport Worker" , false], + [-2139064254,"Bartender" , true], + [-1780698891,"Biker Bouncer" , true], + [-409283472 ,"High End Club Bouncer" , true], + [-799229885 ,"Bowling Alley Worker" , true], + [-434183225 ,"Bowling Alley Worker 2," , true], + [ 768442188 ,"Chinese Food Vendor" , true], + [ 676448572 ,"Club Security" , true], + [-722019798 ,"Construction Worker" , true], + [-1015957728,"Construction Worker 2," , true], + [-714220780 ,"Construction Worker 3," , true], + [-183203150 ,"Police Officer" , false], + [-1518937979,"Traffic Officer" , false], + [-370395528 ,"Fat Police Officer" , false], + [-1371133859,"Courier" , true], + [-573788283 ,"Cowboy 1," , true], + [-1283406538,"Drug Dealer 1," , true], + [ 1448755353,"Drug Dealer 2," , true], + [ 989485 ,"Male Burger Shot Worker" , true], + [-1011530423,"Male Cluckin Bell Worker" , true], + [ 1979561477,"Male Rockstar Cafe Worker" , true], + [-786449781 ,"Male TW@ Cafe Worker" , true], + [ 206941425 ,"Male Well Stacked Pizza Worker" , true], + [-610224615 ,"Firefighter" , false], + [ 1136499716,"Garbage Collector" , false], + [ 897868981 ,"Goon" , true], + [-1902758612,"Male Gym Worker" , true], + [-356904519 ,"Mechanic 2," , true], + [-1056268969,"Male Modo Worker" , true], + [ 1201610759,"Helicopter Pilot 2" , false], + [-151000142 ,"Perseus" , true], + [ 501136335 ,"Generic Male 1," , true], + [ 186619473 ,"Generic Male 2," , true], + [-111611196 ,"Generic Male 3," , true], + [-1175077216,"Paramedic" , false], + [-1676937780,"Prisoner" , false], + [ 215190023 ,"Prisoner 2," , false], + [ 1552970117,"Roman's Taxi Service Driver" , true], + [-1481923910,"Male Runner" , true], + [ 357919731 ,"Male Shop Assistant 1," , true], + [-89302119 ,"State Trooper" , false], + [-1004762946,"SWAT" , false], + [-64233032 ,"Sword Swallower" , true], + [-1292254815,"Thief" , true], + [ 271284208 ,"Valet" , true], + [-186113957 ,"Vendor" , true], + [-2015686009,"French Tom" , true], + [ 1977784957,"Jim Fitz" , true], + [-203833294 ,"East European Woman" , true], + [ 189853472 ,"East European Woman 2," , true], + [-349043578 ,"Woman" , true], + [-114937692 ,"Jersey Woman" , true], + [-1697333660,"Oriental Woman" , true], + [ 100706569 ,"Rich Woman" , true], + [ 155063868 ,"Business Woman 1," , true], + [ 394310337 ,"Business Woman 2," , true], + [ 1375728805,"Chinatown Woman" , true], + [-284229525 ,"Business Woman 3," , true], + [ 677687516 ,"East European Woman 3," , true], + [-1188238883,"Fat Black Woman" , true], + [-2075220936,"Jersey Woman 1," , true], + [-1356924456,"Jersey Woman 2," , true], + [ 812112483 ,"Fat Hispanic Woman 1," , true], + [-129242580 ,"Fat Hispanic Woman 2," , true], + [ 852423121 ,"White Manhattan Woman" , true], + [ 76551508 ,"Black Manhattan Woman" , true], + [-2118501976,"Old Asian Woman" , true], + [ 1616769823,"Old Rich Woman" , true], + [ 453889158 ,"Business Woman 4," , true], + [ 824245375 ,"Asian Woman in Dress" , true], + [-1362442041,"Fat Black Bronx Woman" , true], + [-1788328884,"Random White Woman" , true], + [-1523915823,"Random Hispanic Woman" , true], + [-949987237 ,"Random Eastern European Woman" , true], + [-1926577323,"Random Black Woman" , true], + [ 168065679 ,"Black Harlem Woman 1," , true], + [ 441464 ,"Fat Jersey Woman 1," , true], + [ 54114008 ,"Fat Hispanic Woman 3," , true], + [-292713088 ,"Hispanic Woman 1," , true], + [ 1743814728,"Hispanic Woman 2," , true], + [ 1670568326,"Manhattan Woman 1," , true], + [ 1354281938,"Manhattan Woman 2," , true], + [ 1056837725,"Manhattan Woman 1," , true], + [-1193633577,"Asian Woman 1," , true], + [ 713691120 ,"Black Woman 2," , true], + [-1780385799,"Rich White Woman 1," , true], + [-952185135 ,"Asian Woman" , true], + [ 1586287288,"Female Shopper 1," , true], + [ 1848013291,"Female Shopper 2," , true], + [-1702036227,"Female Shopper 3," , true], + [ 1182843182,"Female Socialite 1," , true], + [-900623157 ,"Street Woman 1," , true], + [ 286007875 ,"Street Woman 2," , true], + [ 1473654742,"Street Woman 3," , true], + [-1850743775,"Street Woman 4," , true], + [ 1290755317,"Street Woman 5," , true], + [ 1872110126,"Street Woman 6," , true], + [ 1754440500,"Tourist Woman 1," , true], + [ 761763258 ,"MODEL_F_Y_VILLBO_01," , true], + [-636579119 ,"Business Man 1," , true], + [-1754526315,"Business Man 2," , true], + [-1516474414,"Street Criminal 1," , true], + [-1821258883,"Street Criminal 2," , true], + [ 1952671026,"Obese Mafia Thug" , true], + [-1991603022,"Gay Man 1," , true], + [-1080673049,"Homeless Bum 1," , true], + [ 495499562 ,"Loony White Man 1," , true], + [-1984134881,"MODEL_M_M_MIDTOWN_01," , true], + [ 1063816580,"Business Man 2," , true], + [ 208763854 ,"Eastern European Man 1," , true], + [-1020237172,"Fat Black Man 2," , true], + [ 1782277836,"MODEL_M_M_PINDUS_02," , true], + [-1402442039,"Fat Italian Man 1," , true], + [-1628417063,"Italian Man 2," , true], + [ 1158569407,"Hispanic Man 1," , true], + [ 1969438324,"Hispanic Man 2," , true], + [ 1621955848,"Hispanic Man 3," , true], + [-657489059 ,"Tourist Man 1," , true], + [-1307068958,"Black Business Man 1," , true], + [ 734334931 ,"Asian Man 3," , true], + [ 1865082075,"MODEL_M_M_PRICH_01," , true], + [-432593815 ,"MODEL_M_O_EASTEURO_01," , true], + [-1639359785,"Hasidic Jewish Man 1," , true], + [ 1656087115,"Old Man 1," , true], + [ 2034185905,"MODEL_M_O_PEASTEURO_02," , true], + [ 1316404726,"MODEL_M_O_PHARBRON_01," , true], + [ 980990533 ,"MODEL_M_O_PJERSEY_01," , true], + [-1298691925,"MODEL_M_O_STREET_01," , true], + [ 243672348 ,"Old Business Man" , true], + [ 2085884255,"MODEL_M_Y_BOHO_01," , true], + [ 221246143 ,"MODEL_M_Y_BOHOGUY_01," , true], + [ 52357603 ,"MODEL_M_Y_BRONX_01," , true], + [ 1530937394,"Black Business Man 2," , true], + [ 690281432 ,"Black Business Man 3," , true], + [-1149743642,"Asian Man 4," , true], + [-314369597 ,"Chopshop Mechanic 1," , true], + [-552829610 ,"Chopshop Mechanic 2," , true], + [-1097188138,"MODEL_M_Y_DODGY_01," , true], + [-1775659292,"MODEL_M_Y_DORK_02," , true], + [ 1207402441,"MODEL_M_Y_DOWNTOWN_01," , true], + [ 1500619449,"MODEL_M_Y_DOWNTOWN_02," , true], + [ 594261682 ,"MODEL_M_Y_DOWNTOWN_03," , true], + [-747824291 ,"MODEL_M_Y_GAYYOUNG" , true], + [-677160979 ,"MODEL_M_Y_GENSTREET_11," , true], + [-1678614360,"MODEL_M_Y_GENSTREET_16," , true], + [ 989044076 ,"MODEL_M_Y_GENSTREET_20," , true], + [ 1180218190,"MODEL_M_Y_GENSTREET_34," , true], + [-1420592428,"MODEL_M_Y_HARDMAN_01," , true], + [-1222963415,"MODEL_M_Y_HARLEM_01," , true], + [-1746153269,"MODEL_M_Y_HARLEM_02," , true], + [ 2104499156,"MODEL_M_Y_HARLEM_04," , true], + [-1874580889,"Hasidic Jewish Man 2," , true], + [-1055386282,"MODEL_M_Y_LEASTSIDE_01," , true], + [ 575808580 ,"MODEL_M_Y_PBRONX_01," , true], + [-71980543 ,"MODEL_M_Y_PCOOL_01," , true], + [-195159218 ,"MODEL_M_Y_PCOOL_02," , true], + [ 697247370 ,"MODEL_M_Y_PEASTEURO_01," , true], + [ 670406267 ,"MODEL_M_Y_PHARBRON_01," , true], + [ 26615298 ,"MODEL_M_Y_PHARLEM_01," , true], + [ 1542927558,"MODEL_M_Y_PJERSEY_01," , true], + [-1806886352,"MODEL_M_Y_PLATIN_01," , true], + [-1022920796,"MODEL_M_Y_PLATIN_02," , true], + [-1326394505,"MODEL_M_Y_PLATIN_03," , true], + [ 607901190 ,"MODEL_M_Y_PMANHAT_01," , true], + [ 1968470106,"MODEL_M_Y_PMANHAT_02," , true], + [-344136289 ,"MODEL_M_Y_PORIENT_01," , true], + [ 560413584 ,"MODEL_M_Y_PQUEENS_01," , true], + [ 1352017873,"MODEL_M_Y_PRICH_01," , true], + [ 223726252 ,"MODEL_M_Y_PVILLBO_01," , true], + [-1252681043,"MODEL_M_Y_PVILLBO_02," , true], + [-1562020391,"MODEL_M_Y_PVILLBO_03," , true], + [ 1223224881,"MODEL_M_Y_QUEENSBRIDGE" , true], + [-1220737489,"MODEL_M_Y_SHADY_02," , true], + [ 1755322862,"MODEL_M_Y_SKATEBIKE_01," , true], + [ 386690478 ,"MODEL_M_Y_SOHO_01," , true], + [ 62496225 ,"MODEL_M_Y_STREET_01," , true], + [ 523785438 ,"MODEL_M_Y_STREET_03," , true], + [ 813889395 ,"MODEL_M_Y_STREET_04," , true], + [-1552214124,"MODEL_M_Y_STREETBLK_02," , true], + [-650575089 ,"MODEL_M_Y_STREETBLK_03," , true], + [-740078918 ,"Street Punk 1," , true], + [-1927496394,"Street Punk 2," , true], + [ 1374242512,"Street Punk 3," , true], + [-1139941790,"Tough Guy" , true], + [ 809067472 ,"Male Tourist" , true] + ], + [], // GTA IV EFLC + [], // Unknown + [], // Unknown + [], // Unknown + [ // Mafia 1 + ["Tommy.i3d" , "Tommy Angelo" , true ], + ["TommyBOXER.i3d" , "Tommy Angelo" , true ], + ["TommyCOAT.i3d" , "Tommy Angelo" , false], + ["TommyCOATHAT.i3d" , "Tommy Angelo" , true ], + ["TommyDELNIK.i3d" , "Tommy Angelo" , true ], + ["TommyDELNIKHIGH.i3d" , "Tommy Angelo" , true ], + ["TommyFREERIDER.i3d" , "Tommy Angelo" , true ], + ["TommyGUN.i3d" , "Tommy Angelo" , true ], + ["TommyHAT.i3d" , "Tommy Angelo" , true ], + ["TommyHIGH.i3d" , "Tommy Angelo" , true ], + ["TommyHIGHBLOOD.i3d" , "Tommy Angelo" , false], + ["TommyHighCOATHAT.i3d" , "Tommy Angelo" , true ], + ["TommyHighHAT.i3d" , "Tommy Angelo" , true ], + ["TommyNAHAC.i3d" , "Tommy Angelo (Naked)" , false], + ["TommyOLD.i3d" , "Tommy Angelo (Old)" , true ], + ["TommyOLDBLOOD.i3d" , "Tommy Angelo (Old)" , false], + ["TommyPYTEL.i3d" , "Tommy Angelo (With Bag)" , true ], + ["TommyRACER.i3d" , "Tommy Angelo (Racer)" , true ], + ["TommyRACER2.i3d" , "Tommy Angelo (Racer)" , true ], + ["TommyRUKAV.i3d" , "Tommy Angelo (Suit)" , true ], + ["TommySAILOR.i3d" , "Tommy Angelo (Sailor)" , true ], + ["TommyTAXIDRIVER.i3d" , "Tommy Angelo (Taxi Driver)" , true ], + ["TommyTAXIdriverHIGH.i3d" , "Tommy Angelo (Taxi Driver)" , true ], + ["AsisPZ1.i3d" , "Generic Man" , true ], + ["Barman01.i3d" , "Bartender" , true ], + ["Bclerk01.i3d" , "Generic Man" , true ], + ["Bclerk02.i3d" , "Generic Man" , true ], + ["Bguard01.i3d" , "Bodyguard" , true ], + ["Bguard01M.i3d" , "Bodyguard" , true ], + ["Bguard02.i3d" , "Bodyguard" , true ], + ["Bguard03.i3d" , "Bodyguard" , true ], + ["Bguard03M.i3d" , "Bodyguard" , true ], + ["Biff.i3d" , "Biff" , true ], + ["BigDig.i3d" , "Generic Man" , true ], + ["BnkO01.i3d" , "Security Guard" , false], + ["BnkO02.i3d" , "Security Guard" , false], + ["BnkO03.i3d" , "Security Guard" , false], + ["BobAut01.i3d" , "Generic Man" , true ], + ["Bookmaker01.i3d" , "Generic Man" , true ], + ["Bookmaker02.i3d" , "Generic Man" , true ], + ["Boxer01.i3d" , "Boxer" , true ], + ["Boxer02.i3d" , "Boxer" , true ], + ["Boxer03.i3d" , "Boxer" , true ], + ["Boxer04.i3d" , "Boxer04" , false], + ["Carlo.i3d" , "Carlo" , true ], + ["China1.i3d" , "China1" , false], + ["Chulig1.i3d" , "Generic Man" , true ], + ["Chulig1b.i3d" , "Generic Man" , true ], + ["David.i3d" , "David" , true ], + ["Delnik01.i3d" , "Generic Man" , true ], + ["Delnik02.i3d" , "Generic Man" , true ], + ["Delnik03.i3d" , "Generic Man" , true ], + ["Detektiv01.i3d" , "Detective" , false], + ["Detektiv02.i3d" , "Detective" , false], + ["Detektiv03.i3d" , "Detective" , false], + ["Enemy01+.i3d" , "Generic Man" , true ], + ["Enemy01.i3d" , "Generic Man" , true ], + ["Enemy02+.i3d" , "Generic Man" , true ], + ["Enemy02.i3d" , "Generic Man" , true ], + ["Enemy03+.i3d" , "Generic Man" , true ], + ["Enemy03.i3d" , "Generic Man" , true ], + ["Enemy04.i3d" , "Generic Man" , true ], + ["Enemy04BLOOD.i3d" , "Generic Man" , false], + ["Enemy04K.i3d" , "Generic Man" , true ], + ["Enemy05.i3d" , "Generic Man" , true ], + ["Enemy06+.i3d" , "Generic Man" , true ], + ["Enemy06.i3d" , "Generic Man" , true ], + ["Enemy07+.i3d" , "Generic Man" , true ], + ["Enemy07.i3d" , "Generic Man" , true ], + ["Enemy08+.i3d" , "Generic Man" , true ], + ["Enemy08.i3d" , "Generic Man" , true ], + ["Enemy08K.i3d" , "Generic Man" , true ], + ["Enemy09+.i3d" , "Generic Man" , true ], + ["Enemy09.i3d" , "Generic Man" , true ], + ["Enemy09K.i3d" , "Generic Man" , true ], + ["Enemy10+.i3d" , "Generic Man" , true ], + ["Enemy10.i3d" , "Generic Man" , true ], + ["Enemy10K.i3d" , "Generic Man" , true ], + ["Enemy11K.i3d" , "Generic Man" , true ], + ["Enemy12.i3d" , "Generic Man" , true ], + ["Enemy12K.i3d" , "Generic Man" , true ], + ["Enemy13C.i3d" , "Generic Man" , true ], + ["Enemy91.i3d" , "Generic Man" , true ], + ["Enemy92.i3d" , "Generic Man" , true ], + ["FMVENemy11K.i3d" , "Gangster" , true ], + ["FREEgang01.i3d" , "Gangster" , true ], + ["FREEgang02.i3d" , "Gangster" , true ], + ["FrankHIGH.i3d" , "Frank" , true ], + ["Friend1.i3d" , "Generic Man" , true ], + ["Friend2.i3d" , "Generic Man" , true ], + ["Gangster01.i3d" , "Generic Man" , true ], + ["Gangster02.i3d" , "Generic Man" , true ], + ["Gangster03.i3d" , "Generic Man" , true ], + ["Gangster04.i3d" , "Generic Man" , true ], + ["Gangster05.i3d" , "Generic Man" , true ], + ["GodzMan1.i3d" , "Generic Man" , true ], + ["Guard01.i3d" , "Bodyguard" , true ], + ["Guard02.i3d" , "Bodyguard" , true ], + ["Hasic01.i3d" , "Firefighter" , true ], + ["HighCivil.i3d" , "Generic Man" , true ], + ["HighCivilBLOOD.i3d" , "Generic Man" , false], + ["Homeless01.i3d" , "Generic Man" , true ], + ["Hoolig01.i3d" , "Generic Man" , true ], + ["Hoolig02.i3d" , "Generic Man" , true ], + ["Hoolig03.i3d" , "Generic Man" , true ], + ["Hoolig04.i3d" , "Generic Man" , true ], + ["Hoolig05.i3d" , "Generic Man" , true ], + ["Hoolig06.i3d" , "Generic Man" , true ], + ["I04Delnik01+.i3d" , "I04Delnik01+" , false], + ["I04Delnik01.i3d" , "Generic Man" , true ], + ["Joe.i3d" , "Joe" , true ], + ["Kasar.i3d" , "Generic Man" , true ], + ["Knez.i3d" , "Preacher" , true ], + ["LifeG01.i3d" , "Sailor" , false], + ["Lucas.i3d" , "Lucas" , true ], + ["Luigi.i3d" , "Luigi" , true ], + ["Malticka1.i3d" , "Generic Man" , true ], + ["MorelloHIGH.i3d" , "Morello" , true ], + ["MorelloLOW.i3d" , "Morello" , true ], + ["NormanHIGH.i3d" , "Norman" , true ], + ["Organizator01.i3d" , "Generic Man" , true ], + ["Paulie.i3d" , "Paulie" , true ], + ["PaulieCOATHAT.i3d" , "Paulie" , true ], + ["PaulieCTHIGH.i3d" , "Paulie" , true ], + ["PaulieCorpse.i3d" , "Paulie" , false], + ["PaulieHIGH.i3d" , "Paulie" , true ], + ["Pepe.i3d" , "Pepe" , true ], + ["PoliceMan01.i3d" , "Police Officer" , false], + ["PoliceMan02.i3d" , "Police Officer" , false], + ["Politik.i3d" , "Generic Man" , true ], + ["PortGuard01.i3d" , "Port Guard" , false], + ["PortGuard02.i3d" , "Port Guard" , false], + ["ProdZ1.i3d" , "Generic Man" , true ], + ["Prokur.i3d" , "Prosecutor" , true ], + ["Radni01.i3d" , "Worker" , true ], + ["Radni02.i3d" , "Worker" , true ], + ["Ralph.i3d" , "Ralph" , true ], + ["RalphHIGH.i3d" , "Ralph" , true ], + ["ReditelB.i3d" , "Director" , true ], + ["ReditelH.i3d" , "Director" , true ], + ["RidicNakladaku.i3d" , "Truck Driver" , false], + ["SalMan01K.i3d" , "Gangster" , true ], + ["SalMan02K.i3d" , "Gangster" , true ], + ["SalMan03.i3d" , "Gangster" , true ], + ["SalMan03K.i3d" , "Gangster" , true ], + ["SalMan04.i3d" , "Gangster" , true ], + ["SalMan05.i3d" , "Gangster" , true ], + ["SalMan05K.i3d" , "Salieri" , true ], + ["Salieri2.i3d" , "Salieri" , true ], + ["SalieriHIGH.i3d" , "Salieri" , true ], + ["SalieriHIGH2.i3d" , "Salieri" , true ], + ["SalieriLOW.i3d" , "Salieri" , true ], + ["Sam.i3d" , "Sam" , true ], + ["SamCOATHAT.i3d" , "Sam" , true ], + ["SamHIGH.i3d" , "Sam" , true ], + ["SamHIGHblood1.i3d" , "SamHIGHblood1" , false], + ["SamHIGHblood2.i3d" , "SamHIGHblood2" , false], + ["SamHIGHblood3.i3d" , "SamHIGHblood3" , false], + ["SamHIGHblood4.i3d" , "SamHIGHblood4" , false], + ["Samblood1.i3d" , "Samblood1" , false], + ["Sergio.i3d" , "Sergio" , true ], + ["SergioBLOOD.i3d" , "SergioBLOOD" , false], + ["SynRad1.i3d" , "Generic Man" , true ], + ["SynRad1BLOOD.i3d" , "SynRad1BLOOD" , false], + ["SynRad1DEAD.i3d" , "SynRad1DEAD" , false], + ["Tony.i3d" , "Tony" , true ], + ["VincenzoHIGH.i3d" , "Vincenzo" , true ], + ["VincenzoLOW.i3d" , "Vincenzo" , true ], + ["Vrabec.i3d" , "Generic Man" , true ], + ["Vratny1.i3d" , "Generic Man" , true ], + ["Vypravci.i3d" , "Train Conductor" , false], + ["Vypravci2.i3d" , "Train Conductor" , false], + ["WillG1.i3d" , "Generic Man" , true ], + ["WillG2.i3d" , "Generic Man" , true ], + ["WillMan01.i3d" , "Generic Man" , true ], + ["WillMan02.i3d" , "Generic Man" , true ], + ["Zavod1.i3d" , "Racer" , true ], + ["Zavod2.i3d" , "Racer" , true ], + ["Zavod3.i3d" , "Racer" , true ], + ["ZavodFMV1.i3d" , "Racer" , true ], + ["ZavodFMV2.i3d" , "Racer" , true ], + ["civil02.i3d" , "Generic Man" , true ], + ["civil03.i3d" , "Generic Man" , true ], + ["civil04.i3d" , "Generic Man" , true ], + ["civil05.i3d" , "Generic Man" , true ], + ["civil06.i3d" , "Generic Man" , true ], + ["civil11.i3d" , "Generic Man" , true ], + ["civil11M.i3d" , "Generic Man" , true ], + ["civil12.i3d" , "Generic Man" , true ], + ["civil13.i3d" , "Generic Man" , true ], + ["civil14.i3d" , "Generic Man" , true ], + ["civil15.i3d" , "Generic Man" , true ], + ["civil16.i3d" , "Generic Man" , true ], + ["civil16M.i3d" , "Generic Man" , true ], + ["civil17.i3d" , "Generic Man" , true ], + ["civil18.i3d" , "Generic Man" , true ], + ["civil19.i3d" , "Generic Man" , true ], + ["civil19M.i3d" , "Generic Man" , true ], + ["civil21.i3d" , "Generic Man" , true ], + ["civil21N.i3d" , "Generic Man" , true ], + ["civil22.i3d" , "Generic Man" , true ], + ["civil31.i3d" , "Generic Man" , true ], + ["civil32.i3d" , "Generic Man" , true ], + ["civil33.i3d" , "Generic Man" , true ], + ["civil34.i3d" , "Generic Man" , true ], + ["civil35.i3d" , "Generic Man" , true ], + ["civil36.i3d" , "Generic Man" , true ], + ["civil36M.i3d" , "Generic Man" , true ], + ["civil37.i3d" , "Generic Man" , true ], + ["civil38.i3d" , "Generic Man" , true ], + ["civil39.i3d" , "Generic Man" , true ], + ["civil40.i3d" , "Generic Man" , true ], + ["civil41.i3d" , "Generic Man" , true ], + ["civil42.i3d" , "Generic Man" , true ], + ["civil42M.i3d" , "Generic Man" , true ], + ["civil43.i3d" , "Generic Man" , true ], + ["civil44.i3d" , "Generic Man" , true ], + ["civil51.i3d" , "Generic Man" , true ], + ["civil51M.i3d" , "Generic Man" , true ], + ["civil52.i3d" , "Generic Man" , true ], + ["civil53.i3d" , "Generic Man" , true ], + ["civil54.i3d" , "Generic Man" , true ], + ["civil54M.i3d" , "Generic Man" , true ], + ["civil55.i3d" , "Generic Man" , true ], + ["civil55M.i3d" , "Generic Man" , true ], + ["civil56.i3d" , "Generic Man" , true ], + ["civil56M.i3d" , "Generic Man" , true ], + ["civil57.i3d" , "Generic Man" , true ], + ["civil57M.i3d" , "Generic Man" , true ], + ["civil60.i3d" , "Generic Man" , true ], + ["civil61.i3d" , "Generic Man" , true ], + ["civil62.i3d" , "Generic Man" , true ], + ["civil63.i3d" , "Generic Man" , true ], + ["civil70.i3d" , "Generic Man" , true ], + ["civil70M.i3d" , "Generic Man" , true ], + ["civil71.i3d" , "Generic Man" , true ], + ["civil72.i3d" , "Generic Man" , true ], + ["frank.i3d" , "frank" , true ], + ["ohorelec01.i3d" , "Dead Guy" , false], + ["pianist1.i3d" , "Pianist" , true ], + ["pol01.i3d" , "Police Officer" , false], + ["pol02.i3d" , "Police Officer" , false], + ["pol03.i3d" , "Police Officer" , false], + ["pol11.i3d" , "Police Officer" , false], + ["pol12.i3d" , "Police Officer" , false], + ["pol13.i3d" , "Police Officer" , false], + ["polim62.i3d" , "Police Officer" , false], + ["pumpar01.i3d" , "Fuel Pumper" , true ], + ["recep.i3d" , "recep" , true ], + ["sailor01.i3d" , "Sailor" , false], + ["sailor01M.i3d" , "Sailor" , false], + ["sailor02.i3d" , "Sailor" , false], + ["sailor02M.i3d" , "Sailor" , false], + ["sailor03.i3d" , "Sailor" , false], + ["waiter01.i3d" , "Waiter" , true ], + ["waiter01M.i3d" , "Waiter" , true ], + ["waiter02.i3d" , "Waiter" , true ], + ["waiter02M.i3d" , "Waiter" , true ], + ["waiter03.i3d" , "Waiter" , true ], + ["Alice1.i3d" , "Alice" , true ], + ["Berta.i3d" , "Berta" , true ], + ["Bitch01.i3d" , "Generic Woman" , true ], + ["Bitch02.i3d" , "Generic Woman" , true ], + ["Bitch02Mask.i3d" , "Generic Woman" , true ], + ["Bitch03M.i3d" , "Generic Woman" , true ], + ["CarlZen1.i3d" , "CarlZen1" , true ], + ["Czena01.i3d" , "Generic Woman" , true ], + ["Czena02.i3d" , "Generic Woman" , true ], + ["Czena03.i3d" , "Generic Woman" , true ], + ["Czena04.i3d" , "Generic Woman" , true ], + ["Czena05.i3d" , "Generic Woman" , true ], + ["Czena06.i3d" , "Generic Woman" , true ], + ["Czena07.i3d" , "Generic Woman" , true ], + ["Czena07M.i3d" , "Generic Woman" , true ], + ["Czena08.i3d" , "Generic Woman" , true ], + ["Czena09.i3d" , "Generic Woman" , true ], + ["Czena09M.i3d" , "Generic Woman" , true ], + ["Czena10.i3d" , "Generic Woman" , true ], + ["Czena10M.i3d" , "Generic Woman" , true ], + ["Czena11.i3d" , "Generic Woman" , true ], + ["Czena11M.i3d" , "Generic Woman" , true ], + ["Czena12.i3d" , "Generic Woman" , true ], + ["Czena13.i3d" , "Generic Woman" , true ], + ["FMVCzena03.i3d" , "Generic Woman" , true ], + ["FMVCzena04.i3d" , "Generic Woman" , true ], + ["March1.i3d" , "Generic Woman" , true ], + ["Michelle.i3d" , "Michelle Naked" , false], + ["MichelleLOW.i3d" , "Michelle" , true ], + ["Milenka1.i3d" , "Milenka" , true ], + ["Sarah1.i3d" , "Sarah Naked" , false], + ["Sarah1Obl.i3d" , "Sarah" , true ], + ["Sarah2.i3d" , "Sarah" , true ], + ["Sarah2HIGH.i3d" , "Sarah" , true ], + ["Sarah2HIGHnaha.i3d" , "Sarah Naked" , false], + ["Sarah2LOW.i3d" , "Sarah" , true ], + ["Serv01.i3d" , "Maid" , true ], + ], [], // Mafia 2 [], // Mafia 3 [], // Mafia Definitive Edition - ], - objects: [ - [], // INVALID - [ - [172, "BaseballBat"], - [173, "Colt45"], - [178, "Uzi"], - [176, "Shotgun"], - [171, "AK47"], - [180, "M16"], - [177, "SniperRifle"], - [175, "RPG"], - [181, "Flamethrower"], - [174, "MolotovCocktail"], - [170, "Grenade"], - [182, "RemoteDetonator"], - [1319, "GenericPackageWhite"], - ], - [ // GTA VC - [259, "BrassKnuckles"], - [260, "Screwdriver"], - [261, "GolfClub"], - [262, "Nitestick"], - [263, "Knife"], - [264, "BaseballBat"], - [265, "Hammer"], - [266, "MeatCleaver"], - [267, "Machete"], - [268, "Katana"], - [269, "Chainsaw"], - [270, "Grenade"], - [270, "RemoteGrenade"], - [271, "Teargas"], - [272, "MolotovCocktail"], - [273, "RocketUnfirable"], - [274, "Colt45"], - [275, "Python"], - [277, "Shotgun"], - [278, "SpazShotgun"], - [279, "StubbyShotgun"], - [281, "Tec9"], - [282, "Uzi"], - [283, "Ingram"], - [284, "MP5"], - [280, "M4"], - [276, "Ruger"], - [285, "SniperRifle"], - [286, "LaserSniper"], - [287, "RPG"], - [288, "FlameThrower"], - [289, "M60"], - [290, "Minigun"], - [291, "Detonator"], - [258, "Cellphone"], - [349, "Crate"], - [346, "CardboardBox"], - [342, "Barrel"], - [502, "GenericPackage"], - [596, "BottleWhite"], - [594, "BeerCan"], - [592, "BottleYellow"], - [500, "ArmourVest"], - [510, "PizzaBox"], - [597, "SodaBottle"], - [502, "GenericPackage2"] - ], - [ // GTA SA - [331, "BrassKnuckles"], - [333, "GolfClub"], - [334, "Nitestick"], - [335, "Knife"], - [336, "BaseballBat"], - [337, "Shovel"], - [338, "PoolCue"], - [339, "Katana"], - [341, "Chainsaw"], - [321, "PurpleDildo"], - [322, "Dildo"], - [323, "Vibrator"], - [324, "SilverVibrator"], - [325, "Flowers"], - [326, "Cane"], - [342, "Grenade"], - [343, "Teargas"], - [344, "MolotovCocktail"], - [346, "9mm"], - [347, "Silenced9mm"], - [348, "DesertEagle"], - [349, "Shotgun"], - [350, "SawnOffShotgun"], - [351, "CombatShotgun"], - [352, "MicroSMG"], - [353, "MP5"], - [355, "AK47"], - [356, "M4"], - [372, "Tec9"], - [357, "CountryRifle"], - [358, "SniperRifle"], - [359, "RPG"], - [361, "Flamethrower"], - [362, "Minigun"], - [363, "SatchelCharge"], - [364, "Detonator"], - [365, "Spraycan"], - [366, "FireExtinguisher"], - [367, "Camera"], - [368, "NightVisionGoggles"], - [369, "ThermalGoggles"], - [371, "Parachute"], - [330, "Cellphone"], - [1279, "GenericPackage"], - [1271, "Crate"], - [3632, "Barrel"], - [1275, "Outfit"], - [1484, "BottleWhite"], - [594, "BeerCan"], - [1512, "BottleYellow"], - [373, "ArmourVest"], - [2880, "Cheeseburger"], - [1582, "Pizzabox"], - [1544, "BottleSoda"], - [2601, "CanSoda"], - ], - [], // GTA UG - [ - // GTA IV - ], - [], // GTA IV EFLC - [], // INVALID - [], // INVALID - [], // INVALID - [ // Mafia 1 - - ], + ], + vehicles: [ + [], // INVALID + [ + [90, "Landstalker"], + [91, "Idaho"], + [92, "Stinger"], + [93, "Linerunner"], + [94, "Perennial"], + [95, "Sentinel"], + [96, "Patriot"], + [97, "Fire Truck"], + [98, "Trashmaster"], + [99, "Stretch"], + [100, "Manana"], + [101, "Infernus"], + [102, "Blista"], + [103, "Pony"], + [104, "Mule"], + [105, "Cheetah"], + [106, "Ambulance"], + [107, "FBI Car"], + [108, "Moonbeam"], + [109, "Esperanto"], + [110, "Taxi"], + [111, "Kuruma"], + [112, "Bobcat"], + [113, "Mr. Whoopee"], + [114, "BF Injection"], + [115, "Manana (Corpse)"], + [116, "Police Car"], + [117, "Enforcer"], + [118, "Securicar"], + [119, "Banshee"], + [120, "Predator"], + [121, "Bus"], + [122, "Rhino"], + [123, "Barracks OL"], + [124, "Train"], + [125, "Police Helicopter"], + [126, "Dodo"], + [127, "Coach"], + [128, "Cabbie"], + [129, "Stallion"], + [130, "Rumpo"], + [131, "RC Bandit"], + [132, "Bellyup"], + [133, "Mr. Wongs"], + [134, "Mafia Sentinel"], + [135, "Yardie Lobo"], + [136, "Yakuza Stinger"], + [137, "Diablo Stallion"], + [138, "Cartel Cruiser"], + [139, "Hoods Rumpo XL"], + [140, "Air Train"], + [141, "Dead Dodo"], + [142, "Speeder"], + [143, "Reefer"], + [144, "Panlantic"], + [145, "Flatbed"], + [146, "Yankee"], + [147, "Escape"], + [148, "Borgnine Taxi"], + [149, "Toyz Van"], + [150, "Ghost"], + ], + [ // GTA VC + [130, "Landstalker"], + [131, "Idaho"], + [132, "Stinger"], + [133, "Linerunner"], + [134, "Perennial"], + [135, "Sentinel"], + [136, "Rio"], + [137, "Firetruck"], + [138, "Trashmaster"], + [139, "Stretch"], + [140, "Manana"], + [141, "Infernus"], + [142, "Voodoo"], + [143, "Pony"], + [144, "Mule"], + [145, "Cheetah"], + [146, "Ambulance"], + [147, "FBI Washington"], + [148, "Moonbeam"], + [149, "Esperanto"], + [150, "Taxi"], + [151, "Washington"], + [152, "Bobcat"], + [153, "Mr.Whoopee"], + [154, "BF-Injection"], + [155, "Hunter"], + [156, "Police Car"], + [157, "Enforcer"], + [158, "Securicar"], + [159, "Banshee"], + [160, "Predator"], + [161, "Bus"], + [162, "Rhino"], + [163, "Barracks OL"], + [164, "Cuban Hermes"], + [165, "Helicopter"], + [166, "Angel"], + [167, "Coach"], + [168, "Cabbie"], + [169, "Stallion"], + [170, "Rumpo"], + [171, "RC Bandit"], + [172, "Romero's Hearse"], + [173, "Packer"], + [174, "Sentinel XS"], + [175, "Admiral"], + [176, "Squalo"], + [177, "Sea Sparrow"], + [178, "Pizza Boy"], + [179, "Gang Burrito"], + [180, "Airtrain"], + [181, "Deaddodo"], + [182, "Speeder"], + [183, "Reefer"], + [184, "Tropic"], + [185, "Flatbed"], + [186, "Yankee"], + [187, "Caddy"], + [188, "Zebra Cab"], + [189, "Top Fun"], + [190, "Skimmer"], + [191, "PCJ-600"], + [192, "Faggio"], + [193, "Freeway"], + [194, "RC Varon"], + [195, "RC Raider"], + [196, "Glendale"], + [197, "Oceanic"], + [198, "Sanchez"], + [199, "Sparrow"], + [200, "Patriot"], + [201, "Love Fist"], + [202, "Coast Guard"], + [203, "Dinghy"], + [204, "Hermes"], + [205, "Sabre"], + [206, "Sabre Turbo"], + [207, "Phoenix"], + [208, "Walton"], + [209, "Regina"], + [210, "Comet"], + [211, "Deluxo"], + [212, "Burrito"], + [213, "Spand Express"], + [214, "Marquis"], + [215, "Baggage Handler"], + [216, "Kaufman Cab"], + [217, "Maverick"], + [218, "VCN Maverick"], + [219, "Rancher"], + [220, "FBI Rancher"], + [221, "Virgo"], + [222, "Greenwood"], + [223, "Cuban Jetmax"], + [224, "Hotring Racer 1"], + [225, "Sandking"], + [226, "Blista Compact"], + [227, "Police Maverick"], + [228, "Boxville"], + [229, "Benson"], + [230, "Mesa Grande"], + [231, "RC Goblin"], + [232, "Hotring Racer 2"], + [233, "Hotring Racer 3"], + [234, "Bloodring Banger 1"], + [235, "Bloodring Banger 2"], + [236, "VCPD Cheetah"], + ], + [ // GTA San Andreas + [400, "Landstalker" ], + [401, "Bravura" ], + [402, "Buffalo" ], + [403, "Linerunner" ], + [404, "Pereniel" ], + [405, "Sentinel" ], + [406, "Dumper" ], + [407, "Firetruck" ], + [408, "Trashmaster" ], + [409, "Stretch" ], + [410, "Manana" ], + [411, "Infernus" ], + [412, "Voodoo" ], + [413, "Pony" ], + [414, "Mule" ], + [415, "Cheetah" ], + [416, "Ambulance" ], + [417, "Leviathan" ], + [418, "Moonbeam" ], + [419, "Esperanto" ], + [420, "Taxi" ], + [421, "Washington" ], + [422, "Bobcat" ], + [423, "Mr Whoopee" ], + [424, "BF Injection" ], + [425, "Hunter" ], + [426, "Premier" ], + [427, "Enforcer" ], + [428, "Securicar" ], + [429, "Banshee" ], + [430, "Predator" ], + [431, "Bus" ], + [432, "Rhino" ], + [433, "Barracks" ], + [434, "Hotknife" ], + [435, "Box Trailer" ], + [436, "Previon" ], + [437, "Coach" ], + [438, "Cabbie" ], + [439, "Stallion" ], + [440, "Rumpo" ], + [441, "RC Bandit" ], + [442, "Romero" ], + [443, "Packer" ], + [444, "Monster" ], + [445, "Admiral" ], + [446, "Squalo" ], + [447, "Seasparrow" ], + [448, "Pizzaboy" ], + [449, "Tram" ], + [450, "Grain Trailer" ], + [451, "Turismo" ], + [452, "Speeder" ], + [453, "Reefer" ], + [454, "Tropic" ], + [455, "Flatbed" ], + [456, "Yankee" ], + [457, "Caddy" ], + [458, "Solair" ], + [459, "Berkley's RC Van" ], + [460, "Skimmer" ], + [461, "PCJ-600" ], + [462, "Faggio" ], + [463, "Freeway" ], + [464, "RC Baron" ], + [465, "RC Raider" ], + [466, "Glendale" ], + [467, "Oceanic" ], + [468, "Sanchez" ], + [469, "Sparrow" ], + [470, "Patriot" ], + [471, "Quad" ], + [472, "Coastguard" ], + [473, "Dinghy" ], + [474, "Hermes" ], + [475, "Sabre" ], + [476, "Rustler" ], + [477, "ZR-350" ], + [478, "Walton" ], + [479, "Regina" ], + [480, "Comet" ], + [481, "BMX" ], + [482, "Burrito" ], + [483, "Camper" ], + [484, "Marquis" ], + [485, "Baggage" ], + [486, "Dozer" ], + [487, "Maverick" ], + [488, "News Maverick" ], + [489, "Rancher" ], + [490, "FBI Rancher" ], + [491, "Virgo" ], + [492, "Greenwood" ], + [493, "Jetmax" ], + [494, "Hotring-Racer A" ], + [495, "Sandking" ], + [496, "Blista" ], + [497, "Police Maverick" ], + [498, "Boxville" ], + [499, "Benson" ], + [500, "Mesa" ], + [501, "RC Goblin" ], + [502, "Hotring-Racer B" ], + [503, "Hotring-Racer C" ], + [504, "Bloodring-Banger" ], + [505, "Rancher" ], + [506, "Super-GT" ], + [507, "Elegant" ], + [508, "Journey" ], + [509, "Bike" ], + [510, "Mountain Bike" ], + [511, "Beagle" ], + [512, "Cropduster" ], + [513, "Stunt" ], + [514, "Tanker" ], + [515, "RoadTrain" ], + [516, "Nebula" ], + [517, "Majestic" ], + [518, "Buccaneer" ], + [519, "Shamal" ], + [520, "Hydra" ], + [521, "FCR-900" ], + [522, "NRG-500" ], + [523, "HPV1000" ], + [524, "Cement Truck" ], + [525, "Tow Truck" ], + [526, "Fortune" ], + [527, "Cadrona" ], + [528, "FBI Truck" ], + [529, "Willard" ], + [530, "Forklift" ], + [531, "Tractor" ], + [532, "Combine" ], + [533, "Feltzer" ], + [534, "Remington" ], + [535, "Slamvan" ], + [536, "Blade" ], + [537, "Freight" ], + [538, "Streak" ], + [539, "Vortex" ], + [540, "Vincent" ], + [541, "Bullet" ], + [542, "Clover" ], + [543, "Sadler" ], + [544, "Firetruck" ], + [545, "Hustler" ], + [546, "Intruder" ], + [547, "Primo" ], + [548, "Cargobob" ], + [549, "Tampa" ], + [550, "Sunrise" ], + [551, "Merit" ], + [552, "Utility" ], + [553, "Nevada" ], + [554, "Yosemite" ], + [555, "Windsor" ], + [556, "Monster Truck A" ], + [557, "Monster Truck B" ], + [558, "Uranus" ], + [559, "Jester" ], + [560, "Sultan" ], + [561, "Stratum" ], + [562, "Elegy" ], + [563, "Raindance" ], + [564, "RC Tiger" ], + [565, "Flash" ], + [566, "Tahoma" ], + [567, "Savanna" ], + [568, "Bandito" ], + [569, "Freight" ], + [570, "Trailer" ], + [571, "Kart" ], + [572, "Mower" ], + [573, "Duneride" ], + [574, "Sweeper" ], + [575, "Broadway" ], + [576, "Tornado" ], + [577, "AT-400" ], + [578, "DFT-30" ], + [579, "Huntley" ], + [580, "Stafford" ], + [581, "BF-400" ], + [582, "Newsvan" ], + [583, "Tug" ], + [584, "Tanker Trailer" ], + [585, "Emperor" ], + [586, "Wayfarer" ], + [587, "Euros" ], + [588, "Hotdog" ], + [589, "Club" ], + [590, "Freight Boxcar" ], + [591, "Short Box Trailer"], + [592, "Andromada" ], + [593, "Dodo" ], + [594, "RC Cam" ], + [595, "Launch" ], + [596, "Police Car (LSPD)"], + [597, "Police Car (SFPD)"], + [598, "Police Car (LVPD)"], + [599, "Police Ranger" ], + [600, "Picador" ], + [601, "S.W.A.T. Van" ], + [602, "Alpha" ], + [603, "Phoenix" ], + [604, "Broken Glendale" ], + [605, "Broken Sadler" ], + [606, "Luggage Trailer" ], + [607, "Luggage Trailer" ], + [608, "Stair Trailer" ], + [609, "Boxville" ], + [610, "Farm Plow" ], + [611, "Utility Trailer" ], + ], + [], // GTA UG + [ // GTA IV + [ 1264341792, "Admiral" ], + [ 1560980623, "Airtug" ], + [ 1171614426, "Ambulance" ], + [-1041692462, "Banshee" ], + [ 2053223216, "Benson" ], + [ 850991848 , "Biff" ], + [-344943009 , "Blista" ], + [ 1075851868, "Bobcat" ], + [-1987130134, "Boxville" ], + [-682211828 , "Buccaneer" ], + [-1346687836, "Burrito" ], + [-907477130 , "Burrito 2" ], + [-713569950 , "Bus" ], + [ 1884962369, "Cabby" ], + [ 2006918058, "Cavalcade" ], + [-67282078 , "Chavos" ], + [-2030171296, "Cognoscenti" ], + [ 1063483177, "Comet" ], + [ 108773431 , "Coquette" ], + [ 162883121 , "DF8" ], + [-1130810103, "Dillettante" ], + [ 723973206 , "Dukes" ], + [-1971955454, "E109" ], + [-685276541 , "Emperor" ], + [-1883002148, "Rusty Emperor" ], + [-276900515 , "Esperanto" ], + [-2119578145, "Faction" ], + [ 1127131465, "FIB Car" ], + [-1097828879, "Feltzer" ], + [ 974744810 , "Feroci" ], + [ 1026055242, "Airport Feroci" ], + [ 1938952078, "Firetruck" ], + [ 1353720154, "Flatbed" ], + [ 627033353 , "Fortune" ], + [ 1491375716, "Forklift" ], + [ 2016857647, "Futo" ], + [ 675415136 , "FXT" ], + [ 884422927 , "Habanero" ], + [-341892653 , "Hakumai" ], + [ 486987393 , "Huntley" ], + [ 418536135 , "Infernus" ], + [-1289722222, "Ingot" ], + [ 886934177 , "Intruder" ], + [ 1269098716, "Landstalker" ], + [-37030056 , "Lokus" ], + [-2124201592, "Manana" ], + [ 1304597482, "Marbella" ], + [-1260881538, "Merit" ], + [-310465116 , "Minivan" ], + [ 525509695 , "Moonbeam" ], + [ 583100975 , "Mr. Tasty" ], + [ 904750859 , "Mule" ], + [ 148777611 , "Noose Patrol Car" ], + [ 1911513875, "Noose Stockade" ], + [ 1348744438, "Oracle" ], + [ 569305213 , "Packer" ], + [-808457413 , "Patriot" ], + [-2077743597, "Perennial" ], + [-1590284256, "Airport Perennial"], + [ 1830407356, "Peyote" ], + [-2137348917, "Phantom" ], + [ 131140572 , "Pinnacle" ], + [ 1376298265, "PMP-600" ], + [ 2046537925, "Police Cruiser" ], + [-1627000575, "Police Patrol" ], + [-350085182 , "Police Patriot" ], + [-119658072 , "Pony" ], + [-1883869285, "Premier" ], + [-1962071130, "Presidente" ], + [-1150599089, "Primo" ], + [-1900572838, "Police Stockade" ], + [ 1390084576, "Rancher" ], + [ 83136452 , "Rebla" ], + [-845979911 , "Reply" ], + [ 627094268 , "Romero" ], + [-1932515764, "Roman's Taxi" ], + [-227741703 , "Ruiner" ], + [-449022887 , "Sabre" ], + [ 1264386590, "Sabre 2" ], + [-1685021548, "Sabre GT" ], + [-322343873 , "Schafter" ], + [ 1349725314, "Sentinel" ], + [ 1344573448, "Solair" ], + [-810318068 , "Speedo" ], + [ 1923400478, "Stallion" ], + [ 1677715180, "Steed" ], + [ 1747439474, "Stockade" ], + [ 1723137093, "Stratum" ], + [-1961627517, "Stretch" ], + [ 970598228 , "Sultan" ], + [-295689028 , "Sultan RS" ], + [ 1821991593, "Super GT" ], + [-956048545 , "Taxi" ], + [ 1208856469, "Taxi 2" ], + [ 1917016601, "Trashmaster" ], + [-1896659641, "Turismo" ], + [ 1534326199, "Uranus" ], + [-825837129 , "Vigero" ], + [-1758379524, "Vigero 2" ], + [-583281407 , "Vincent" ], + [-498054846 , "Virgo" ], + [ 2006667053, "Voodoo" ], + [ 1777363799, "Washington" ], + [ 1937616578, "Willard" ], + [-1099960214, "Yankee" ], + [-1830458836, "Bobber" ], + [-1842748181, "Faggio" ], + [ 584879743 , "Hellfury" ], + [ 1203311498, "NRG-900" ], + [-909201658 , "PCJ-600" ], + [ 788045382 , "Sanchez" ], + [-570033273 , "Zombie" ], + [ 837858166 , "Annihilator" ], + [-1660661558, "Maverick" ], + [ 353883353 , "Police Maverick" ], + [ 2027357303, "Tour Maverick" ], + [ 1033245328, "Dinghy" ], + [ 861409633 , "Jetmax" ], + [-1043459709, "Marquis" ], + [-488123221 , "Predator" ], + [ 1759673526, "Reefer" ], + [ 400514754 , "Squalo" ], + [ 1064455782, "Tuga" ], + [ 290013743 , "Tropic" ], + [-960289747 , "Cablecar" ], + [ 800869680 , "Subway" ], + [-1953988645, "El Train" ], + ], + [], // GTA IV EFLC + [], // INVALID + [], // INVALID + [], // INVALID + [ // Mafia 1 + ["fordtTud00.i3d" , "Blue Bolt Ace Tudor" ], + ["fordtTud01.i3d" , "Dark Blue Bolt Ace Tudor" ], + ["fordtTud02.i3d" , "Brown Bolt Ace Tudor" ], + ["fordtTud03.i3d" , "Green Bolt Ace Tudor" ], + ["fordtTud04.i3d" , "Red Bolt Ace Tudor" ], + ["fordtto00.i3d" , "Blue Bolt Ace Touring" ], + ["fordtto01.i3d" , "Dark Blue Bolt Ace Touring" ], + ["fordtto02.i3d" , "Brown Bolt Ace Touring" ], + ["fordtto03.i3d" , "Green Bolt Ace Touring" ], + ["fordtto04.i3d" , "Red Bolt Ace Touring" ], + ["fordtru00.i3d" , "Blue Bolt Ace Runabout" ], + ["fordtru01.i3d" , "Dark Blue Bolt Ace Runabout" ], + ["fordtru02.i3d" , "Brown Bolt Ace Runabout" ], + ["fordtru03.i3d" , "Green Bolt Ace Runabout" ], + ["fordtru04.i3d" , "Red Bolt Ace Runabout" ], + ["fordtpi00.i3d" , "Blue Bolt Ace Pickup" ], + ["fordtpi01.i3d" , "Dark Blue Bolt Ace Pickup" ], + ["fordtpi02.i3d" , "Brown Bolt Ace Pickup" ], + ["fordtpi03.i3d" , "Green Bolt Ace Pickup" ], + ["fordtpi04.i3d" , "Red Bolt Ace Pickup" ], + ["fordtFor00.i3d" , "Blue Bolt Ace Fordor" ], + ["fordtFor01.i3d" , "Dark Blue Bolt Ace Fordor" ], + ["fordtFor02.i3d" , "Brown Bolt Ace Fordor" ], + ["fordtFor03.i3d" , "Green Bolt Ace Fordor" ], + ["fordtFor04.i3d" , "Red Bolt Ace Fordor" ], + ["fordtco00.i3d" , "Blue Bolt Ace Coupe" ], + ["fordtco01.i3d" , "Dark Blue Bolt Ace Coupe" ], + ["fordtco02.i3d" , "Brown Bolt Ace Coupe" ], + ["fordtco03.i3d" , "Green Bolt Ace Coupe" ], + ["fordtco04.i3d" , "Red Bolt Ace Coupe" ], + ["forAtu00.i3d" , "Brown Bolt Model B Tudor" ], + ["ForAtu01.i3d" , "Red Bolt Model B Tudor" ], + ["ForAtu02.i3d" , "Green Bolt Model B Tudor" ], + ["ForAtu03.i3d" , "Dark Blue Bolt Model B Tudor" ], + ["ForAro00.i3d" , "Brown Bolt Model B Roadster" ], + ["ForAro01.i3d" , "Red Bolt Model B Roadster" ], + ["ForAro02.i3d" , "Green Bolt Model B Roadster" ], + ["ForAro03.i3d" , "Dark Blue Bolt Model B Roadster" ], + ["ForApic00.i3d" , "Brown Bolt Model B Pickup" ], + ["ForApic01.i3d" , "Red Bolt Model B Pickup" ], + ["ForApic02.i3d" , "Green Bolt Model B Pickup" ], + ["ForApic03.i3d" , "Dark Blue Bolt Model B Pickup" ], + ["ForAfo00.i3d" , "Brown Bolt Model B Fordor" ], + ["ForAfo01.i3d" , "Red Bolt Model B Fordor" ], + ["ForAfo02.i3d" , "Green Bolt Model B Fordor" ], + ["ForAfo03.i3d" , "Dark Blue Bolt Model B Fordor" ], + ["ForAde00.i3d" , "Brown Bolt Model B Delivery" ], + ["ForAde01.i3d" , "Red Bolt Model B Delivery" ], + ["ForAde02.i3d" , "Green Bolt Model B Delivery" ], + ["ForAde03.i3d" , "Dark Blue Bolt Model B Delivery" ], + ["ForAcou00.i3d" , "Brown Bolt Model B Coupe" ], + ["ForAcou01.i3d" , "Red Bolt Model B Coupe" ], + ["ForAcou02.i3d" , "Green Bolt Model B Coupe" ], + ["ForAcou03.i3d" , "Dark Blue Bolt Model B Coupe" ], + ["ForAtu00.i3d" , "Brown Bolt Model B Tudor" ], + ["ForAtu01.i3d" , "Red Bolt Model B Tudor" ], + ["ForAtu02.i3d" , "Green Bolt Model B Tudor" ], + ["ForAtu03.i3d" , "Dark Blue Bolt Model B Tudor" ], + ["forVco00.i3d" , "Green Bolt V8 Coupe" ], + ["forVco01.i3d" , "Red Bolt V8 Coupe" ], + ["forVco02.i3d" , "Blue Bolt V8 Coupe" ], + ["forVco03.i3d" , "Grey Bolt V8 Coupe" ], + ["forVfor00.i3d" , "Green Bolt V8 Forder" ], + ["forVfor01.i3d" , "Red Bolt V8 Forder" ], + ["forVfor02.i3d" , "Blue Bolt V8 Forder" ], + ["forVfor03.i3d" , "Grey Bolt V8 Forder" ], + ["forVro00.i3d" , "Green Bolt V8 Roadster" ], + ["forVro01.i3d" , "Red Bolt V8 Roadster" ], + ["forVro02.i3d" , "Blue Bolt V8 Roadster" ], + ["forVro03.i3d" , "Grey Bolt V8 Roadster" ], + ["forVto00.i3d" , "Green Bolt V8 Touring" ], + ["forVto01.i3d" , "Red Bolt V8 Touring" ], + ["forVto02.i3d" , "Blue Bolt V8 Touring" ], + ["forVto03.i3d" , "Grey Bolt V8 Touring" ], + ["forVtud00.i3d" , "Green Bolt V8 Tudor" ], + ["forVtud01.i3d" , "Red Bolt V8 Tudor" ], + ["forVtud02.i3d" , "Blue Bolt V8 Tudor" ], + ["forVtud03.i3d" , "Grey Bolt V8 Tudor" ], + ["miller00.i3d" , "Brubaker" ], + ["speedster00.i3d" , "Silver Bruno Speedster 851" ], + ["speedster01.i3d" , "Red Bruno Speedster 851" ], + ["speedster02.i3d" , "Green Bruno Speedster 851" ], + ["alfa00.i3d" , "Caesar 8C 2300 Racing" ], + ["alfa8C00.i3d" , "Red Caesar 8C Mostro" ], + ["alfa8C01.i3d" , "Black Caesar 8C Mostro" ], + ["merced500K00.i3d" , "White Celeste Marque 500" ], + ["merced500K01.i3d" , "Brown Celeste Marque 500" ], + ["bugatti00.i3d" , "Blue Corrozella C-Otto" ], + ["bugatti01.i3d" , "Green Corrozella C-Otto" ], + ["pontFor00.i3d" , "Blue Crusader Chromium Forder" ], + ["pontFor01.i3d" , "Violet Crusader Chromium Forder" ], + ["pontTud00.i3d" , "Green Crusader Chromium Forder" ], + ["pontTud01.i3d" , "Dark Blue Crusader Chromium Forder"], + ["blackha00.i3d" , "Blue Falconer" ], + ["blackha01.i3d" , "Red Falconer" ], + ["black00.i3d" , "Gangster Falconer" ], + ["taxi00.i3d" , "Falconer Yellowcar" ], + ["hudcou00.i3d" , "Umber Guardian Terraplane Coupe" ], + ["hudcou01.i3d" , "Beige Guardian Terraplane Coupe" ], + ["hudcou02.i3d" , "Black Guardian Terraplane Coupe" ], + ["hudfor00.i3d" , "Umber Guardian Terraplane Fordor" ], + ["hudfor01.i3d" , "Beige Guardian Terraplane Fordor" ], + ["hudfor02.i3d" , "Black Guardian Terraplane Fordor" ], + ["hudtu00.i3d" , "Umber Guardian Terraplane Tudor" ], + ["hudtu01.i3d" , "Beige Guardian Terraplane Tudor" ], + ["hudtu02.i3d" , "Black Guardian Terraplane Tudor" ], + ["cad_ford00.i3d" , "Lassister Fordor" ], + ["cad_phaeton00", "Lassister Phaeton" ], + ["cad_road00.i3d" , "Lassister Roadster" ], + ["hartmann00.i3d" , "Lassister Appolyon" ], + ["hearseCa00.i3d" , "Lassister Charon" ], + ["polCad00.i3d" , "Lassister Police" ], + ["chemaFor00.i3d" , "Green Shubert Extra Six Fordor" ], + ["chemaFor01.i3d" , "White Shubert Extra Six Fordor" ], + ["chemaFor02.i3d" , "Blue Shubert Extra Six Fordor" ], + ["polimFor00.i3d" , "Shubert Extra Six Fordor Police" ], + ["chematud00.i3d" , "Green Shubert Extra Six Tudor" ], + ["chematud01.i3d" , "White Shubert Extra Six Tudor" ], + ["chematud02.i3d" , "Blue Shubert Extra Six Tudor" ], + ["polimTud00.i3d" , "Shubert Extra Six Tudor Police" ], + ["chev00.i3d" , "Red Shubert Six" ], + ["chev01.i3d" , "White Shubert Six" ], + ["chev02.i3d" , "Black Shubert Six" ], + ["poli00.i3d" , "Shubert Six Police" ], + ["arrow00.i3d" , "Silver Fletcher" ], + ["cordca00.i3d" , "Orange Thor 810 Cabriolet" ], + ["cordca01.i3d" , "Black Thor 810 Cabriolet" ], + ["cordph00.i3d" , "Orange Thor 810 Phaeton" ], + ["cordph01.i3d" , "Black Thor 810 Phaeton" ], + ["cordse00.i3d" , "Orange Thor 810 Sedan" ], + ["cordse01.i3d" , "Black Thor 810 Sedan" ], + ["deuseJco00.i3d" , "Trautenberg Model J" ], + ["duesenberg00.i3d" , "Trautenberg Racer 4WD" ], + ["airflFor00.i3d" , "Yellow Ulver Airstream Fordor" ], + ["airflFor01.i3d" , "Green Ulver Airstream Fordor" ], + ["airfltud00.i3d" , "Yellow Ulver Airstream Tudor" ], + ["airfltud01.i3d" , "Green Ulver Airstream Tudor" ], + ["buiCou00.i3d" , "Blue Wright Coupe" ], + ["buiCou01.i3d" , "Red Wright Coupe" ], + ["buiCou02.i3d" , "Green Wright Coupe" ], + ["buigang00.i3d" , "Gangster Wright Coupe" ], + ["buikFor00.i3d" , "Blue Wright Fordor" ], + ["buikFor01.i3d" , "Red Wright Fordor" ], + ["buikFor02.i3d" , "Green Wright Fordor" ], + ["Ambulance00.i3d" , "Bolt Ambulance" ], + ["fire00.i3d" , "Bolt Firetruck" ], + ["hearseA00.i3d" , "Bolt Hearse" ], + ["truckA00.i3d" , "Bolt Truck Flatbed" ], + ["truckB00.i3d" , "Bolt Truck Covered" ], + ["TruckBxx00.i3d" , "Bolt Truck(Atlantic Import)" ], + ["truckBx00.i3d" , "Bolt Truck" ], + ], [], // Mafia 2 [], // Mafia 3 [], // Mafia Definitive Edition - ], + ], + objects: [ + [], // INVALID + [ + [172, "BaseballBat"], + [173, "Colt45"], + [178, "Uzi"], + [176, "Shotgun"], + [171, "AK47"], + [180, "M16"], + [177, "SniperRifle"], + [175, "RPG"], + [181, "Flamethrower"], + [174, "MolotovCocktail"], + [170, "Grenade"], + [182, "RemoteDetonator"], + [1319, "GenericPackageWhite"], + ], + [ // GTA VC + [259, "BrassKnuckles"], + [260, "Screwdriver"], + [261, "GolfClub"], + [262, "Nitestick"], + [263, "Knife"], + [264, "BaseballBat"], + [265, "Hammer"], + [266, "MeatCleaver"], + [267, "Machete"], + [268, "Katana"], + [269, "Chainsaw"], + [270, "Grenade"], + [270, "RemoteGrenade"], + [271, "Teargas"], + [272, "MolotovCocktail"], + [273, "RocketUnfirable"], + [274, "Colt45"], + [275, "Python"], + [277, "Shotgun"], + [278, "SpazShotgun"], + [279, "StubbyShotgun"], + [281, "Tec9"], + [282, "Uzi"], + [283, "Ingram"], + [284, "MP5"], + [280, "M4"], + [276, "Ruger"], + [285, "SniperRifle"], + [286, "LaserSniper"], + [287, "RPG"], + [288, "FlameThrower"], + [289, "M60"], + [290, "Minigun"], + [291, "Detonator"], + [258, "Cellphone"], + [349, "Crate"], + [346, "CardboardBox"], + [342, "Barrel"], + [502, "GenericPackage"], + [596, "BottleWhite"], + [594, "BeerCan"], + [592, "BottleYellow"], + [500, "ArmourVest"], + [510, "PizzaBox"], + [597, "SodaBottle"], + [502, "GenericPackage2"] + ], + [ // GTA SA + [331, "BrassKnuckles"], + [333, "GolfClub"], + [334, "Nitestick"], + [335, "Knife"], + [336, "BaseballBat"], + [337, "Shovel"], + [338, "PoolCue"], + [339, "Katana"], + [341, "Chainsaw"], + [321, "PurpleDildo"], + [322, "Dildo"], + [323, "Vibrator"], + [324, "SilverVibrator"], + [325, "Flowers"], + [326, "Cane"], + [342, "Grenade"], + [343, "Teargas"], + [344, "MolotovCocktail"], + [346, "9mm"], + [347, "Silenced9mm"], + [348, "DesertEagle"], + [349, "Shotgun"], + [350, "SawnOffShotgun"], + [351, "CombatShotgun"], + [352, "MicroSMG"], + [353, "MP5"], + [355, "AK47"], + [356, "M4"], + [372, "Tec9"], + [357, "CountryRifle"], + [358, "SniperRifle"], + [359, "RPG"], + [361, "Flamethrower"], + [362, "Minigun"], + [363, "SatchelCharge"], + [364, "Detonator"], + [365, "Spraycan"], + [366, "FireExtinguisher"], + [367, "Camera"], + [368, "NightVisionGoggles"], + [369, "ThermalGoggles"], + [371, "Parachute"], + [330, "Cellphone"], + [1279, "GenericPackage"], + [1271, "Crate"], + [3632, "Barrel"], + [1275, "Outfit"], + [1484, "BottleWhite"], + [594, "BeerCan"], + [1512, "BottleYellow"], + [373, "ArmourVest"], + [2880, "Cheeseburger"], + [1582, "Pizzabox"], + [1544, "BottleSoda"], + [2601, "CanSoda"], + ], + [], // GTA UG + [ + // GTA IV + ], + [], // GTA IV EFLC + [], // INVALID + [], // INVALID + [], // INVALID + [ // Mafia 1 + + ], + [], // Mafia 2 + [], // Mafia 3 + [], // Mafia Definitive Edition + ], weaponModels: [ [], [ // GTA III @@ -2785,8 +2785,8 @@ let gameData = { [ // GTA SA // Police Stations ["Los Santos Police Department", [1545.53, -1675.64, 13.561], -1.575, null], - ["San Fierro Police Department", [-1605.16, 720.79, 11.90], 0.0, null], - ["Las Venturas Police Department", [2339.68, 2453.99, 14.97], 0.0, null], + ["San Fierro Police Department", [-1605.16, 720.79, 11.90], 0.0, null], + ["Las Venturas Police Department", [2339.68, 2453.99, 14.97], 0.0, null], // Ammunations ["Market Ammunation", [1364.84, -1283.79, 13.547], -0.541, null], @@ -2832,8 +2832,8 @@ let gameData = { ["Grotti Dealership", [540.6011,-1291.2489,17.2422], 0.0, null], ["Santa Maria Beach", [302.994567,-1900.099121,1.938840], 0.0, null], ["Glen Park Bridge", [1968.33, -1195.10, 25.70], 0.0, null], - ["Los Santos Skate Park", [1865.96, -1380.53, 13.50], 0.0, null], - ["Los Santos Garbage Dump", [2194.91, -1977.58, 13.55], 0.0, null], + ["Los Santos Skate Park", [1865.96, -1380.53, 13.50], 0.0, null], + ["Los Santos Garbage Dump", [2194.91, -1977.58, 13.55], 0.0, null], // Train Stations ["Unity Station", [1742.60, -1859.98, 13.414], -3.112, null], @@ -2957,20 +2957,20 @@ let gameData = { // More will be added soon! ], - [], // GTA IV EFLC + [], // GTA IV EFLC [], // INVALID [], // INVALID [], // INVALID [ ["Works Quarter Fire Station", [-1883.96, -4.89, -348.49], null], ["Salieri's Bar", [-1774.59, -5.62, 3.29], null], - ["Little Italy Gas Station", [-1781.84, -4.83, -204.96], null], - ["Port of Lost Heaven Main Entrance", [-2039.28, -5.57, -767.31], null], - ["Road to Lost Heaven Racing Circuit", [-3049.63, -1.85, -436.09], null], - ["Chinatown", [-1709.77, 14.36, 583.77], null], - ["Downtown Bank", [-175.78, 19.06, -399.13], null], - ["Downtown-Hoboken Gas Station", [-108.68, 8.46, -134.26], null], - ["New Ark Hospital", [-759.00, 11.40, 747.31], null], + ["Little Italy Gas Station", [-1781.84, -4.83, -204.96], null], + ["Port of Lost Heaven Main Entrance", [-2039.28, -5.57, -767.31], null], + ["Road to Lost Heaven Racing Circuit", [-3049.63, -1.85, -436.09], null], + ["Chinatown", [-1709.77, 14.36, 583.77], null], + ["Downtown Bank", [-175.78, 19.06, -399.13], null], + ["Downtown-Hoboken Gas Station", [-108.68, 8.46, -134.26], null], + ["New Ark Hospital", [-759.00, 11.40, 747.31], null], ], // Mafia 1 [], // Mafia 2 [], // Mafia 3 @@ -3108,14 +3108,14 @@ let gameData = { [ // GTA IV ], - [], // GTA IV EFLC - [], // INVALID, - [], // INVALID, - [], // INVALID, - [], // MAFIA 1, - [], // MAFIA 2, - [], // MAFIA 3, - [], // MAFIA DE, + [], // GTA IV EFLC + [], // INVALID, + [], // INVALID, + [], // INVALID, + [], // MAFIA 1, + [], // MAFIA 2, + [], // MAFIA 3, + [], // MAFIA DE, ], walkStyles: [ false, @@ -3195,13 +3195,13 @@ let gameData = { ["aimcrouch", 0, 165, VRR_ANIMTYPE_NORMAL, 0.0, null, null, null, null, VRR_ANIMMOVE_NONE], ["throw3", 0, 166, VRR_ANIMTYPE_NORMAL, 0.0, null, null, null, null, VRR_ANIMMOVE_NONE], ["handsup", 0, 167, VRR_ANIMTYPE_SURRENDER, 0.0, null, null, null, null, VRR_ANIMMOVE_NONE], - ["sit", 0, 111, VRR_ANIMTYPE_NORMAL, 0.0, null, null, null, null, VRR_ANIMMOVE_NONE], - ["sitleft", 0, 111, VRR_ANIMTYPE_NORMAL, 0.0, null, null, null, null, VRR_ANIMMOVE_LEFT], - ["sitback", 0, 111, VRR_ANIMTYPE_NORMAL, 0.0, null, null, null, null, VRR_ANIMMOVE_BACK], - ["sitright", 0, 111, VRR_ANIMTYPE_NORMAL, 0.0, null, null, null, null, VRR_ANIMMOVE_RIGHT], - ["sitforward", 0, 111, VRR_ANIMTYPE_NORMAL, 0.0, null, null, null, null, VRR_ANIMMOVE_FORWARD], - ["sitarmright", 0, 120, VRR_ANIMTYPE_NORMAL, 0.0, null, null, null, null, VRR_ANIMMOVE_BACK], - ["tazed", 0, 13, VRR_ANIMTYPE_FORCED, 0.0, null, null, null, null, VRR_ANIMMOVE_NONE], + ["sit", 0, 111, VRR_ANIMTYPE_NORMAL, 0.0, null, null, null, null, VRR_ANIMMOVE_NONE], + ["sitleft", 0, 111, VRR_ANIMTYPE_NORMAL, 0.0, null, null, null, null, VRR_ANIMMOVE_LEFT], + ["sitback", 0, 111, VRR_ANIMTYPE_NORMAL, 0.0, null, null, null, null, VRR_ANIMMOVE_BACK], + ["sitright", 0, 111, VRR_ANIMTYPE_NORMAL, 0.0, null, null, null, null, VRR_ANIMMOVE_RIGHT], + ["sitforward", 0, 111, VRR_ANIMTYPE_NORMAL, 0.0, null, null, null, null, VRR_ANIMMOVE_FORWARD], + ["sitarmright", 0, 120, VRR_ANIMTYPE_NORMAL, 0.0, null, null, null, null, VRR_ANIMMOVE_BACK], + ["tazed", 0, 13, VRR_ANIMTYPE_FORCED, 0.0, null, null, null, null, VRR_ANIMMOVE_NONE], ], [ // GTA VC ["walk", 0, 0, VRR_ANIMTYPE_NORMAL, 0.0, null, null, null, null, VRR_ANIMMOVE_NONE], @@ -3245,7 +3245,7 @@ let gameData = { ["sitleft", 0, 169, VRR_ANIMTYPE_NORMAL, 0.0, null, null, null, null, VRR_ANIMMOVE_LEFT], ["sitforward", 0, 169, VRR_ANIMTYPE_NORMAL, 0.0, null, null, null, null, VRR_ANIMMOVE_FORWARD], ["sitback", 0, 169, VRR_ANIMTYPE_NORMAL, 0.0, null, null, null, null, VRR_ANIMMOVE_BACK], - ["tazed", 0, 13, VRR_ANIMTYPE_FORCED, 0.0, null, null, null, null, VRR_ANIMMOVE_NONE], + ["tazed", 0, 13, VRR_ANIMTYPE_FORCED, 0.0, null, null, null, null, VRR_ANIMMOVE_NONE], ], [ // GTA SA ["walk", 0, 0, VRR_ANIMTYPE_NORMAL, 0.0, null, null, null, null, VRR_ANIMMOVE_NONE], @@ -3285,7 +3285,7 @@ let gameData = { ["sitleft", 0, 150, VRR_ANIMTYPE_NORMAL, 0.0, null, null, null, null, VRR_ANIMMOVE_LEFT], ["sitforward", 0, 150, VRR_ANIMTYPE_NORMAL, 0.0, null, null, null, null, VRR_ANIMMOVE_FORWARD], ["sitback", 0, 150, VRR_ANIMTYPE_NORMAL, 0.0, null, null, null, null, VRR_ANIMMOVE_BACK], - ["tazed", 0, 15, VRR_ANIMTYPE_FORCED, 0.0, null, null, null, null, VRR_ANIMMOVE_NONE], + ["tazed", 0, 15, VRR_ANIMTYPE_FORCED, 0.0, null, null, null, null, VRR_ANIMMOVE_NONE], /* ["talk", "PED", "IDLE_CHAT", VRR_ANIMTYPE_NORMAL, 0.0, null, null, null, null], @@ -3306,7 +3306,7 @@ let gameData = { ["sit4", "BEACH", "SitnWait_loop_W", VRR_ANIMTYPE_NORMAL, 0.0, null, null, null, null], ["scratch", "MISC","Scratchballs_01", VRR_ANIMTYPE_NORMAL, 0.0, null, null, null, null], ["standup", "ped", "SEAT_up", VRR_ANIMTYPE_NORMAL, 0.0, null, null, null, null], - //["faceshocked", 0, 150, VRR_ANIMTYPE_NORMAL, 0.0, null, null, null, null, VRR_ANIMMOVE_NONE], + //["faceshocked", 0, 150, VRR_ANIMTYPE_NORMAL, 0.0, null, null, null, null, VRR_ANIMMOVE_NONE], //["facesurprised", 0, 150, VRR_ANIMTYPE_NORMAL, 0.0, null, null, null, null, VRR_ANIMMOVE_NONE], //["faceconfused", 0, 150, VRR_ANIMTYPE_NORMAL, 0.0, null, null, null, null, VRR_ANIMMOVE_NONE], //["faceangry", 0, 159, VRR_ANIMTYPE_NORMAL, 0.0, null, null, null, null, VRR_ANIMMOVE_NONE], @@ -3324,14 +3324,14 @@ let gameData = { [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], // VC [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], // SA [], // UG - [1, 3], // IV - [], // Invalid - [], // Invalid - [], // Invalid - [], // M1 - [], // M2 - [], // M3 - [], // M1DE + [1, 3], // IV + [], // Invalid + [], // Invalid + [], // Invalid + [], // M1 + [], // M2 + [], // M3 + [], // M1DE ], blipSprites: [ false, @@ -3387,7 +3387,7 @@ let gameData = { Trophy: 33, Race: 53, Job: 56, - Bar: 49, + Bar: 49, Club: 48, RepairGarage: 27, Trophy: 33, @@ -3404,7 +3404,7 @@ let gameData = { Ammunation: 59, PayAndSpray: 75, VehicleDealership: 91, - AirplaneDealership: 56, + AirplaneDealership: 56, BoatDealership: 48, Restaurant: 57, FastFood: 21, @@ -3412,28 +3412,28 @@ let gameData = { FuelStation: 0, Business: 0, House: 29, - Clothes: 50, + Clothes: 50, Pizza: 0, Chicken: 22, Burger: 21, - Bar: 47, + Bar: 47, Club: 51, Gym: 54, RepairGarage: 75, Trophy: 81, Race: 65, Job: 80, - Misc: 0, - ComedyClub: 70, - CabaretClub: 71, - Ransom: 72, - StripClub: 66, - Male: 63, - Female: 64, - TrainStation: 58, - Heart: 54, - Bowling: 49, - Internet: 24, + Misc: 0, + ComedyClub: 70, + CabaretClub: 71, + Ransom: 72, + StripClub: 66, + Male: 63, + Female: 64, + TrainStation: 58, + Heart: 54, + Bowling: 49, + Internet: 24, }, ], pickupModels: [ @@ -3455,7 +3455,7 @@ let gameData = { Clothes: 1361, Misc: 1361, Exit: 1361, - Job: 1361, + Job: 1361, }, { // GTA Vice City @@ -3474,11 +3474,11 @@ let gameData = { Clothes: 409, Misc: 406, Exit: 406, - Job: 406, - SaveDisk: 411, - Camera: 382, - KillFrenzy: 383, - Pill: 367, + Job: 406, + SaveDisk: 411, + Camera: 382, + KillFrenzy: 383, + Pill: 367, }, { // GTA San Andreas @@ -3497,18 +3497,18 @@ let gameData = { Clothes: 1275, Misc: 1239, Exit: 1318, - Job: 1239, - SaveDisk: 1277, - Pill: 1241, - Camera: 1253, - TwoPlayer: 1314, - RampageSkull: 1254, - TwoPlayerRampage: 1313, + Job: 1239, + SaveDisk: 1277, + Pill: 1241, + Camera: 1253, + TwoPlayer: 1314, + RampageSkull: 1254, + TwoPlayerRampage: 1313, }, - { - // GTA Underground - }, - { // GTA IV + { + // GTA Underground + }, + { // GTA IV PoliceStation: -1, FireStation: -1, Hospital: -1, @@ -3524,8 +3524,8 @@ let gameData = { Clothes: -1, Misc: -1, Exit: -1, - Job: -1, - } + Job: -1, + } ], pickupTypes: [ {}, @@ -3556,9 +3556,9 @@ let gameData = { info: 1, job: 1, }, - { - // GTA Underground - }, + { + // GTA Underground + }, { // GTA IV business: -1, house: -1, @@ -3566,7 +3566,7 @@ let gameData = { clothes: -1, info: -1, job: -1, - } + } ], // THIS IS SCREEN HEIGHT, NOT ACTUAL DOOR POSITION IN THE WORLD @@ -3589,21 +3589,21 @@ let gameData = { ["Outfit", 500, 2] ], LegalGunStore: [ - ["Baseball Bat", 500, 2], + ["Baseball Bat", 500, 2], ["Colt 45", 500, 2], ["Shotgun", 500, 2], - ["Colt 45 Ammo", 500, 2], - ["Shotgun Ammo", 500, 2], + ["Colt 45 Ammo", 500, 2], + ["Shotgun Ammo", 500, 2], ], IllegalGunStore: [ ["Uzi", 500, 2], ["AK-47", 500, 2], ["M16", 500, 2], ["Sniper Rifle", 500, 2], - ["Uzi Ammo", 500, 2], - ["AK-47 Ammo", 500, 2], - ["M16 Ammo", 500, 2], - ["Shotgun Ammo", 500, 2], + ["Uzi Ammo", 500, 2], + ["AK-47 Ammo", 500, 2], + ["M16 Ammo", 500, 2], + ["Shotgun Ammo", 500, 2], ], GasStation: [ ["Bottle of Soda", 500, 2], @@ -3611,7 +3611,7 @@ let gameData = { ["Slice of Pizza", 500, 2], ["Bottle of Water", 500, 2], ["Can of Beer", 500, 2], - ["Pack of Smokes", 500, 2], + ["Pack of Smokes", 500, 2], ], ElectronicsStore: [ ["Phone", 500, 2], @@ -3712,14 +3712,14 @@ let gameData = { ["Vehicle Repair Kit", 500, 2], ["Vehicle Primary Colour Kit", 500, 2], ["Vehicle Secondary Colour Kit", 500, 2], - ], + ], }, { // GTA VC ClothingStore: [ ["Outfit", 500, 2] ], LegalGunStore: [ - ["Baseball Bat", 500, 2], + ["Baseball Bat", 500, 2], ["Brass Knuckles", 500, 2], ["Colt .45", 500, 2], ["Python", 500, 2], @@ -3854,7 +3854,7 @@ let gameData = { ["Vehicle Repair Kit", 500, 2], ["Vehicle Primary Colour Kit", 500, 2], ["Vehicle Secondary Colour Kit", 500, 2], - ], + ], }, { // GTA SA ClothingStore: [ @@ -3895,8 +3895,8 @@ let gameData = { ["Vibrator", 500, 2], ["Silver Vibrator", 500, 2], ["Flowers", 500, 2], - ["Cane", 500, 2], - ["Pool Cue", 500, 2], + ["Cane", 500, 2], + ["Pool Cue", 500, 2], ], GasStation: [ ["Bottle of Soda", 500, 2], @@ -3904,8 +3904,8 @@ let gameData = { ["Slice of Pizza", 500, 2], ["Bottle of Water", 500, 2], ["Can of Beer", 500, 2], - ["Cane", 500, 2], - ["Pool Cue", 500, 2], + ["Cane", 500, 2], + ["Pool Cue", 500, 2], ], ElectronicsStore: [ ["Phone", 500, 2], @@ -4007,37 +4007,37 @@ let gameData = { ["Vehicle Repair Kit", 500, 2], ["Vehicle Primary Colour Kit", 500, 2], ["Vehicle Secondary Colour Kit", 500, 2], - ], - VehicleModShop: [ - ["Vehicle Primary Colour Kit", 500, 2], + ], + VehicleModShop: [ + ["Vehicle Primary Colour Kit", 500, 2], ["Vehicle Secondary Colour Kit", 500, 2], - ["Decal Kit", 500, 2], - ["Spoiler", 500, 2], - ["Side Skirt", 500, 2], - ["Wheels", 500, 2], - ["Roof", 500, 2], - ["Front Bumper", 500, 2], - ["Rear Bumper", 500, 2], - ["Exhaust", 500, 2], + ["Decal Kit", 500, 2], + ["Spoiler", 500, 2], + ["Side Skirt", 500, 2], + ["Wheels", 500, 2], + ["Roof", 500, 2], + ["Front Bumper", 500, 2], + ["Rear Bumper", 500, 2], + ["Exhaust", 500, 2], ["NOS x5", 500, 2], - ["NOS x10", 500, 2], - ["Hydraulics", 500, 2], - ], + ["NOS x10", 500, 2], + ["Hydraulics", 500, 2], + ], }, - {}, // GTA UG - { // GTA IV + {}, // GTA UG + { // GTA IV ClothingStore: [ ["Outfit", 500, 2] ], LegalGunStore: [ - ["Baseball Bat", 500, 2], - ["Knife", 500, 2], - ["Glock 9mm", 500, 2], - ["Desert Eagle", 500, 2], - ["Stubby Shotgun", 500, 2], - ["Glock 9mm Ammo", 500, 2], - ["Desert Eagle Ammo", 500, 2], - ["Stubby Shotgun Ammo", 500, 2], + ["Baseball Bat", 500, 2], + ["Knife", 500, 2], + ["Glock 9mm", 500, 2], + ["Desert Eagle", 500, 2], + ["Stubby Shotgun", 500, 2], + ["Glock 9mm Ammo", 500, 2], + ["Desert Eagle Ammo", 500, 2], + ["Stubby Shotgun Ammo", 500, 2], ], IllegalGunStore: [ ["MP5", 500, 2], @@ -4046,7 +4046,7 @@ let gameData = { ["M4", 500, 2], ["Beretta Shotgun", 500, 2], ["Sniper Rifle", 500, 2], - ["Micro Uzi Ammo", 500, 2], + ["Micro Uzi Ammo", 500, 2], ["MP5 Ammo", 500, 2], ["AK-47 Ammo", 500, 2], ["M4 Ammo", 500, 2], @@ -4163,28 +4163,28 @@ let gameData = { ["Vehicle Secondary Colour Kit", 500, 2], ], }, - {}, // GTA IV EFLC - {}, // INVALID - {}, // INVALID - {}, // INVALID - { // Mafia 1 + {}, // GTA IV EFLC + {}, // INVALID + {}, // INVALID + {}, // INVALID + { // Mafia 1 ClothingStore: [ ["Outfit", 500, 2] ], LegalGunStore: [ - ["Baseball Bat", 500, 2], - ["Knuckleduster", 500, 2], - ["Knife", 500, 2], - ["S&W Model 10 M&P", 500, 2], - ["S&W Model 27 Magnum", 500, 2], - ["Colt 1911", 500, 2], - ["Shotgun", 500, 2], - ["Sawed-off Shotgun", 500, 2], - ["S&W Model 10 M&P Ammo", 500, 2], - ["S&W Model 27 Magnum Ammo", 500, 2], - ["Colt 1911 Ammo", 500, 2], - ["Shotgun Ammo", 500, 2], - ["Sawed-off Shotgun Ammo", 500, 2], + ["Baseball Bat", 500, 2], + ["Knuckleduster", 500, 2], + ["Knife", 500, 2], + ["S&W Model 10 M&P", 500, 2], + ["S&W Model 27 Magnum", 500, 2], + ["Colt 1911", 500, 2], + ["Shotgun", 500, 2], + ["Sawed-off Shotgun", 500, 2], + ["S&W Model 10 M&P Ammo", 500, 2], + ["S&W Model 27 Magnum Ammo", 500, 2], + ["Colt 1911 Ammo", 500, 2], + ["Shotgun Ammo", 500, 2], + ["Sawed-off Shotgun Ammo", 500, 2], ], IllegalGunStore: [ ], @@ -4325,9 +4325,9 @@ let gameData = { Arena: [toVector3(-1080.49, 1331.16, 13.91), 15], GhettoShack: [toVector3(-962.74, 146.96, 9.40), 12], HotelRoom: [toVector3(226.47, -1274.98, 19.271), 2], - ConcertHall: [toVector3(-925.417, 1053.4, 13.2005), 8], - RecordingStudio: [toVector3(-879.767, 1156.88, 17.8115), 9], - PrintWorks: [toVector3(-1064.98, -279.093, 12.0882), 18], + ConcertHall: [toVector3(-925.417, 1053.4, 13.2005), 8], + RecordingStudio: [toVector3(-879.767, 1156.88, 17.8115), 9], + PrintWorks: [toVector3(-1064.98, -279.093, 12.0882), 18], }, { // GTA SA @@ -4435,48 +4435,48 @@ let gameData = { }, { // GTA IV - Office2: [toVector3(-1153.30, 417.37, 5.578), 0], - PlayBoyXHouse: [toVector3(-426.16, 1466.52, 38.971), 0, "playboyx"], - RaySafeHouse: [toVector3(-969.77, 883.27, 18.817), 0], - RomanHouse2: [toVector3(95.75, 851.68, 45.051), 0], - SouthBohanHouse: [toVector3(603.04, 1404.06, 17.479), 0], - HoveBeachHouse: [toVector3(892.56, -502.13, 19.407), 0, "bronxsave"], - House6: [toVector3(-524.09, 830.54, 23.627), 0, "shootapt"], - BrucieHouse: [toVector3(806.36, 146.68, 29.243), 0, "brucieloft"], - ElizabetaHouse: [toVector3(356.91, 1511.28, 21.432), 0, "shootapt"], - House9DontUse: [toVector3(1319.40, -847.02, 8.872), 0], - House10: [toVector3(1331.40, 126.60, 36.558), 0], - House11: [toVector3(1387.81, 622.66, 35.857), 0], - House12: [toVector3(932.74, -189.29, 35.143), 0], - House13: [toVector3(-1397.85, 1473.89, 26.447), 0], - House14: [toVector3(806.36, 146.68, 29.243), 0], - House15: [toVector3(-526.49, 829.41, 23.627), 0], - Gym: [toVector3(403.31, 1480.32, 11.834), 0], - PoliceStation: [toVector3(-406.52, 286.57, 13.682), 0, "copshop"], - FancyRestaurant: [toVector3(-118.24, -259.06, 12.654), 0], - Basement: [toVector3(1304.38, -856.66, 5.490), 0], - Office1: [toVector3(-409.31, 285.49, 18.592), 0], - Office2: [toVector3(-1153.30, 417.37, 5.578), 0], - Office3: [toVector3(817.64, -259.77, 15.343), 0], - Office4: [toVector3(-86.35, 56.70, 75.953), 0], - HospitalRoom: [toVector3(1240.00, 192.44, 33.553), 0], - Church: [toVector3(-286.72, -282.36, 15.632), 0], - Prison: [toVector3(-1082.69, -364.05, 7.404), 0], - Ship: [toVector3(-336.53, -1494.56, 9.945), 0], + Office2: [toVector3(-1153.30, 417.37, 5.578), 0], + PlayBoyXHouse: [toVector3(-426.16, 1466.52, 38.971), 0, "playboyx"], + RaySafeHouse: [toVector3(-969.77, 883.27, 18.817), 0], + RomanHouse2: [toVector3(95.75, 851.68, 45.051), 0], + SouthBohanHouse: [toVector3(603.04, 1404.06, 17.479), 0], + HoveBeachHouse: [toVector3(892.56, -502.13, 19.407), 0, "bronxsave"], + House6: [toVector3(-524.09, 830.54, 23.627), 0, "shootapt"], + BrucieHouse: [toVector3(806.36, 146.68, 29.243), 0, "brucieloft"], + ElizabetaHouse: [toVector3(356.91, 1511.28, 21.432), 0, "shootapt"], + House9DontUse: [toVector3(1319.40, -847.02, 8.872), 0], + House10: [toVector3(1331.40, 126.60, 36.558), 0], + House11: [toVector3(1387.81, 622.66, 35.857), 0], + House12: [toVector3(932.74, -189.29, 35.143), 0], + House13: [toVector3(-1397.85, 1473.89, 26.447), 0], + House14: [toVector3(806.36, 146.68, 29.243), 0], + House15: [toVector3(-526.49, 829.41, 23.627), 0], + Gym: [toVector3(403.31, 1480.32, 11.834), 0], + PoliceStation: [toVector3(-406.52, 286.57, 13.682), 0, "copshop"], + FancyRestaurant: [toVector3(-118.24, -259.06, 12.654), 0], + Basement: [toVector3(1304.38, -856.66, 5.490), 0], + Office1: [toVector3(-409.31, 285.49, 18.592), 0], + Office2: [toVector3(-1153.30, 417.37, 5.578), 0], + Office3: [toVector3(817.64, -259.77, 15.343), 0], + Office4: [toVector3(-86.35, 56.70, 75.953), 0], + HospitalRoom: [toVector3(1240.00, 192.44, 33.553), 0], + Church: [toVector3(-286.72, -282.36, 15.632), 0], + Prison: [toVector3(-1082.69, -364.05, 7.404), 0], + Ship: [toVector3(-336.53, -1494.56, 9.945), 0], }, - {}, // GTA IV EFLC - {}, // INVALID - {}, // INVALID - {}, // INVALID - { // Mafia 1 - }, - { // Mafia 2 - }, - { // Mafia 3 - }, - { // Mafia 1 Definitive Edition - }, + {}, // GTA IV EFLC + {}, // INVALID + {}, // INVALID + {}, // INVALID + { // Mafia 1 + }, + { // Mafia 2 + }, + { // Mafia 3 + }, + { // Mafia 1 Definitive Edition + }, ], skinChangePosition: [ [], @@ -4485,14 +4485,14 @@ let gameData = { [toVector3(258.14, -41.76, 1002.023), 1.322, 14], [], [], - [], // GTA IV EFLC - [], // INVALID - [], // INVALID - [], // INVALID - [], // Mafia 1 - [], // Mafia 2 - [], // Mafia 3 - [], // Mafia 1 Definitive Edition + [], // GTA IV EFLC + [], // INVALID + [], // INVALID + [], // INVALID + [], // Mafia 1 + [], // Mafia 2 + [], // Mafia 3 + [], // Mafia 1 Definitive Edition ], policeStations: [ false, @@ -4567,7 +4567,7 @@ let gameData = { blip: false, name: "Fort Carson", }, - { + { position: toVector3(-212.65, 977.99, 19.33), heading: 0.0, blip: false, @@ -4644,22 +4644,22 @@ let gameData = { name: "Leftwood", }, ], - [], // GTA IV EFLC - [], // INVALID - [], // INVALID - [], // INVALID - [ - // Mafia 1 - ], - [ - // Mafia 2 - ], - [ - // Mafia 3 - ], - [ - // Mafia 1 Definitive Edition - ], + [], // GTA IV EFLC + [], // INVALID + [], // INVALID + [], // INVALID + [ + // Mafia 1 + ], + [ + // Mafia 2 + ], + [ + // Mafia 3 + ], + [ + // Mafia 1 Definitive Edition + ], ], fireStations: [ false, @@ -4724,22 +4724,22 @@ let gameData = { name: "Chinatown", }, ], - [], // GTA IV EFLC - [], // INVALID - [], // INVALID - [], // INVALID - [ - // Mafia 1 - ], - [ - // Mafia 2 - ], - [ - // Mafia 3 - ], - [ - // Mafia 1 Definitive Edition - ], + [], // GTA IV EFLC + [], // INVALID + [], // INVALID + [], // INVALID + [ + // Mafia 1 + ], + [ + // Mafia 2 + ], + [ + // Mafia 3 + ], + [ + // Mafia 1 Definitive Edition + ], ], hospitals: [ false, @@ -4838,28 +4838,28 @@ let gameData = { name: "Acter Medical Center", }, ], - [], // GTA IV EFLC - [], // INVALID - [], // INVALID - [], // INVALID - [ - // Mafia 1 + [], // GTA IV EFLC + [], // INVALID + [], // INVALID + [], // INVALID + [ + // Mafia 1 { position: toVector3(-759.00, 11.40, 747.31), heading: 0.0, blip: false, name: "New Ark Hospital", }, - ], - [ - // Mafia 2 - ], - [ - // Mafia 3 - ], - [ - // Mafia 1 Definitive Edition - ], + ], + [ + // Mafia 2 + ], + [ + // Mafia 3 + ], + [ + // Mafia 1 Definitive Edition + ], ], payAndSprays: [ false, @@ -4881,33 +4881,33 @@ let gameData = { }, ], [ - // GTA VC + // GTA VC ], [ - // GTA SA + // GTA SA ], [ - // GTA UG + // GTA UG ], [ - // GTA IV + // GTA IV + ], + [], // GTA IV EFLC + [], // INVALID + [], // INVALID + [], // INVALID + [ + // Mafia 1 + ], + [ + // Mafia 2 + ], + [ + // Mafia 3 + ], + [ + // Mafia 1 Definitive Edition ], - [], // GTA IV EFLC - [], // INVALID - [], // INVALID - [], // INVALID - [ - // Mafia 1 - ], - [ - // Mafia 2 - ], - [ - // Mafia 3 - ], - [ - // Mafia 1 Definitive Edition - ], ], ammunations: [ @@ -4936,18 +4936,18 @@ let gameData = { [ // GTA IV ], - [], // GTA IV EFLC - [], // INVALID - [], // INVALID - [], // INVALID - [ // Mafia 1 - ], - [ // Mafia 2 - ], - [ // Mafia 3 - ], - [ // Mafia 1 Definitive Edition - ], + [], // GTA IV EFLC + [], // INVALID + [], // INVALID + [], // INVALID + [ // Mafia 1 + ], + [ // Mafia 2 + ], + [ // Mafia 3 + ], + [ // Mafia 1 Definitive Edition + ], ], fuelStations: [ false, @@ -4970,481 +4970,481 @@ let gameData = { [ // GTA IV ], - [], // INVALID - [], // INVALID - [], // INVALID - [], // Mafia 1 - [], // Mafia 2 - [], // Mafia 3 - [], // Mafia 1 Definitive Edition + [], // INVALID + [], // INVALID + [], // INVALID + [], // Mafia 1 + [], // Mafia 2 + [], // Mafia 3 + [], // Mafia 1 Definitive Edition ], taxiModels: [ [ // INVALID - ], + ], [ // GTA III - 110, - 128, - 148 - ], + 110, + 128, + 148 + ], [ // GTA VC - 150, - 160, - 216 - ], - [// GTA SA - 420, - 438 - ], + 150, + 160, + 216 + ], + [// GTA SA + 420, + 438 + ], [], // GTA UG [ // GTA IV - -1932515764, - -956048545, - 1208856469 - ], - [], // GTA IV EFLC - [], // INVALID - [], // INVALID - [], // INVALID - [ // Mafia 1 - ], - [ // Mafia 2 - ], - [ // Mafia 3 - ], - [ // Mafia 1 Definitive Edition - ], + -1932515764, + -956048545, + 1208856469 + ], + [], // GTA IV EFLC + [], // INVALID + [], // INVALID + [], // INVALID + [ // Mafia 1 + ], + [ // Mafia 2 + ], + [ // Mafia 3 + ], + [ // Mafia 1 Definitive Edition + ], ], - vehicleUpgrades: [ - {}, // Invalid - {}, // GTA III - {}, // GTA VC - {}, // GTA UG - { // GTA SA - 1000: "Pro Spoiler", - 1001: "Win Spoiler", - 1002: "Drag Spoiler", - 1003: "Alpha Spoiler", - 1004: "Champ Scoop Hood", - 1005: "Fury Scoop Hood", - 1006: "Roof Scoop Roof", - 1007: "Right Sideskirt", - 1008: "5x Nitro", - 1009: "2x Nitro", - 1010: "10x Nitro", - 1011: "Race Scoop Hood", - 1012: "Worx Scoop Hood", - 1013: "Round Fog Lamps", - 1014: "Champ Spoiler", - 1015: "Race Spoiler", - 1016: "Worx Spoiler", - 1017: "Left Sideskirt", - 1018: "Upswept Exhaust", - 1019: "Twin Exhaust", - 1020: "Large Exhaust", - 1021: "Medium Exhaust", - 1022: "Small Exhaust", - 1023: "Fury Spoiler", - 1024: "Square Fog Lamps", - 1025: "Offroad Wheels", - 1026: "Right Alien Sideskirt", - 1027: "Left Alien Sideskirt", - 1028: "Alien Exhaust", - 1029: "X-Flow Exhaust", - 1030: "Left X-Flow Sideskirt", - 1031: "Right X-Flow Sideskirt", - 1032: "Alien Roof Vent Roof", - 1033: "X-Flow Roof Vent Roof", - 1034: "Alien Exhaust", - 1035: "X-Flow Roof Vent Roof", - 1036: "Right Alien Sideskirt", - 1037: "X-Flow Exhaust", - 1038: "Alien Roof Vent Roof", - 1039: "Left X-Flow Sideskirt", - 1040: "Left Alien Sideskirt", - 1041: "Right X-Flow Sideskirt", - 1042: "Right Chrome Sideskirt", - 1043: "Slamin Exhaust", - 1044: "Chrome Exhaust", - 1045: "X-Flow Exhaust", - 1046: "Alien Exhaust", - 1047: "Right Alien Sideskirt", - 1048: "Right X-Flow Sideskirt", - 1049: "Alien Spoiler", - 1050: "X-Flow Spoiler", - 1051: "Left Alien Sideskirt", - 1052: "Left X-Flow Sideskirt", - 1053: "X-Flow Roof", - 1054: "Alien Roof", - 1055: "Alien Roof", - 1056: "Right Alien Sideskirt", - 1057: "Right X-Flow Sideskirt", - 1058: "Alien Spoiler", - 1059: "X-Flow Exhaust", - 1060: "X-Flow Spoiler", - 1061: "X-Flow Roof", - 1062: "Left Alien Sideskirt", - 1063: "Left X-Flow Sideskirt", - 1064: "Alien Exhaust", - 1065: "Alien Exhaust", - 1066: "X-Flow Exhaust", - 1067: "Alien Roof", - 1068: "X-Flow Roof", - 1069: "Right Alien Sideskirt", - 1070: "Right X-Flow Sideskirt", - 1071: "Left Alien Sideskirt", - 1072: "Left X-Flow Sideskirt", - 1073: "Shadow Wheels", - 1074: "Mega Wheels", - 1075: "Rimshine Wheels", - 1076: "Wires Wheels", - 1077: "Classic Wheels", - 1078: "Twist Wheels", - 1079: "Cutter Wheels", - 1080: "Switch Wheels", - 1081: "Grove Wheels", - 1082: "Import Wheels", - 1083: "Dollar Wheels", - 1084: "Trance Wheels", - 1085: "Atomic Wheels", - 1086: "Stereo Stereo", - 1087: "Hydraulics Hydraulics", - 1088: "Alien Roof", - 1089: "X-Flow Exhaust", - 1090: "Right Alien Sideskirt", - 1091: "X-Flow Roof", - 1092: "Alien Exhaust", - 1093: "Right X-Flow Sideskirt", - 1094: "Left Alien Sideskirt", - 1095: "Right X-Flow Sideskirt", - 1096: "Ahab Wheels", - 1097: "Virtual Wheels", - 1098: "Access Wheels", - 1099: "Left Chrome Sideskirt", - 1100: "Chrome Grill Bullbar", - 1101: "Left Chrome Flames Sideskirt", - 1102: "Left Chrome Strip Sideskirt", - 1103: "Covertible Roof", - 1104: "Chrome Exhaust", - 1105: "Slamin Exhaust", - 1106: "Right Chrome Arches Sideskirt", - 1107: "Left Chrome Strip Sideskirt", - 1108: "Right Chrome Strip Sideskirt", - 1109: "Chrome Rear Bullbars", - 1110: "Slamin Rear Bullbars", - 1113: "Chrome Exhaust", - 1114: "Slamin Exhaust", - 1115: "Chrome Front Bullbars", - 1116: "Slamin Front Bullbars", - 1117: "Chrome Front Bumper", - 1118: "Right Chrome Trim Sideskirt", - 1119: "Right Wheelcovers Sideskirt", - 1120: "Left Chrome Trim Sideskirt", - 1121: "Left Wheelcovers Sideskirt", - 1122: "Right Chrome Flames Sideskirt", - 1123: "Chrome Bars Bullbars", - 1124: "Left Chrome Arches Sideskirt", - 1125: "Chrome Lights Bullbars", - 1126: "Chrome Exhaust Exhaust", - 1127: "Slamin Exhaust Exhaust", - 1128: "Vinyl Hardtop Roof", - 1129: "Chrome Exhaust", - 1130: "Hardtop Roof", - 1131: "Softtop Roof", - 1132: "Slamin Exhaust", - 1133: "Right Chrome Strip Sideskirt", - 1134: "Right Chrome Strip Sideskirt", - 1135: "Slamin Exhaust", - 1136: "Chrome Exhaust", - 1137: "Left Chrome Strip Sideskirt", - 1138: "Alien Spoiler", - 1139: "X-Flow Spoiler", - 1140: "X-Flow Rear Bumper", - 1141: "Alien Rear Bumper", - 1142: "Left Oval Vents Vents", - 1143: "Right Oval Vents Vents", - 1144: "Left Square Vents Vents", - 1145: "Right Square Vents Vents", - 1146: "X-Flow Spoiler", - 1147: "Alien Spoiler", - 1148: "X-Flow Rear Bumper", - 1149: "Alien Rear Bumper", - 1150: "Alien Rear Bumper", - 1151: "X-Flow Rear Bumper", - 1152: "X-Flow Front Bumper", - 1153: "Alien Front Bumper", - 1154: "Alien Rear Bumper", - 1155: "Alien Front Bumper", - 1156: "X-Flow Rear Bumper", - 1157: "X-Flow Front Bumper", - 1158: "X-Flow Spoiler", - 1159: "Alien Rear Bumper", - 1160: "Alien Front Bumper", - 1161: "X-Flow Rear Bumper", - 1162: "Alien Spoiler", - 1163: "X-Flow Spoiler", - 1164: "Alien Spoiler", - 1165: "X-Flow Front Bumper", - 1166: "Alien Front Bumper", - 1167: "X-Flow Rear Bumper", - 1168: "Alien Rear Bumper", - 1169: "Alien Front Bumper", - 1170: "X-Flow Front Bumper", - 1171: "Alien Front Bumper", - 1172: "X-Flow Front Bumper", - 1173: "X-Flow Front Bumper", - 1174: "Chrome Front Bumper", - 1175: "Slamin Rear Bumper", - 1176: "Chrome Front Bumper", - 1177: "Slamin Rear Bumper", - 1178: "Slamin Rear Bumper", - 1179: "Chrome Front Bumper", - 1180: "Chrome Rear Bumper", - 1181: "Slamin Front Bumper", - 1182: "Chrome Front Bumper", - 1183: "Slamin Rear Bumper", - 1184: "Chrome Rear Bumper", - 1185: "Slamin Front Bumper", - 1186: "Slamin Rear Bumper", - 1187: "Chrome Rear Bumper", - 1188: "Slamin Front Bumper", - 1189: "Chrome Front Bumper", - 1190: "Slamin Front Bumper", - 1191: "Chrome Front Bumper", - 1192: "Chrome Rear Bumper", - 1193: "Slamin Rear Bumper" - }, - [], // GTA IV - [], // GTA IV (EFLC) - [], // Invalid - [], // Invalid - [], // Invalid - [], // Mafia 1 - [], // Mafia 2 - [], // Mafia 3 - [], // Mafia 1 Definitive Edition - ], - fishingLocations: [ - false, - [ - // GTA III + vehicleUpgrades: [ + {}, // Invalid + {}, // GTA III + {}, // GTA VC + {}, // GTA UG + { // GTA SA + 1000: "Pro Spoiler", + 1001: "Win Spoiler", + 1002: "Drag Spoiler", + 1003: "Alpha Spoiler", + 1004: "Champ Scoop Hood", + 1005: "Fury Scoop Hood", + 1006: "Roof Scoop Roof", + 1007: "Right Sideskirt", + 1008: "5x Nitro", + 1009: "2x Nitro", + 1010: "10x Nitro", + 1011: "Race Scoop Hood", + 1012: "Worx Scoop Hood", + 1013: "Round Fog Lamps", + 1014: "Champ Spoiler", + 1015: "Race Spoiler", + 1016: "Worx Spoiler", + 1017: "Left Sideskirt", + 1018: "Upswept Exhaust", + 1019: "Twin Exhaust", + 1020: "Large Exhaust", + 1021: "Medium Exhaust", + 1022: "Small Exhaust", + 1023: "Fury Spoiler", + 1024: "Square Fog Lamps", + 1025: "Offroad Wheels", + 1026: "Right Alien Sideskirt", + 1027: "Left Alien Sideskirt", + 1028: "Alien Exhaust", + 1029: "X-Flow Exhaust", + 1030: "Left X-Flow Sideskirt", + 1031: "Right X-Flow Sideskirt", + 1032: "Alien Roof Vent Roof", + 1033: "X-Flow Roof Vent Roof", + 1034: "Alien Exhaust", + 1035: "X-Flow Roof Vent Roof", + 1036: "Right Alien Sideskirt", + 1037: "X-Flow Exhaust", + 1038: "Alien Roof Vent Roof", + 1039: "Left X-Flow Sideskirt", + 1040: "Left Alien Sideskirt", + 1041: "Right X-Flow Sideskirt", + 1042: "Right Chrome Sideskirt", + 1043: "Slamin Exhaust", + 1044: "Chrome Exhaust", + 1045: "X-Flow Exhaust", + 1046: "Alien Exhaust", + 1047: "Right Alien Sideskirt", + 1048: "Right X-Flow Sideskirt", + 1049: "Alien Spoiler", + 1050: "X-Flow Spoiler", + 1051: "Left Alien Sideskirt", + 1052: "Left X-Flow Sideskirt", + 1053: "X-Flow Roof", + 1054: "Alien Roof", + 1055: "Alien Roof", + 1056: "Right Alien Sideskirt", + 1057: "Right X-Flow Sideskirt", + 1058: "Alien Spoiler", + 1059: "X-Flow Exhaust", + 1060: "X-Flow Spoiler", + 1061: "X-Flow Roof", + 1062: "Left Alien Sideskirt", + 1063: "Left X-Flow Sideskirt", + 1064: "Alien Exhaust", + 1065: "Alien Exhaust", + 1066: "X-Flow Exhaust", + 1067: "Alien Roof", + 1068: "X-Flow Roof", + 1069: "Right Alien Sideskirt", + 1070: "Right X-Flow Sideskirt", + 1071: "Left Alien Sideskirt", + 1072: "Left X-Flow Sideskirt", + 1073: "Shadow Wheels", + 1074: "Mega Wheels", + 1075: "Rimshine Wheels", + 1076: "Wires Wheels", + 1077: "Classic Wheels", + 1078: "Twist Wheels", + 1079: "Cutter Wheels", + 1080: "Switch Wheels", + 1081: "Grove Wheels", + 1082: "Import Wheels", + 1083: "Dollar Wheels", + 1084: "Trance Wheels", + 1085: "Atomic Wheels", + 1086: "Stereo Stereo", + 1087: "Hydraulics Hydraulics", + 1088: "Alien Roof", + 1089: "X-Flow Exhaust", + 1090: "Right Alien Sideskirt", + 1091: "X-Flow Roof", + 1092: "Alien Exhaust", + 1093: "Right X-Flow Sideskirt", + 1094: "Left Alien Sideskirt", + 1095: "Right X-Flow Sideskirt", + 1096: "Ahab Wheels", + 1097: "Virtual Wheels", + 1098: "Access Wheels", + 1099: "Left Chrome Sideskirt", + 1100: "Chrome Grill Bullbar", + 1101: "Left Chrome Flames Sideskirt", + 1102: "Left Chrome Strip Sideskirt", + 1103: "Covertible Roof", + 1104: "Chrome Exhaust", + 1105: "Slamin Exhaust", + 1106: "Right Chrome Arches Sideskirt", + 1107: "Left Chrome Strip Sideskirt", + 1108: "Right Chrome Strip Sideskirt", + 1109: "Chrome Rear Bullbars", + 1110: "Slamin Rear Bullbars", + 1113: "Chrome Exhaust", + 1114: "Slamin Exhaust", + 1115: "Chrome Front Bullbars", + 1116: "Slamin Front Bullbars", + 1117: "Chrome Front Bumper", + 1118: "Right Chrome Trim Sideskirt", + 1119: "Right Wheelcovers Sideskirt", + 1120: "Left Chrome Trim Sideskirt", + 1121: "Left Wheelcovers Sideskirt", + 1122: "Right Chrome Flames Sideskirt", + 1123: "Chrome Bars Bullbars", + 1124: "Left Chrome Arches Sideskirt", + 1125: "Chrome Lights Bullbars", + 1126: "Chrome Exhaust Exhaust", + 1127: "Slamin Exhaust Exhaust", + 1128: "Vinyl Hardtop Roof", + 1129: "Chrome Exhaust", + 1130: "Hardtop Roof", + 1131: "Softtop Roof", + 1132: "Slamin Exhaust", + 1133: "Right Chrome Strip Sideskirt", + 1134: "Right Chrome Strip Sideskirt", + 1135: "Slamin Exhaust", + 1136: "Chrome Exhaust", + 1137: "Left Chrome Strip Sideskirt", + 1138: "Alien Spoiler", + 1139: "X-Flow Spoiler", + 1140: "X-Flow Rear Bumper", + 1141: "Alien Rear Bumper", + 1142: "Left Oval Vents Vents", + 1143: "Right Oval Vents Vents", + 1144: "Left Square Vents Vents", + 1145: "Right Square Vents Vents", + 1146: "X-Flow Spoiler", + 1147: "Alien Spoiler", + 1148: "X-Flow Rear Bumper", + 1149: "Alien Rear Bumper", + 1150: "Alien Rear Bumper", + 1151: "X-Flow Rear Bumper", + 1152: "X-Flow Front Bumper", + 1153: "Alien Front Bumper", + 1154: "Alien Rear Bumper", + 1155: "Alien Front Bumper", + 1156: "X-Flow Rear Bumper", + 1157: "X-Flow Front Bumper", + 1158: "X-Flow Spoiler", + 1159: "Alien Rear Bumper", + 1160: "Alien Front Bumper", + 1161: "X-Flow Rear Bumper", + 1162: "Alien Spoiler", + 1163: "X-Flow Spoiler", + 1164: "Alien Spoiler", + 1165: "X-Flow Front Bumper", + 1166: "Alien Front Bumper", + 1167: "X-Flow Rear Bumper", + 1168: "Alien Rear Bumper", + 1169: "Alien Front Bumper", + 1170: "X-Flow Front Bumper", + 1171: "Alien Front Bumper", + 1172: "X-Flow Front Bumper", + 1173: "X-Flow Front Bumper", + 1174: "Chrome Front Bumper", + 1175: "Slamin Rear Bumper", + 1176: "Chrome Front Bumper", + 1177: "Slamin Rear Bumper", + 1178: "Slamin Rear Bumper", + 1179: "Chrome Front Bumper", + 1180: "Chrome Rear Bumper", + 1181: "Slamin Front Bumper", + 1182: "Chrome Front Bumper", + 1183: "Slamin Rear Bumper", + 1184: "Chrome Rear Bumper", + 1185: "Slamin Front Bumper", + 1186: "Slamin Rear Bumper", + 1187: "Chrome Rear Bumper", + 1188: "Slamin Front Bumper", + 1189: "Chrome Front Bumper", + 1190: "Slamin Front Bumper", + 1191: "Chrome Front Bumper", + 1192: "Chrome Rear Bumper", + 1193: "Slamin Rear Bumper" + }, + [], // GTA IV + [], // GTA IV (EFLC) + [], // Invalid + [], // Invalid + [], // Invalid + [], // Mafia 1 + [], // Mafia 2 + [], // Mafia 3 + [], // Mafia 1 Definitive Edition + ], + fishingLocations: [ + false, + [ + // GTA III - ], - [ - // GTA Vice City + ], + [ + // GTA Vice City - ], - [ // GTA San Andreas - toVector3(403.8266, -2088.7598, 7.8359), - toVector3(398.7553, -2088.7490, 7.8359), - toVector3(396.2197,-2088.6692,7.8359), - toVector3(391.1094,-2088.7976,7.8359), - toVector3(383.4157,-2088.7849,7.8359), - toVector3(374.9598,-2088.7979,7.8359), - toVector3(369.8107,-2088.7927,7.8359), - toVector3(367.3637,-2088.7925,7.8359), - toVector3(362.2244,-2088.7981,7.8359), - toVector3(354.5382,-2088.7979,7.8359), - ], - false, - [ - // GTA IV + ], + [ // GTA San Andreas + toVector3(403.8266, -2088.7598, 7.8359), + toVector3(398.7553, -2088.7490, 7.8359), + toVector3(396.2197,-2088.6692,7.8359), + toVector3(391.1094,-2088.7976,7.8359), + toVector3(383.4157,-2088.7849,7.8359), + toVector3(374.9598,-2088.7979,7.8359), + toVector3(369.8107,-2088.7927,7.8359), + toVector3(367.3637,-2088.7925,7.8359), + toVector3(362.2244,-2088.7981,7.8359), + toVector3(354.5382,-2088.7979,7.8359), + ], + false, + [ + // GTA IV - ], - false, - false, - false, - [ - // Mafia 1 - ], - [ - // Mafia 2 - ], - [ - // Mafia 3 - ], - [ - // Mafia 1 Definitive Edition - ], - ], - fishingCollectables: [ - [], // Invalid - [ // GTA III - // Fish - ["Salmon"], - ["Tuna"], - ["Crab"], - ["Trout"], - ["Sea Bass"], - ["Shark"], - ["Turtle"], - ["Manta Ray"], - ["Cat Fish"], - ["Blue Marlin"], + ], + false, + false, + false, + [ + // Mafia 1 + ], + [ + // Mafia 2 + ], + [ + // Mafia 3 + ], + [ + // Mafia 1 Definitive Edition + ], + ], + fishingCollectables: [ + [], // Invalid + [ // GTA III + // Fish + ["Salmon"], + ["Tuna"], + ["Crab"], + ["Trout"], + ["Sea Bass"], + ["Shark"], + ["Turtle"], + ["Manta Ray"], + ["Cat Fish"], + ["Blue Marlin"], - // Junk - ["Rusty Can"], - ["Old Pants"], - ["Shoes"], - ["Garbage"], - ["Baby Diaper"], - ["Tire"], - ["Car Battery"], - ["Horse Hoove"], - ["Log"], - ["Soggy Dildo"], - ["Clump of Seaweed"], - ], - [ // GTA VC - // Fish - ["Salmon"], - ["Tuna"], - ["Crab"], - ["Trout"], - ["Sea Bass"], - ["Shark"], - ["Turtle"], - ["Manta Ray"], - ["Cat Fish"], - ["Blue Marlin"], + // Junk + ["Rusty Can"], + ["Old Pants"], + ["Shoes"], + ["Garbage"], + ["Baby Diaper"], + ["Tire"], + ["Car Battery"], + ["Horse Hoove"], + ["Log"], + ["Soggy Dildo"], + ["Clump of Seaweed"], + ], + [ // GTA VC + // Fish + ["Salmon"], + ["Tuna"], + ["Crab"], + ["Trout"], + ["Sea Bass"], + ["Shark"], + ["Turtle"], + ["Manta Ray"], + ["Cat Fish"], + ["Blue Marlin"], - // Junk - ["Rusty Can"], - ["Old Pants"], - ["Shoes"], - ["Garbage"], - ["Baby Diaper"], - ["Tire"], - ["Car Battery"], - ["Horse Hoove"], - ["Log"], - ["Soggy Dildo"], - ["Clump of Seaweed"], - ], - [ // GTA SA - // Fish - ["Salmon"], - ["Tuna"], - ["Crab"], - ["Trout"], - ["Sea Bass"], - ["Shark"], - ["Turtle"], - ["Manta Ray"], - ["Cat Fish"], - ["Blue Marlin"], + // Junk + ["Rusty Can"], + ["Old Pants"], + ["Shoes"], + ["Garbage"], + ["Baby Diaper"], + ["Tire"], + ["Car Battery"], + ["Horse Hoove"], + ["Log"], + ["Soggy Dildo"], + ["Clump of Seaweed"], + ], + [ // GTA SA + // Fish + ["Salmon"], + ["Tuna"], + ["Crab"], + ["Trout"], + ["Sea Bass"], + ["Shark"], + ["Turtle"], + ["Manta Ray"], + ["Cat Fish"], + ["Blue Marlin"], - // Junk - ["Rusty Can"], - ["Old Pants"], - ["Shoes"], - ["Garbage"], - ["Baby Diaper"], - ["Tire"], - ["Car Battery"], - ["Horse Hoove"], - ["Log"], - ["Soggy Dildo"], - ["Clump of Seaweed"], - ], - [], // Invalid - [ // GTA IV - // Fish - ["Salmon"], - ["Tuna"], - ["Crab"], - ["Trout"], - ["Sea Bass"], - ["Shark"], - ["Turtle"], - ["Manta Ray"], - ["Cat Fish"], - ["Blue Marlin"], + // Junk + ["Rusty Can"], + ["Old Pants"], + ["Shoes"], + ["Garbage"], + ["Baby Diaper"], + ["Tire"], + ["Car Battery"], + ["Horse Hoove"], + ["Log"], + ["Soggy Dildo"], + ["Clump of Seaweed"], + ], + [], // Invalid + [ // GTA IV + // Fish + ["Salmon"], + ["Tuna"], + ["Crab"], + ["Trout"], + ["Sea Bass"], + ["Shark"], + ["Turtle"], + ["Manta Ray"], + ["Cat Fish"], + ["Blue Marlin"], - // Junk - ["Rusty Can"], - ["Old Pants"], - ["Shoes"], - ["Garbage"], - ["Baby Diaper"], - ["Tire"], - ["Car Battery"], - ["Horse Hoove"], - ["Log"], - ["Soggy Dildo"], - ["Clump of Seaweed"], - ], - [ // GTA IV EFLC - // Fish - ["Salmon"], - ["Tuna"], - ["Crab"], - ["Trout"], - ["Sea Bass"], - ["Shark"], - ["Turtle"], - ["Manta Ray"], - ["Cat Fish"], - ["Blue Marlin"], + // Junk + ["Rusty Can"], + ["Old Pants"], + ["Shoes"], + ["Garbage"], + ["Baby Diaper"], + ["Tire"], + ["Car Battery"], + ["Horse Hoove"], + ["Log"], + ["Soggy Dildo"], + ["Clump of Seaweed"], + ], + [ // GTA IV EFLC + // Fish + ["Salmon"], + ["Tuna"], + ["Crab"], + ["Trout"], + ["Sea Bass"], + ["Shark"], + ["Turtle"], + ["Manta Ray"], + ["Cat Fish"], + ["Blue Marlin"], - // Junk - ["Rusty Can"], - ["Old Pants"], - ["Shoes"], - ["Garbage"], - ["Baby Diaper"], - ["Tire"], - ["Car Battery"], - ["Horse Hoove"], - ["Log"], - ["Soggy Dildo"], - ["Clump of Seaweed"], - ], - [ - // Mafia 1 - ], - [ - // Mafia 2 - ], - [ - // Mafia 3 - ], - [ - // Mafia 1 Definitive Edition - ], - ], - mainWorldDimension: [ - 0, // Invalid - 0, // GTA 3 - 0, // GTA VC - 0, // GTA SA - 0, // GTA UG - 0, // GTA IV - 0, // GTA IV EFLC - 0, // Invalid - 0, // Invalid - 0, // Invalid - 0, // Mafia 1 - 0, // Mafia 2 - 0, // Mafia 3 - 0, // Mafia Definitive Edition - ], - mainWorldInterior: [ - 0, // Invalid - 0, // GTA 3 - 0, // GTA VC - 0, // GTA SA - 0, // GTA UG - 0, // GTA IV - 0, // GTA IV EFLC - 0, // Invalid - 0, // Invalid - 0, // Invalid - 0, // Mafia 1 - 0, // Mafia 2 - 0, // Mafia 3 - 0, // Mafia Definitive Edition - ], + // Junk + ["Rusty Can"], + ["Old Pants"], + ["Shoes"], + ["Garbage"], + ["Baby Diaper"], + ["Tire"], + ["Car Battery"], + ["Horse Hoove"], + ["Log"], + ["Soggy Dildo"], + ["Clump of Seaweed"], + ], + [ + // Mafia 1 + ], + [ + // Mafia 2 + ], + [ + // Mafia 3 + ], + [ + // Mafia 1 Definitive Edition + ], + ], + mainWorldDimension: [ + 0, // Invalid + 0, // GTA 3 + 0, // GTA VC + 0, // GTA SA + 0, // GTA UG + 0, // GTA IV + 0, // GTA IV EFLC + 0, // Invalid + 0, // Invalid + 0, // Invalid + 0, // Mafia 1 + 0, // Mafia 2 + 0, // Mafia 3 + 0, // Mafia Definitive Edition + ], + mainWorldInterior: [ + 0, // Invalid + 0, // GTA 3 + 0, // GTA VC + 0, // GTA SA + 0, // GTA UG + 0, // GTA IV + 0, // GTA IV EFLC + 0, // Invalid + 0, // Invalid + 0, // Invalid + 0, // Mafia 1 + 0, // Mafia 2 + 0, // Mafia 3 + 0, // Mafia Definitive Edition + ], }; // =========================================================================== \ No newline at end of file diff --git a/scripts/shared/utilities.js b/scripts/shared/utilities.js index f23a81e1..cfce224a 100644 --- a/scripts/shared/utilities.js +++ b/scripts/shared/utilities.js @@ -8,121 +8,121 @@ // =========================================================================== let bindableKeys = { - 8: "backspace", - 9: "tab", - 13: "return", - 27: "escape", - 32: "space", - 33: "exclamation", - 34: "doublequote", - 35: "hashtag", - 36: "dollar", - 37: "percent", - 38: "ampersand", - 39: "quote", - 40: "leftparenthesis", - 41: "rightparenthesis", - 42: "asterisk", - 43: "plus", - 44: "comma", - 45: "minus", - 46: "period", - 47: "slash", - 48: "0", - 49: "1", - 50: "2", - 51: "3", - 52: "4", - 53: "5", - 54: "6", - 55: "7", - 56: "8", - 57: "9", - 58: "colon", - 59: "semicolon", - 60: "less", - 61: "equals", - 62: "greater", - 63: "questionmark", - 64: "at", - 91: "leftbracket", - 92: "backslash", - 93: "rightbracket", - 95: "underscore", - 97: "a", - 98: "b", - 99: "c", - 100: "d", - 101: "e", - 102: "f", - 103: "g", - 104: "h", - 105: "i", - 106: "j", - 107: "k", - 108: "l", - 109: "m", - 110: "n", - 111: "o", - 112: "p", - 113: "q", - 114: "r", - 115: "s", - 116: "t", - 117: "u", - 118: "v", - 119: "w", - 120: "x", - 121: "y", - 122: "z", - 127: "delete", - 1073741881: "capslock", - 1073741882: "f12", - 1073741883: "f2", - 1073741884: "f3", - 1073741885: "f4", - 1073741886: "f5", - 1073741887: "f6", - 1073741888: "f7", - 1073741889: "f8", - 1073741890: "f9", - 1073741891: "f10", - 1073741892: "f11", - 1073741893: "f12", - 1073741894: "printscreen", - 1073741895: "scrolllock", - 1073741896: "pause", - 1073741897: "insert", - 1073741898: "home", - 1073741899: "pageup", - 1073741901: "end", - 1073741902: "pagedown", - 1073741903: "right", - 1073741904: "left", - 1073741905: "down", - 1073741906: "up", - 1073741908: "numdivide", - 1073741909: "nummultiply", - 1073741910: "numminus", - 1073741911: "numplus", - 1073741912: "numenter", - 1073741913: "num1", - 1073741914: "num2", - 1073741915: "num3", - 1073741916: "num4", - 1073741917: "num5", - 1073741918: "num6", - 1073741919: "num7", - 1073741920: "num8", - 1073741921: "num9", - 1073741922: "num0", - 1073741923: "numperiod", - 1073742048: "leftctrl", - 1073742049: "leftshift", - 1073742050: "leftalt", - 1073742052: "rightctrl", - 1073742053: "rightshift", - 1073742054: "rightalt", + 8: "backspace", + 9: "tab", + 13: "return", + 27: "escape", + 32: "space", + 33: "exclamation", + 34: "doublequote", + 35: "hashtag", + 36: "dollar", + 37: "percent", + 38: "ampersand", + 39: "quote", + 40: "leftparenthesis", + 41: "rightparenthesis", + 42: "asterisk", + 43: "plus", + 44: "comma", + 45: "minus", + 46: "period", + 47: "slash", + 48: "0", + 49: "1", + 50: "2", + 51: "3", + 52: "4", + 53: "5", + 54: "6", + 55: "7", + 56: "8", + 57: "9", + 58: "colon", + 59: "semicolon", + 60: "less", + 61: "equals", + 62: "greater", + 63: "questionmark", + 64: "at", + 91: "leftbracket", + 92: "backslash", + 93: "rightbracket", + 95: "underscore", + 97: "a", + 98: "b", + 99: "c", + 100: "d", + 101: "e", + 102: "f", + 103: "g", + 104: "h", + 105: "i", + 106: "j", + 107: "k", + 108: "l", + 109: "m", + 110: "n", + 111: "o", + 112: "p", + 113: "q", + 114: "r", + 115: "s", + 116: "t", + 117: "u", + 118: "v", + 119: "w", + 120: "x", + 121: "y", + 122: "z", + 127: "delete", + 1073741881: "capslock", + 1073741882: "f12", + 1073741883: "f2", + 1073741884: "f3", + 1073741885: "f4", + 1073741886: "f5", + 1073741887: "f6", + 1073741888: "f7", + 1073741889: "f8", + 1073741890: "f9", + 1073741891: "f10", + 1073741892: "f11", + 1073741893: "f12", + 1073741894: "printscreen", + 1073741895: "scrolllock", + 1073741896: "pause", + 1073741897: "insert", + 1073741898: "home", + 1073741899: "pageup", + 1073741901: "end", + 1073741902: "pagedown", + 1073741903: "right", + 1073741904: "left", + 1073741905: "down", + 1073741906: "up", + 1073741908: "numdivide", + 1073741909: "nummultiply", + 1073741910: "numminus", + 1073741911: "numplus", + 1073741912: "numenter", + 1073741913: "num1", + 1073741914: "num2", + 1073741915: "num3", + 1073741916: "num4", + 1073741917: "num5", + 1073741918: "num6", + 1073741919: "num7", + 1073741920: "num8", + 1073741921: "num9", + 1073741922: "num0", + 1073741923: "numperiod", + 1073742048: "leftctrl", + 1073742049: "leftshift", + 1073742050: "leftalt", + 1073742052: "rightctrl", + 1073742053: "rightshift", + 1073742054: "rightalt", }; // =========================================================================== @@ -1138,24 +1138,24 @@ function makeLargeNumberReadable(num) { // =========================================================================== function getKeyIdFromParams(params) { - let tempParams = toLowerCase(toString(params)); + let tempParams = toLowerCase(toString(params)); - //let sdlName = sdl.getKeyFromName(tempParams); - //if(sdlName != null) { - // return sdlName; - //} + //let sdlName = sdl.getKeyFromName(tempParams); + //if(sdlName != null) { + // return sdlName; + //} - for(let i in bindableKeys) { - if(toLowerCase(bindableKeys[i]) == toLowerCase(tempParams)) { - return i; - } - } + for(let i in bindableKeys) { + if(toLowerCase(bindableKeys[i]) == toLowerCase(tempParams)) { + return i; + } + } } // =========================================================================== function getKeyNameFromId(params) { - return bindableKeys[toInteger(params)]; + return bindableKeys[toInteger(params)]; } // =========================================================================== @@ -1350,7 +1350,7 @@ function getEntityData(entity, dataName) { return entity.getData(dataName); } } - return null; + return null; } // =========================================================================== @@ -1371,7 +1371,7 @@ function removeEntityData(entity, dataName) { if(entity != null) { return entity.removeData(dataName); } - return null; + return null; } // =========================================================================== @@ -1389,15 +1389,15 @@ function getDistance(vec1, vec2) { if(isNull(vec1) || isNull(vec2)) { return false; } - return vec1.distance(vec2); + return vec1.distance(vec2); } // =========================================================================== function logToConsole(tempLogLevel, text) { - if(typeof server != "undefined") { - text = removeColoursInMessage(text); - } + if(typeof server != "undefined") { + text = removeColoursInMessage(text); + } if((logLevel & tempLogLevel) || logLevel == LOG_ALL) { if(tempLogLevel == LOG_ERROR) { @@ -1417,10 +1417,10 @@ function logToConsole(tempLogLevel, text) { // =========================================================================== function Enum(constantsList) { - let tempTable = {}; + let tempTable = {}; for(let i in constantsList) { - tempTable[constantsList[i]] = i; - } + tempTable[constantsList[i]] = i; + } return tempTable; } @@ -1499,13 +1499,13 @@ function arePickupsSupported() { // =========================================================================== function areBlipsSupported() { - return supportedFeatures.blips[getGame()]; + return supportedFeatures.blips[getGame()]; } // =========================================================================== function areMarkersSupported() { - return supportedFeatures.markers[getGame()]; + return supportedFeatures.markers[getGame()]; } // =========================================================================== @@ -1800,7 +1800,7 @@ function getPosInFrontOfPos(pos, angle, distance) { y = (pos.y+((Math.sin(angle+(Math.PI/2)))*distance)); } else { while(angle < 0.0) - angle += 360.0; + angle += 360.0; while(angle > 360.0) angle -= 360.0; @@ -2056,23 +2056,23 @@ function removeHexColoursFromString(str) { // =========================================================================== async function waitUntil(condition) { - return new Promise((resolve) => { - let interval = setInterval(() => { - if (!condition()) { - return - } + return new Promise((resolve) => { + let interval = setInterval(() => { + if (!condition()) { + return + } - clearInterval(interval); - resolve(); - }, 1); - }); + clearInterval(interval); + resolve(); + }, 1); + }); } // =========================================================================== function getGameLocationFromParams(params) { if(isNaN(params)) { - let locations = getGameConfig().locations[getGame()]; + let locations = getGameConfig().locations[getGame()]; for(let i in locations) { if(toLowerCase(locations[i][0]).indexOf(toLowerCase(params)) != -1) { return i; @@ -2204,16 +2204,16 @@ function getCardinalDirection(pos1, pos2) { function getTimeDifferenceDisplay(timeStamp2, timeStamp1) { timeStamp1 = timeStamp1 * 1000; timeStamp2 = timeStamp2 * 1000; - if(isNaN(timeStamp1) || isNaN(timeStamp2)) { - return "Unknown"; - } + if(isNaN(timeStamp1) || isNaN(timeStamp2)) { + return "Unknown"; + } let millisecondDiff = timeStamp2 - timeStamp1; - let days = Math.floor(millisecondDiff / 1000 / 60 / (60 * 24)); - let diffDate = new Date(millisecondDiff); + let days = Math.floor(millisecondDiff / 1000 / 60 / (60 * 24)); + let diffDate = new Date(millisecondDiff); - return `${days} days, ${diffDate.getHours()} hours, ${diffDate.getMinutes()} minutes`; + return `${days} days, ${diffDate.getHours()} hours, ${diffDate.getMinutes()} minutes`; } // =========================================================================== @@ -2399,12 +2399,24 @@ function isConsole(client) { // =========================================================================== +/** + * Gets the console client (only valid on server) + * + * @return {Boolean} Whether or not the two clients are the same + * + */ function isSamePlayer(client1, client2) { return (client1 == client2); } // =========================================================================== +/** + * Gets the console client (only valid on server) + * + * @return {Client} Console client + * + */ function getConsoleClient() { let clients = getClients(); for(let i in clients) { @@ -2416,24 +2428,51 @@ function getConsoleClient() { // =========================================================================== +/** + * Gets the entire colours table + * + * @return {Object} Colours table + * + */ function getServerColours() { return serverColours; } // =========================================================================== +/** + * Gets an RGB value for a colour type name + * + * @param {String} typeName - Colour type name (red, blue, etc) + * @return {Number} Colour value (same as from toColour) + * + */ function getColourByType(typeName) { return getServerColours().byType[typeName]; } // =========================================================================== +/** + * Gets an RGB value for a colour name + * + * @param {String} colourName - Colour name (error, businessBlue, etc) + * @return {Number} Colour value (same as from toColour) + * + */ function getColourByName(colourName) { return getServerColours().byName[colourName]; } // =========================================================================== +/** + * Gets a hex value for a colour type + * + * @param {String} colourName - Colour name (red, blue, etc) + * @return {String} Hex value as string without brackets (has only the hashtag) + * + */ function getHexColourByName(colourName) { //let rgbaColour = getServerColours().byName[colourName]; //let rgbaArray = rgbaArrayFromToColour(rgbaColour); @@ -2444,7 +2483,14 @@ function getHexColourByName(colourName) { // =========================================================================== -function getHexColourByType(colourName) { +/** + * Gets a hex value for a colour type + * + * @param {String} typeName - Colour type name (error, businessBlue, etc) + * @return {String} Hex value as string without brackets (has only the hashtag) + * + */ +function getHexColourByType(typeName) { //let rgbaColour = getServerColours().byType[colourName]; //let rgbaArray = rgbaArrayFromToColour(rgbaColour); //return rgbToHex(rgbaArray[0], rgbaArray[1], rgbaArray[2]); @@ -2585,29 +2631,43 @@ function getInlineChatColourByType(colourName) { * */ 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 - ]; + //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 + ]; } // =========================================================================== +/** + * Gets a hex formatting colour by type for use inline in chatbox messages (example: [#FFFFFF]). + * + * @param {Number} colourValue - Colour value (from toColour) + * @return {String} HEX-formatted colour string without brackets (just the hashtag) + * + */ function hexFromToColour(colour) { let rgba = rgbaArrayFromToColour(colour); - return rgbToHex(rgba[0], rgba[1], rgba[2]); + return rgbToHex(rgba[0], rgba[1], rgba[2]); } // =========================================================================== +/** + * Replaces colour types with HEX values in a message string + * + * @param {String} colouredString - String with colours + * @return {String} String with replaced colours for inline chatbox usage + * + */ function replaceColoursInMessage(messageText) { if(messageText == null) { return ""; @@ -2642,6 +2702,13 @@ function replaceColoursInMessage(messageText) { // =========================================================================== +/** + * Removes colour types from a message + * + * @param {String} colouredString - String with colours + * @return {String} String without colours + * + */ function removeColoursInMessage(messageText) { if(messageText == null) { return ""; @@ -2676,6 +2743,13 @@ function removeColoursInMessage(messageText) { // =========================================================================== +/** + * Replaces emoji texts with actual emoji + * + * @param {String} colouredString - String with emoji names + * @return {String} String with actual emoji images + * + */ function replaceEmojiInString(messageString) { for(let i in emojiReplaceString) { while(messageString.indexOf(emojiReplaceString[i][0]) != -1) { From d0e0cc7c2cea5b0759b7bd07220599d43a00551a Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Wed, 16 Mar 2022 17:06:57 -0500 Subject: [PATCH 028/177] More indentation conversion --- scripts/client/vehicle.js | 8 + scripts/server/item/handcuff.js | 12 +- scripts/server/item/phone.js | 50 +-- scripts/server/item/rope.js | 10 +- scripts/server/item/tazer.js | 30 +- scripts/server/item/walkie-talkie.js | 6 +- scripts/server/job/police.js | 204 +++++----- scripts/server/job/taxi.js | 32 +- scripts/server/native/connected.js | 354 +++++++++--------- third-party/mexui/Core/Component/Control.js | 5 +- third-party/mexui/Core/Component/Entry.js | 3 +- third-party/mexui/Core/Component/Event.js | 1 - third-party/mexui/Core/Component/Window.js | 49 ++- third-party/mexui/Core/Control/Button.js | 6 +- third-party/mexui/Core/Control/Date.js | 46 +-- third-party/mexui/Core/Control/DropDown.js | 38 +- third-party/mexui/Core/Control/Grid.js | 29 +- third-party/mexui/Core/Control/Hour.js | 4 +- third-party/mexui/Core/Control/Image.js | 6 +- third-party/mexui/Core/Control/List.js | 11 +- third-party/mexui/Core/Control/Minute.js | 4 +- third-party/mexui/Core/Control/Password.js | 2 +- third-party/mexui/Core/Control/ProgressBar.js | 12 +- third-party/mexui/Core/Control/RadioButton.js | 18 +- .../mexui/Core/Control/RangedInteger.js | 4 +- .../mexui/Core/Control/RangedNumber.js | 4 +- third-party/mexui/Core/Control/ScrollBar.js | 12 +- third-party/mexui/Core/Control/Second.js | 4 +- third-party/mexui/Core/Control/Slider.js | 19 +- third-party/mexui/Core/Control/TabPanel.js | 24 +- third-party/mexui/Core/Control/Text.js | 6 +- third-party/mexui/Core/Control/TextArea.js | 2 +- third-party/mexui/Core/Control/TextInput.js | 46 +-- third-party/mexui/Core/Control/Time.js | 48 +-- third-party/mexui/Core/Control/Tree.js | 31 +- third-party/mexui/Core/Control/Week.js | 4 +- third-party/mexui/Core/Control/Year.js | 2 +- third-party/mexui/Core/Entity/Component.js | 2 +- third-party/mexui/Core/Entity/ControlAxis.js | 19 +- .../mexui/Core/Entity/ControlWithEntries.js | 11 +- .../mexui/Core/Entity/StyleableEntity.js | 39 +- third-party/mexui/Core/Entity/Transition.js | 15 +- third-party/mexui/Core/Entry/DropDownItem.js | 2 +- third-party/mexui/Core/Entry/GridColumn.js | 2 +- third-party/mexui/Core/Entry/GridRow.js | 3 +- third-party/mexui/Core/Entry/ListRow.js | 2 +- third-party/mexui/Core/Entry/Tab.js | 6 +- third-party/mexui/Core/Entry/TreeRow.js | 2 +- third-party/mexui/Core/Native.js | 1 - third-party/mexui/Core/Utility.js | 6 +- third-party/mexui/mexui.js | 1 - 51 files changed, 625 insertions(+), 632 deletions(-) create mode 100644 scripts/client/vehicle.js diff --git a/scripts/client/vehicle.js b/scripts/client/vehicle.js new file mode 100644 index 00000000..bc8126ff --- /dev/null +++ b/scripts/client/vehicle.js @@ -0,0 +1,8 @@ +// =========================================================================== +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/gtac_roleplay +// =========================================================================== +// FILE: vehicle.js +// DESC: Provides vehicle functions and arrays with data +// TYPE: Client (JavaScript) +// =========================================================================== \ No newline at end of file diff --git a/scripts/server/item/handcuff.js b/scripts/server/item/handcuff.js index 132dccf2..3d9ce657 100644 --- a/scripts/server/item/handcuff.js +++ b/scripts/server/item/handcuff.js @@ -10,27 +10,27 @@ // =========================================================================== function isPlayerHandCuffed(client) { - return (getPlayerData(client).pedState == VRR_PEDSTATE_BINDED); + return (getPlayerData(client).pedState == VRR_PEDSTATE_BINDED); } // =========================================================================== function handCuffPlayer(client) { - getPlayerData(client).pedState = VRR_PEDSTATE_BINDED; - setPlayerControlState(client, false); + getPlayerData(client).pedState = VRR_PEDSTATE_BINDED; + setPlayerControlState(client, false); } // =========================================================================== function unHandCuffPlayer(client) { - getPlayerData(client).pedState = VRR_PEDSTATE_READY; - setPlayerControlState(client, true); + getPlayerData(client).pedState = VRR_PEDSTATE_READY; + setPlayerControlState(client, true); } // =========================================================================== function isPlayerSurrendered(client) { - return true; //(getPlayerData(client).pedState == VRR_PEDSTATE_TAZED || getPlayerData(client).pedState == VRR_PEDSTATE_HANDSUP); + return true; //(getPlayerData(client).pedState == VRR_PEDSTATE_TAZED || getPlayerData(client).pedState == VRR_PEDSTATE_HANDSUP); } // =========================================================================== \ No newline at end of file diff --git a/scripts/server/item/phone.js b/scripts/server/item/phone.js index 2e1b4312..657eca37 100644 --- a/scripts/server/item/phone.js +++ b/scripts/server/item/phone.js @@ -8,48 +8,48 @@ // =========================================================================== function getItemWithPhoneNumber(phoneNumber) { - for(let i in getServerData().items) { - if(getItemTypeData(getItemData(i).itemTypeIndex).useType == VRR_ITEM_USETYPE_PHONE) { - if(getItemData(i).value == phoneNumber) { - return i; - } - } - } - return -1; + for(let i in getServerData().items) { + if(getItemTypeData(getItemData(i).itemTypeIndex).useType == VRR_ITEM_USETYPE_PHONE) { + if(getItemData(i).value == phoneNumber) { + return i; + } + } + } + return -1; } // =========================================================================== function isPhoneItemEnabled(itemIndex) { - return getItemData(itemIndex).enabled; + return getItemData(itemIndex).enabled; } // =========================================================================== function ringPhoneForNearbyPlayers(itemIndex) { - /* - if(isPhoneItemEnabled(itemIndex)) { - switch(getItemData(itemIndex).ownerType) { - case VRR_ITEM_OWNER_GROUND: - playRingtoneForPlayersInRange(getItemData(itemIndex).position, getItemData(i).extra); - break; + /* + if(isPhoneItemEnabled(itemIndex)) { + switch(getItemData(itemIndex).ownerType) { + case VRR_ITEM_OWNER_GROUND: + playRingtoneForPlayersInRange(getItemData(itemIndex).position, getItemData(i).extra); + break; - case VRR_ITEM_OWNER_VEHTRUNK: - playRingtoneForPlayersInRange(getVehiclePosition(getItemData(itemIndex).ownerId), getItemData(i).extra); - break; + case VRR_ITEM_OWNER_VEHTRUNK: + playRingtoneForPlayersInRange(getVehiclePosition(getItemData(itemIndex).ownerId), getItemData(i).extra); + break; - case VRR_ITEM_OWNER_VEHDASH: - playRingtoneForPlayersInRange(getVehiclePosition(getItemData(itemIndex).ownerId), getItemData(i).extra); - break; - } - } - */ + case VRR_ITEM_OWNER_VEHDASH: + playRingtoneForPlayersInRange(getVehiclePosition(getItemData(itemIndex).ownerId), getItemData(i).extra); + break; + } + } + */ } // =========================================================================== function phoneTransmit(radioFrequency, messageText, transmittingPlayer) { - phoneOutgoingToNearbyPlayers(transmittingPlayer, messageText); + phoneOutgoingToNearbyPlayers(transmittingPlayer, messageText); } // =========================================================================== \ No newline at end of file diff --git a/scripts/server/item/rope.js b/scripts/server/item/rope.js index 8d3ff66a..1427023e 100644 --- a/scripts/server/item/rope.js +++ b/scripts/server/item/rope.js @@ -10,21 +10,21 @@ // =========================================================================== function isPlayerTied(client) { - return (getPlayerData(client).pedState == VRR_PEDSTATE_BINDED); + return (getPlayerData(client).pedState == VRR_PEDSTATE_BINDED); } // =========================================================================== function ropeTiePlayer(client) { - getPlayerData(client).pedState = VRR_PEDSTATE_BINDED; - setPlayerControlState(client, false); + getPlayerData(client).pedState = VRR_PEDSTATE_BINDED; + setPlayerControlState(client, false); } // =========================================================================== function ropeUnTiePlayer(client) { - getPlayerData(client).pedState = VRR_PEDSTATE_READY; - setPlayerControlState(client, true); + getPlayerData(client).pedState = VRR_PEDSTATE_READY; + setPlayerControlState(client, true); } // =========================================================================== \ No newline at end of file diff --git a/scripts/server/item/tazer.js b/scripts/server/item/tazer.js index f4fa16d5..6e756d24 100644 --- a/scripts/server/item/tazer.js +++ b/scripts/server/item/tazer.js @@ -10,34 +10,34 @@ // =========================================================================== function isPlayerTazed(client) { - return (getPlayerData(client).pedState == VRR_PEDSTATE_TAZED); + return (getPlayerData(client).pedState == VRR_PEDSTATE_TAZED); } // =========================================================================== function tazePlayer(client) { - getPlayerData(client).pedState = VRR_PEDSTATE_TAZED; - setPlayerControlState(client, false); + getPlayerData(client).pedState = VRR_PEDSTATE_TAZED; + setPlayerControlState(client, false); - let animationId = getAnimationFromParams("tazed"); - if(animationId != false) { - forcePlayerPlayAnimation(client, animationId); - } + let animationId = getAnimationFromParams("tazed"); + if(animationId != false) { + forcePlayerPlayAnimation(client, animationId); + } - setTimeout(function() { - unTazePlayer(client); - doActionToNearbyPlayers(client, `The tazer effect wears off`); - }, getGlobalConfig().tazerEffectDuration); + setTimeout(function() { + unTazePlayer(client); + doActionToNearbyPlayers(client, `The tazer effect wears off`); + }, getGlobalConfig().tazerEffectDuration); } // =========================================================================== function unTazePlayer(client) { - getPlayerData(client).pedState = VRR_PEDSTATE_READY; + getPlayerData(client).pedState = VRR_PEDSTATE_READY; - setPlayerControlState(client, true); - setPlayerPosition(client, getPlayerData(client).currentAnimationPositionReturnTo); - makePedStopAnimation(getPlayerData(client).ped); + setPlayerControlState(client, true); + setPlayerPosition(client, getPlayerData(client).currentAnimationPositionReturnTo); + makePedStopAnimation(getPlayerData(client).ped); } diff --git a/scripts/server/item/walkie-talkie.js b/scripts/server/item/walkie-talkie.js index fcea15e4..74c75be2 100644 --- a/scripts/server/item/walkie-talkie.js +++ b/scripts/server/item/walkie-talkie.js @@ -16,15 +16,15 @@ function getPlayerActiveWalkieTalkieFrequency(client) { return getItemData(getPlayerData(client).hotBarItems[walkieTalkieSlot]).value; } } - } + } - return false; + return false; } // =========================================================================== function walkieTalkieTransmit(radioFrequency, messageText, transmittingPlayer) { - walkieTalkieOutgoingToNearbyPlayers(transmittingPlayer, messageText); + walkieTalkieOutgoingToNearbyPlayers(transmittingPlayer, messageText); //let clients = getServerData().items; //for(let i in clients) { diff --git a/scripts/server/job/police.js b/scripts/server/job/police.js index a3aeeed9..cce5a85b 100644 --- a/scripts/server/job/police.js +++ b/scripts/server/job/police.js @@ -8,157 +8,157 @@ // =========================================================================== function policeTazerCommand(command, params, client) { - if(!canPlayerUseJobs(client)) { - messagePlayerError(client, "You are not allowed to use jobs."); - return false; - } + 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(!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(!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; - } + if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) { + messagePlayerError(client, "You don't have a police job."); + return false; + } - return true; + return true; } // =========================================================================== function policeCuffCommand(command, params, client) { - if(!canPlayerUseJobs(client)) { - messagePlayerError(client, "You are not allowed to use jobs."); - return false; - } + 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(!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(!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; - } + if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) { + messagePlayerError(client, "You don't have a police job."); + return false; + } - return true; + return true; } // =========================================================================== function policeArrestCommand(command, params, client) { - if(!canPlayerUseJobs(client)) { - messagePlayerError(client, "You are not allowed to use jobs."); - return false; - } + 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(!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(!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; - } + if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) { + messagePlayerError(client, "You don't have a police job."); + return false; + } - return true; + return true; } // =========================================================================== function policeSearchCommand(command, params, client) { - if(!canPlayerUseJobs(client)) { - messagePlayerError(client, "You are not allowed to use jobs."); - return false; - } + 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(!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(!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; - } + if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) { + messagePlayerError(client, "You don't have a police job."); + return false; + } - return true; + return true; } // =========================================================================== function policeDragCommand(command, params, client) { - if(!canPlayerUseJobs(client)) { - messagePlayerError(client, "You are not allowed to use jobs."); - return false; - } + 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(!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(!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; - } + if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) { + messagePlayerError(client, "You don't have a police job."); + return false; + } - return true; + return true; } // =========================================================================== function policeDetainCommand(command, params, client) { - if(!canPlayerUseJobs(client)) { - messagePlayerError(client, "You are not allowed to use jobs."); - return false; - } + 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(!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(!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; - } + if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) { + messagePlayerError(client, "You don't have a police job."); + return false; + } - return true; + return true; } // =========================================================================== \ No newline at end of file diff --git a/scripts/server/job/taxi.js b/scripts/server/job/taxi.js index 16444587..9985958f 100644 --- a/scripts/server/job/taxi.js +++ b/scripts/server/job/taxi.js @@ -8,25 +8,25 @@ // =========================================================================== function taxiSetFareCommand(command, params, client) { - if(!canPlayerUseJobs(client)) { - messagePlayerError(client, "You are not allowed to use jobs."); - return false; - } + if(!canPlayerUseJobs(client)) { + messagePlayerError(client, "You are not allowed to use jobs."); + return false; + } - if(!canPlayerUseTaxiJob(client)) { - messagePlayerError(client, "You are not allowed to use the taxi job."); - return false; - } + if(!canPlayerUseTaxiJob(client)) { + messagePlayerError(client, "You are not allowed to use the taxi job."); + return false; + } - if(!isPlayerWorking(client)) { - messagePlayerError(client, "You are not working! Use /startwork first."); - return false; - } + if(!isPlayerWorking(client)) { + messagePlayerError(client, "You are not working! Use /startwork first."); + return false; + } - if(!doesPlayerHaveJobType(client, VRR_JOB_TAXI)) { - messagePlayerError(client, "You don't have a taxi job."); - return false; - } + if(!doesPlayerHaveJobType(client, VRR_JOB_TAXI)) { + messagePlayerError(client, "You don't have a taxi job."); + return false; + } return true; } \ No newline at end of file diff --git a/scripts/server/native/connected.js b/scripts/server/native/connected.js index 2e5047bc..20522e9c 100644 --- a/scripts/server/native/connected.js +++ b/scripts/server/native/connected.js @@ -10,90 +10,90 @@ // =========================================================================== function getPlayerPosition(client) { - if(!areServerElementsSupported()) { - return getPlayerData(client).syncPosition; - } else { - if(client.player != null) { - return client.player.position; - } - } + if(!areServerElementsSupported()) { + return getPlayerData(client).syncPosition; + } else { + if(client.player != null) { + return client.player.position; + } + } } // =========================================================================== function setPlayerPosition(client, position) { - logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s position to ${position.x}, ${position.y}, ${position.z}`); - sendPlayerSetPosition(client, position); + logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s position to ${position.x}, ${position.y}, ${position.z}`); + sendPlayerSetPosition(client, position); } // =========================================================================== function getPlayerHeading(client) { - if(!areServerElementsSupported()) { - return getPlayerData(client).syncHeading; - } else { - if(client.player != null) { - return client.player.heading; - } - } + if(!areServerElementsSupported()) { + return getPlayerData(client).syncHeading; + } else { + if(client.player != null) { + return client.player.heading; + } + } } // =========================================================================== function setPlayerHeading(client, heading) { - logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s heading to ${heading}`); - sendPlayerSetHeading(client, heading); + logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s heading to ${heading}`); + sendPlayerSetHeading(client, heading); } // =========================================================================== function getPlayerVehicle(client) { - if(!areServerElementsSupported()) { - return getPlayerData().syncVehicle; - } else { - if(client.player.vehicle) { - return client.player.vehicle; - } - } - return false; + if(!areServerElementsSupported()) { + return getPlayerData().syncVehicle; + } else { + if(client.player.vehicle) { + return client.player.vehicle; + } + } + return false; } // =========================================================================== function getPlayerDimension(client) { - if(!areServerElementsSupported()) { - return getPlayerData(client).syncDimension; - } else { - if(client.player != null) { - return client.player.dimension; - } - } + if(!areServerElementsSupported()) { + return getPlayerData(client).syncDimension; + } else { + if(client.player != null) { + return client.player.dimension; + } + } } // =========================================================================== function getPlayerInterior(client) { - return getPlayerCurrentSubAccount(client).interior || 0; + return getPlayerCurrentSubAccount(client).interior || 0; } // =========================================================================== function setPlayerDimension(client, dimension) { - logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s dimension to ${dimension}`); - if(!areServerElementsSupported()) { - getPlayerData(client).syncDimension = dimension; - } else { - if(client.player != null) { - client.player.dimension = dimension; - } - } + logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s dimension to ${dimension}`); + if(!areServerElementsSupported()) { + getPlayerData(client).syncDimension = dimension; + } else { + if(client.player != null) { + client.player.dimension = dimension; + } + } } // =========================================================================== function setPlayerInterior(client, interior) { - logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s interior to ${interior}`); - sendPlayerSetInterior(client, interior); + logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s interior to ${interior}`); + sendPlayerSetInterior(client, interior); if(isPlayerLoggedIn(client) && isPlayerSpawned(client)) { getPlayerCurrentSubAccount(client).interior = interior; } @@ -102,19 +102,19 @@ function setPlayerInterior(client, interior) { // =========================================================================== function isPlayerInAnyVehicle(client) { - if(!areServerElementsSupported()) { - return (getPlayerData().syncVehicle != null); - } else { - return (client.player.vehicle != null); - } + if(!areServerElementsSupported()) { + return (getPlayerData().syncVehicle != null); + } else { + return (client.player.vehicle != null); + } } // =========================================================================== function getPlayerVehicleSeat(client) { - if(!isPlayerInAnyVehicle(client)) { - return false; - } + if(!isPlayerInAnyVehicle(client)) { + return false; + } if(!areServerElementsSupported()) { return getPlayerData().syncVehicleSeat; @@ -126,25 +126,25 @@ function getPlayerVehicleSeat(client) { } } - return false; + return false; } // =========================================================================== function isPlayerSpawned(client) { - return getPlayerData(client).spawned; + return getPlayerData(client).spawned; } // =========================================================================== function getVehiclePosition(vehicle) { - return vehicle.position; + return vehicle.position; } // =========================================================================== function getVehicleHeading(vehicle) { - return vehicle.heading; + return vehicle.heading; } // =========================================================================== @@ -153,13 +153,13 @@ function setVehicleHeading(vehicle, heading) { if(getGame() == VRR_GAME_GTA_IV) { return sendNetworkEventToPlayer("vrr.vehPosition", null, getVehicleForNetworkEvent(vehicle), heading); } - return vehicle.heading = heading; + return vehicle.heading = heading; } // =========================================================================== function getVehicleSyncer(vehicle) { - return getElementSyncer(vehicle); + return getElementSyncer(vehicle); } // =========================================================================== @@ -171,40 +171,40 @@ function getVehicleForNetworkEvent(vehicle) { } return -1; } - return vehicle.id; + return vehicle.id; } // =========================================================================== function deleteGameElement(element) { - try { - if(element != null) { - destroyElement(element); - return true; - } - } catch(error) { - return false; - } + try { + if(element != null) { + destroyElement(element); + return true; + } + } catch(error) { + return false; + } } // =========================================================================== function isPlayerInFrontVehicleSeat(client) { - return (getPlayerVehicleSeat(client) == 0 || getPlayerVehicleSeat(client) == 1); + return (getPlayerVehicleSeat(client) == 0 || getPlayerVehicleSeat(client) == 1); } // =========================================================================== function removePlayerFromVehicle(client) { - logToConsole(LOG_DEBUG, `Removing ${getPlayerDisplayForConsole(client)} from their vehicle`); - sendPlayerRemoveFromVehicle(client); - return true; + logToConsole(LOG_DEBUG, `Removing ${getPlayerDisplayForConsole(client)} from their vehicle`); + sendPlayerRemoveFromVehicle(client); + return true; } // =========================================================================== function setPlayerSkin(client, skinIndex) { - logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s skin to ${getGameConfig().skins[getGame()][skinIndex][0]} (Index: ${skinIndex}, Name: ${getGameConfig().skins[getGame()][skinIndex][1]})`); + logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s skin to ${getGameConfig().skins[getGame()][skinIndex][0]} (Index: ${skinIndex}, Name: ${getGameConfig().skins[getGame()][skinIndex][1]})`); if(getGame() == VRR_GAME_GTA_IV) { triggerNetworkEvent("vrr.localPlayerSkin", client, getGameConfig().skins[getGame()][skinIndex][0]); } else { @@ -215,35 +215,35 @@ function setPlayerSkin(client, skinIndex) { // =========================================================================== function getPlayerSkin(client) { - return getSkinIndexFromModel(client.player.modelIndex); + return getSkinIndexFromModel(client.player.modelIndex); } // =========================================================================== function setPlayerHealth(client, health) { - logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s health to ${health}`); - sendPlayerSetHealth(client, health); + logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s health to ${health}`); + sendPlayerSetHealth(client, health); getServerData(client).health = health; } // =========================================================================== function getPlayerHealth(client) { - return getServerData(client).health; + return getServerData(client).health; } // =========================================================================== function setPlayerArmour(client, armour) { - logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s armour to ${armour}`); - sendPlayerSetArmour(client, armour); - //client.player.armour = armour; + logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s armour to ${armour}`); + sendPlayerSetArmour(client, armour); + //client.player.armour = armour; } // =========================================================================== function getPlayerArmour(client) { - return client.player.armour; + return client.player.armour; } // =========================================================================== @@ -253,9 +253,9 @@ function setPlayerCash(client, amount) { return false; } - if(isNaN(amount)) { - return false; - } + if(isNaN(amount)) { + return false; + } getPlayerCurrentSubAccount(client).cash = toInteger(amount); updatePlayerCash(client); @@ -268,9 +268,9 @@ function givePlayerCash(client, amount) { return false; } - if(isNaN(amount)) { - return false; - } + if(isNaN(amount)) { + return false; + } getPlayerCurrentSubAccount(client).cash = getPlayerCurrentSubAccount(client).cash + toInteger(amount); updatePlayerCash(client); @@ -283,9 +283,9 @@ function takePlayerCash(client, amount) { return false; } - if(isNaN(amount)) { - return false; - } + if(isNaN(amount)) { + return false; + } getPlayerCurrentSubAccount(client).cash = getPlayerCurrentSubAccount(client).cash - toInteger(amount); updatePlayerCash(client); @@ -294,173 +294,173 @@ function takePlayerCash(client, amount) { // =========================================================================== function disconnectPlayer(client) { - logToConsole(LOG_DEBUG, `Disconnecting (kicking) ${getPlayerDisplayForConsole(client)}`); - client.disconnect(); - return false; + logToConsole(LOG_DEBUG, `Disconnecting (kicking) ${getPlayerDisplayForConsole(client)}`); + client.disconnect(); + return false; } // =========================================================================== function getElementSyncer(element) { - return getClients()[element.syncer]; + return getClients()[element.syncer]; } // =========================================================================== function getPlayerWeaponAmmo(client) { - return client.player.weaponAmmunition; + return client.player.weaponAmmunition; } // =========================================================================== function setPlayerVelocity(client, velocity) { - logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s velocity to ${velocity.x}, ${velocity.y}, ${velocity.z}`); - if(typeof client.player.velocity != "undefined") { - client.player.velocity = velocity; - } + logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s velocity to ${velocity.x}, ${velocity.y}, ${velocity.z}`); + if(typeof client.player.velocity != "undefined") { + client.player.velocity = velocity; + } } // =========================================================================== function getPlayerVelocity(client, velocity) { - if(typeof client.player.velocity != "undefined") { - return client.player.velocity; - } - return toVector3(0.0, 0.0, 0.0); + if(typeof client.player.velocity != "undefined") { + return client.player.velocity; + } + return toVector3(0.0, 0.0, 0.0); } // =========================================================================== function getElementDimension(element) { - if(typeof element.dimension != "undefined") { - return element.dimension; - } - return 0; + if(typeof element.dimension != "undefined") { + return element.dimension; + } + return 0; } // =========================================================================== function setElementDimension(element, dimension) { - if(typeof element.dimension != "undefined") { - element.dimension = dimension; - return true; - } - return false; + if(typeof element.dimension != "undefined") { + element.dimension = dimension; + return true; + } + return false; } // =========================================================================== function setElementRotation(element, rotation) { - return element.setRotation(rotation); + return element.setRotation(rotation); } // =========================================================================== function givePlayerHealth(client, amount) { - if(getPlayerHealth(client)+amount > 100) { - logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s health to 100`); - setPlayerHealth(client, 100); - } else { - logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s health to ${getPlayerHealth(client)+amount}`); - setPlayerHealth(client, getPlayerHealth(client)+amount); - } + if(getPlayerHealth(client)+amount > 100) { + logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s health to 100`); + setPlayerHealth(client, 100); + } else { + logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s health to ${getPlayerHealth(client)+amount}`); + setPlayerHealth(client, getPlayerHealth(client)+amount); + } } // =========================================================================== function givePlayerArmour(client, amount) { - if(getPlayerArmour(client)+amount > 100) { - logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s armour to 100`); - setPlayerArmour(client, 100); - } else { - logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s armour to ${getPlayerArmour(client)+amount}`); - setPlayerArmour(client, getPlayerArmour(client)+amount); - } + if(getPlayerArmour(client)+amount > 100) { + logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s armour to 100`); + setPlayerArmour(client, 100); + } else { + logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s armour to ${getPlayerArmour(client)+amount}`); + setPlayerArmour(client, getPlayerArmour(client)+amount); + } } // =========================================================================== function getServerGame() { - return getGame(); + return getGame(); } // =========================================================================== function consolePrint(text) { - console.log(text); + console.log(text); } // =========================================================================== function getPlayerName(client) { - return client.name; + return client.name; } // =========================================================================== function getServerName() { - return server.name; + return server.name; } // =========================================================================== function createGamePickup(modelIndex, position, type) { - if(!isGameFeatureSupported("pickups")) { - return false; - } - return game.createPickup(modelIndex, position, type); + if(!isGameFeatureSupported("pickups")) { + return false; + } + return game.createPickup(modelIndex, position, type); } // =========================================================================== function createGameBlip(position, type = 0, colour = toColour(255, 255, 255, 255)) { - if(!isGameFeatureSupported("blips")) { - return false; - } - return game.createBlip(type, position, 1, colour); + if(!isGameFeatureSupported("blips")) { + return false; + } + return game.createBlip(type, position, 1, colour); } // =========================================================================== function createGameObject(modelIndex, position) { - if(!isGameFeatureSupported("objects")) { - return false; - } - return game.createObject(getGameConfig().objects[getGame()][modelIndex][0], position); + if(!isGameFeatureSupported("objects")) { + return false; + } + return game.createObject(getGameConfig().objects[getGame()][modelIndex][0], position); } // =========================================================================== function setElementOnAllDimensions(element, state) { - if(!isNull(element) && element != false) { - element.onAllDimensions = state; - } + if(!isNull(element) && element != false) { + element.onAllDimensions = state; + } } // =========================================================================== function destroyGameElement(element) { - if(!isNull(element) && element != false) { - destroyElement(element); - } + if(!isNull(element) && element != false) { + destroyElement(element); + } } // =========================================================================== function isMeleeWeapon(weaponId, gameId = getServerGame()) { - return (getGameConfig().meleeWeapons[gameId].indexOf(weaponId) != -1); + return (getGameConfig().meleeWeapons[gameId].indexOf(weaponId) != -1); } // =========================================================================== function getPlayerLastVehicle(client) { - return getPlayerData(client).lastVehicle; + return getPlayerData(client).lastVehicle; } // =========================================================================== function isVehicleObject(vehicle) { - return (vehicle.type == ELEMENT_VEHICLE); + return (vehicle.type == ELEMENT_VEHICLE); } // =========================================================================== @@ -479,7 +479,7 @@ function setVehicleLights(vehicle, lights) { function setVehicleEngine(vehicle, engine) { vehicle.engine = engine; - setEntityData(vehicle, "vrr.engine", engine, true); + setEntityData(vehicle, "vrr.engine", engine, true); } // =========================================================================== @@ -524,13 +524,13 @@ function setVehicleColours(vehicle, colour1, colour2, colour3 = -1, colour4 = -1 vehicle.colour1 = colour1; vehicle.colour2 = colour2; - if(colour3 != -1) { - vehicle.colour3 = colour3; - } + if(colour3 != -1) { + vehicle.colour3 = colour3; + } - if(colour4 != -1) { - vehicle.colour4 = colour4; - } + if(colour4 != -1) { + vehicle.colour4 = colour4; + } } // =========================================================================== @@ -544,7 +544,7 @@ function createGameVehicle(modelIndex, position, heading, toClient = null) { // =========================================================================== function getIsland(position) { - if(getServerGame() == VRR_GAME_GTA_III) { + if(getServerGame() == VRR_GAME_GTA_III) { if(position.x > 616) { return VRR_ISLAND_PORTLAND; } else if(position.x < -283) { @@ -561,11 +561,11 @@ function getIsland(position) { // =========================================================================== function isValidVehicleModel(model) { - if(getVehicleModelIndexFromModel(model) != false) { - return true; - } + if(getVehicleModelIndexFromModel(model) != false) { + return true; + } - return false; + return false; } // =========================================================================== @@ -589,8 +589,8 @@ function setPlayerFightStyle(client, fightStyleId) { return false; } - setEntityData(getPlayerElement(client), "vrr.fightStyle", [getGameConfig().fightStyles[getServerGame()][fightStyleId][1][0], getGameConfig().fightStyles[getServerGame()][fightStyleId][1][1]]); - forcePlayerToSyncElementProperties(null, getPlayerElement(client)); + setEntityData(getPlayerElement(client), "vrr.fightStyle", [getGameConfig().fightStyles[getServerGame()][fightStyleId][1][0], getGameConfig().fightStyles[getServerGame()][fightStyleId][1][1]]); + forcePlayerToSyncElementProperties(null, getPlayerElement(client)); } // =========================================================================== @@ -649,32 +649,32 @@ function isTaxiVehicle(vehicle) { // =========================================================================== function getVehicleName(vehicle) { - let model = getElementModel(vehicle); + let model = getElementModel(vehicle); return getVehicleNameFromModel(model) || "Unknown"; } // =========================================================================== function getElementModel(element) { - if(typeof element.modelIndex != "undefined") { - return element.modelIndex; - } + if(typeof element.modelIndex != "undefined") { + return element.modelIndex; + } - if(typeof element.model != "undefined") { - return element.model; - } + if(typeof element.model != "undefined") { + return element.model; + } } // =========================================================================== function givePlayerWeaponAmmo(client, ammo) { - givePlayerWeapon(client, getPlayerWeapon(client), getPlayerWeaponAmmo(client) + ammo); + givePlayerWeapon(client, getPlayerWeapon(client), getPlayerWeaponAmmo(client) + ammo); } // =========================================================================== function getPlayerWeapon(client) { - return client.player.weapon; + return client.player.weapon; } // =========================================================================== @@ -914,7 +914,7 @@ function sendNetworkEventToPlayer(eventName, client, ...args) { // =========================================================================== function addNetworkEventHandler(eventName, handlerFunction) { - addNetworkHandler(eventName, handlerFunction); + addNetworkHandler(eventName, handlerFunction); } // =========================================================================== @@ -1027,8 +1027,8 @@ function setVehicleHealth(vehicle, health) { // =========================================================================== function givePlayerWeapon(client, weaponId, ammo, active = true) { - logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to ${getPlayerDisplayForConsole(client)} to give weapon (Weapon: ${weaponId}, Ammo: ${ammo})`); - sendNetworkEventToPlayer("vrr.giveWeapon", client, weaponId, ammo, active); + logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to ${getPlayerDisplayForConsole(client)} to give weapon (Weapon: ${weaponId}, Ammo: ${ammo})`); + sendNetworkEventToPlayer("vrr.giveWeapon", client, weaponId, ammo, active); } // =========================================================================== \ No newline at end of file diff --git a/third-party/mexui/Core/Component/Control.js b/third-party/mexui/Core/Component/Control.js index c745e682..5aa0cd07 100644 --- a/third-party/mexui/Core/Component/Control.js +++ b/third-party/mexui/Core/Component/Control.js @@ -2,12 +2,12 @@ mexui.Component.Control = function(window, x, y, w, h, styles, callback) { mexui.Entity.Component.call(this, false); mexui.Entity.StyleableEntity.call(this, this.linkComponentStyles('Control', styles)); - + this.window = window; this.position = new Vec2(x, y); this.size = new Vec2(w, h); this.callback = callback; - + this.boundTo = null; }; mexui.util.extend(mexui.Component.Control, mexui.Entity.Component); @@ -131,4 +131,3 @@ mexui.Component.Control.prototype.unbind = function() { this.boundTo = null; }; - diff --git a/third-party/mexui/Core/Component/Entry.js b/third-party/mexui/Core/Component/Entry.js index c9706808..5c70ad21 100644 --- a/third-party/mexui/Core/Component/Entry.js +++ b/third-party/mexui/Core/Component/Entry.js @@ -2,7 +2,7 @@ mexui.Component.Entry = function(control, axisIndex, text, styles) { mexui.Entity.Component.call(this, false); mexui.Entity.StyleableEntity.call(this, this.linkComponentStyles('Entry', styles)); - + this.control = control; this.axisIndex = axisIndex; this.text = text; @@ -29,4 +29,3 @@ mexui.Component.Entry.prototype.remove = function() this.control.axis[this.getAxisKey()].entries.splice(this.getEntryIndex(), 1); this.control.checkToShowScrollBars(); }; - diff --git a/third-party/mexui/Core/Component/Event.js b/third-party/mexui/Core/Component/Event.js index 38d4630c..84b920b7 100644 --- a/third-party/mexui/Core/Component/Event.js +++ b/third-party/mexui/Core/Component/Event.js @@ -3,4 +3,3 @@ mexui.Component.Event = function() this.used = false; this.clickedAControl = false; }; - diff --git a/third-party/mexui/Core/Component/Window.js b/third-party/mexui/Core/Component/Window.js index 2f6cea5a..df64c575 100644 --- a/third-party/mexui/Core/Component/Window.js +++ b/third-party/mexui/Core/Component/Window.js @@ -2,11 +2,11 @@ mexui.Component.Window = function(x, y, w, h, title, styles) { mexui.Entity.Component.call(this, true); mexui.Entity.StyleableEntity.call(this, this.linkComponentStyles('Window', styles)); - + this.position = new Vec2(x, y); this.size = new Vec2(w, h); this.title = title || ''; - + this.controls = []; this.titleBarShown = true; this.titleBarHeight = 30; @@ -21,7 +21,7 @@ mexui.Component.Window.defaultStyles = mexui.util.linkStyles(mexui.Entity.Stylea { backgroundColour: toColour(0, 0, 0, 190), textColour: toColour(255, 255, 255, 255), - + hover: { backgroundColour: toColour(0, 0, 0, 170) @@ -52,12 +52,12 @@ mexui.Component.Window.prototype.onMouseDown = function(e) e.used = true; return; } - + if(this.isCursorOverWindow()) { this.setTop(); } - + this.triggerEvent('onMouseDown', e); }; @@ -70,15 +70,15 @@ mexui.Component.Window.prototype.onMouseMove = function(e, offset) { //var wasHovered = this.isHovered(); //e.wasHovered = wasHovered; - + if(mexui.hoveredComponent && !mexui.hoveredComponent.isCursorOverItem()) { mexui.hoveredComponent.onMouseExit(); mexui.clearHoveredComponent(); } - + this.triggerEvent('onMouseMove', e, offset); - + if(e.used) { /* @@ -90,7 +90,7 @@ mexui.Component.Window.prototype.onMouseMove = function(e, offset) */ return; } - + if(this.isCursorOverWindow()) { if(!this.isHovered()) @@ -129,13 +129,13 @@ mexui.Component.Window.prototype.render = function() { // window background mexui.native.drawRectangleBackground(this.position, this.size, this.getStyles('main')); - + if(this.titleBarShown) { // window title bar mexui.native.drawRectangle(this.position, new Vec2(this.size.x, this.titleBarHeight), this.getStyles('title')); mexui.native.drawText(this.position, new Vec2(this.size.x, this.titleBarHeight), this.title, this.getStyles('title')); - + if(this.titleBarIconShown) { // window title bar icons @@ -144,17 +144,17 @@ mexui.Component.Window.prototype.render = function() mexui.native.drawText(iconPos, this.titleBarIconSize, 'X', this.getStyles('icon')); } } - + // window border mexui.native.drawRectangleBorder(this.position, this.size, this.getStyles('main')); - + // window controls var show, control; for(var i in this.controls) { control = this.controls[i]; show = false; - + if(control.shown) { show = true; @@ -164,7 +164,7 @@ mexui.Component.Window.prototype.render = function() show = false; } } - + if(show) control.render.call(control); } @@ -177,7 +177,7 @@ mexui.Component.Window.prototype.renderAfter = function() if(this.controls[i].shown) { this.controls[i].renderAfter.call(this.controls[i]); - + for(var i2 in this.controls[i].scrollBars) { if(this.controls[i].scrollBars[i2].shown) @@ -219,10 +219,10 @@ mexui.Component.Window.prototype.triggerEvent = function(eventName, e, data, cal for(var i in this.controls) { var control = this.controls[i]; - + if(!control.shown) continue; - + if(callBaseMethodFirst) { if(mexui.Entity.Component.prototype[eventName]) @@ -231,7 +231,7 @@ mexui.Component.Window.prototype.triggerEvent = function(eventName, e, data, cal if(e.used) break; } - + this.controls[i][eventName].call(control, e, data); if(e.used) break; @@ -248,7 +248,7 @@ mexui.Component.Window.prototype.triggerEvent = function(eventName, e, data, cal } break; } - + if(mexui.Entity.Component.prototype[eventName]) { mexui.Entity.Component.prototype[eventName].call(control, e, data); @@ -268,9 +268,9 @@ mexui.Component.Window.prototype.addControl = function(control) mexui.Component.Window.prototype.setShown = function(shown) { //var anyWindowShownBefore = mexui.isAnyWindowShown(); - + this.shown = shown; - + if(mexui.focusedControl && this.isControlInWindow(mexui.focusedControl)) { if(!shown) @@ -278,7 +278,7 @@ mexui.Component.Window.prototype.setShown = function(shown) mexui.focusedControl = null; } } - + /* if(shown) { @@ -336,7 +336,7 @@ mexui.Component.Window.prototype.getFirstShownControl = function() mexui.Component.Window.prototype.getNextShownControl = function(afterControl) { var controlIndex = this.controls.indexOf(afterControl); - + if(this.controls[controlIndex + 1]) return this.controls[controlIndex + 1]; else @@ -386,4 +386,3 @@ mexui.Component.Window.prototype.tree = function(x, y, w, h, styles, callback) mexui.Component.Window.prototype.week = function(x, y, w, h, text, styles, callback) { return this.addControl(new mexui.Control.Week(this, x, y, w, h, text, styles, callback)); }; mexui.Component.Window.prototype.weekDay = function(x, y, w, h, text, styles, callback) { return this.addControl(new mexui.Control.WeekDay(this, x, y, w, h, text, styles, callback)); }; mexui.Component.Window.prototype.year = function(x, y, w, h, text, styles, callback) { return this.addControl(new mexui.Control.Year(this, x, y, w, h, text, styles, callback)); }; - diff --git a/third-party/mexui/Core/Control/Button.js b/third-party/mexui/Core/Control/Button.js index ef89836c..a3baf646 100644 --- a/third-party/mexui/Core/Control/Button.js +++ b/third-party/mexui/Core/Control/Button.js @@ -1,7 +1,7 @@ mexui.util.createControlConstructor('Button', false, function(window, x, y, w, h, text, styles, callback) { mexui.Component.Control.call(this, window, x, y, w, h, this.linkControlStyles('Button', styles), callback); - + this.text = text; }); @@ -31,10 +31,10 @@ mexui.Control.Button.prototype.onKeyDown = function(e, key, mods) mexui.Control.Button.prototype.render = function() { var pos = this.getScreenPosition(); - + mexui.native.drawRectangle(pos, this.size, this.getStyles('main')); mexui.native.drawText(pos, this.size, this.text, this.getStyles('main')); - + if(this.isFocused()) mexui.native.drawRectangleBorder(mexui.util.subtractVec2(pos,new Vec2(2,2)), mexui.util.addVec2(this.size,new Vec2(3,3)), this.getStyles('focused')); }; \ No newline at end of file diff --git a/third-party/mexui/Core/Control/Date.js b/third-party/mexui/Core/Control/Date.js index 585a045d..aa7762b1 100644 --- a/third-party/mexui/Core/Control/Date.js +++ b/third-party/mexui/Core/Control/Date.js @@ -1,15 +1,15 @@ mexui.util.createControlConstructor('Date', false, function(window, x, y, w, h, text, styles, callback) { mexui.Control.TextInput.call(this, window, x, y, w, h, text, this.linkControlStyles('Date', styles), callback, false, false); - + this.day = 1; this.month = 1; this.year = 2019; - + this.inputShown = false; this.valueBoxSize = new Vec2(50, 30); this.arrowBoxSize = new Vec2(25, 22); - + this.maxYearOffset = 10; this.minYearCallback = ()=>{ return 1900; }; this.maxYearCallback = ()=>{ return new Date().getFullYear() + this.maxYearOffset; } @@ -40,42 +40,42 @@ mexui.Control.Date.prototype.onMouseDown = function(e) var propIndex = (Math.ceil((arrowIndex + 1) / 2)) - 1; var propName = mexui.Control.Date.units[propIndex]; var isIncrease = (arrowIndex % 2) == 1; - + if(isIncrease) this[propName]++; else this[propName]--; - + if(this.day == 0) this.day = 31; else if(this.day == 32) this.day = 1; - + if(this.month == 0) this.month = 12; else if(this.month == 13) this.month = 1; - + var minYear = this.minYearCallback(); var maxYear = this.maxYearCallback(); if(this.year < minYear) this.year = minYear; else if(this.year > maxYear) this.year = maxYear; - + this.generateText(); - + return; } } - + if(this.isCursorOverControl()) { this.inputShown = !this.inputShown; e.used = true; return; } - + if(this.inputShown) { this.inputShown = false; @@ -89,18 +89,18 @@ mexui.Control.Date.prototype.renderAfter = function() { if(!this.inputShown) return; - + var screenPos = this.getScreenPosition(); - + var pos = new Vec2(screenPos.x, screenPos.y); for(var i=0; i<3; i++) { mexui.native.drawRectangle(pos, this.valueBoxSize, this.getStyles('main')); mexui.native.drawText(pos, this.valueBoxSize, this[mexui.Control.Date.units[i]], this.getStyles('main')); - + pos.x += this.valueBoxSize.x; } - + pos = new Vec2(screenPos.x, screenPos.y); pos.y += this.valueBoxSize.y; for(var i=0; i<3; i++) @@ -108,10 +108,10 @@ mexui.Control.Date.prototype.renderAfter = function() for(var i2=0; i2<2; i2++) { var text = (i2 % 2) == 0 ? '<' : '>'; - + mexui.native.drawRectangle(pos, this.arrowBoxSize, this.getStyles('main')); mexui.native.drawText(pos, this.arrowBoxSize, text, this.getStyles('main')); - + pos.x += this.arrowBoxSize.x; } } @@ -133,16 +133,16 @@ mexui.Control.Date.prototype.validateInputCallback = function(e, character) mexui.Control.Date.prototype.validateValueCallback = function(e) { var parts = this.getText().split('/'); - + if(parts.length != 3) return false; - + for(var i in parts) { var partAsStr = parts[i]; if(partAsStr === '') return false; - + if(i == 0) { if(!mexui.util.isDayIdWithOptionalSuffix(partAsStr)) @@ -159,18 +159,18 @@ mexui.Control.Date.prototype.validateValueCallback = function(e) return false; } } - + return true; }; mexui.Control.Date.prototype.getArrowIndexByCursor = function() { var cursorPos = gui.cursorPosition; - + var screenPos = this.getScreenPosition(); var firstArrowStartPos = new Vec2(screenPos.x, screenPos.y + this.valueBoxSize.y); var lastArrowEndPos = new Vec2(screenPos.x + (this.arrowBoxSize.x * 6), screenPos.y + this.valueBoxSize.y + this.arrowBoxSize.y); - + if(cursorPos.x >= firstArrowStartPos.x && cursorPos.y >= firstArrowStartPos.y && cursorPos.x <= lastArrowEndPos.x && cursorPos.y <= lastArrowEndPos.y) { return Math.floor((cursorPos.x - firstArrowStartPos.x) / this.arrowBoxSize.x); diff --git a/third-party/mexui/Core/Control/DropDown.js b/third-party/mexui/Core/Control/DropDown.js index ac394e3e..ff65f238 100644 --- a/third-party/mexui/Core/Control/DropDown.js +++ b/third-party/mexui/Core/Control/DropDown.js @@ -2,11 +2,11 @@ mexui.util.createControlConstructor('DropDown', true, function(window, x, y, w, { mexui.Component.Control.call(this, window, x, y, w, h, this.linkControlStyles('DropDown', styles), callback); mexui.Entity.ControlWithEntries.call(this, true, true, new Vec2(0, h), new Vec2(w + 120, 25)); - + this.axis.y.entriesShown = false; - + this.text = text; - + this.arrowShown = true; this.selectedEntryIndex = -1; this.hoveredEntryIndex = -1; @@ -18,7 +18,7 @@ mexui.util.linkBaseControlStyles('DropDown', { { backgroundColour: toColour(255, 255, 255, 255), textColour: toColour(0, 0, 0, 255), - + hover: { backgroundColour: toColour(80, 80, 80, 255), @@ -34,7 +34,7 @@ mexui.Control.DropDown.prototype.onMouseDown = function(e) { if(this.axis.y.entries.length == 0) return; - + var hitButton = this.isCursorOverControl(); if(hitButton) { @@ -51,7 +51,7 @@ mexui.Control.DropDown.prototype.onMouseDown = function(e) } } } - + if(!e.used) mexui.Entity.ControlWithEntries.prototype.onMouseDown.call(this, e); }; @@ -81,20 +81,20 @@ mexui.Control.DropDown.prototype.onKeyDown = function(e, key, mods) mexui.Control.DropDown.prototype.render = function() { var pos = this.getScreenPosition(); - + mexui.native.drawRectangle(pos, this.size, this.getStyles('main')); - + var text = this.selectedEntryIndex == -1 ? this.text : this.axis.y.entries[this.selectedEntryIndex].text; mexui.native.drawText(pos, this.size, text, this.getStyles('main')); - + if(this.arrowShown) { var pos2 = new Vec2(pos.x + this.size.x - (25 + 3), pos.y + 0); mexui.native.drawImage(pos2, new Vec2(25, 25), mexui.images.downArrow, this.getStyles('main')); } - + mexui.Entity.ControlWithEntries.prototype.render.call(this); - + if(this.isFocused()) mexui.native.drawRectangleBorder(mexui.util.subtractVec2(pos,new Vec2(2,2)), mexui.util.addVec2(this.size,new Vec2(3,3)), this.getStyles('focused')); }; @@ -105,31 +105,31 @@ mexui.Control.DropDown.prototype.renderAfter = function() { var pos = this.getScreenPosition(); var pos2 = new Vec2(pos.x, pos.y); - + pos.x += this.entriesPositionOffset.x; pos.y += this.entriesPositionOffset.y; - + pos2.x += this.entriesPositionOffset.x; pos2.y += this.entriesPositionOffset.y; - + for(var i=this.axis.y.getEntryStartIndex(),j=this.axis.y.getEntryEndIndex(); i<j; i++) { var item = this.axis.y.entries[i]; if(!item) break; - + //this.hovered = i == this.axis.y.hoveredEntryIndex; - + mexui.native.drawRectangle(pos, this.entrySize, this.getStyles('item')); mexui.native.drawText(pos, this.entrySize, item.text, this.getStyles('item')); - + pos.y += this.entrySize.y; } - + if(this.isFocused()) mexui.native.drawRectangleBorder(mexui.util.subtractVec2(pos2,new Vec2(2,2)), mexui.util.addVec2(new Vec2(this.entrySize.x,this.axis.y.getDisplayedEntriesLength()),new Vec2(3,3)), this.getStyles('focused')); } - + mexui.Entity.ControlWithEntries.prototype.renderAfter.call(this); }; diff --git a/third-party/mexui/Core/Control/Grid.js b/third-party/mexui/Core/Control/Grid.js index 6d7a126d..b9d4db08 100644 --- a/third-party/mexui/Core/Control/Grid.js +++ b/third-party/mexui/Core/Control/Grid.js @@ -30,54 +30,54 @@ mexui.util.linkBaseControlStyles('Grid', { mexui.Control.Grid.prototype.render = function() { var pos = this.getScreenPosition(); - + mexui.native.drawRectangle(pos, this.size, this.getStyles('main')); - + var startX = pos.x; var maxColumnHeight = 0; for(var i in this.axis.x.entries) { var column = this.axis.x.entries[i]; - + mexui.native.drawText(new Vec2(startX, pos.y), new Vec2(column.width, column.height), column.text, this.getStyles('header')); - + startX += column.width; mexui.native.drawAALine(new Vec2(startX, pos.y), new Vec2(startX, pos.y + this.size.y), this.getStyles('column')); - + if(column.height > maxColumnHeight) { maxColumnHeight = column.height; } } - + var startY = pos.y + maxColumnHeight; mexui.native.drawAALine(new Vec2(pos.x, startY), new Vec2(pos.x + this.size.x, startY), this.getStyles('row')); - + for(var i=this.axis.y.getEntryStartIndex(),j=this.axis.y.getEntryEndIndex(); i<j; i++) { var row = this.axis.y.entries[i]; if(!row) break; - + startX = pos.x; for(var i2 in row.cells) { var column = this.axis.x.entries[i2]; var cell = row.cells[i2]; var cellText = cell.text; - + var styles = this.getEntryStyles([[cell,'main'], [row,'main'], [this,'row'], [this,'cell']]); - + mexui.native.drawRectangle(new Vec2(startX, startY), new Vec2(column.width, column.height), styles); mexui.native.drawText(new Vec2(startX, startY), new Vec2(column.width, column.height), cellText, styles); - + startX += column.width; } - + startY += row.rowHeight; mexui.native.drawAALine(new Vec2(pos.x, startY), new Vec2(pos.x + this.size.x, startY), this.getStyles('row')); } - + if(this.isFocused()) mexui.native.drawRectangleBorder(mexui.util.subtractVec2(pos,new Vec2(2,2)), mexui.util.addVec2(this.size,new Vec2(3,3)), this.getStyles('focused')); }; @@ -104,7 +104,7 @@ mexui.Control.Grid.prototype.row = function(cellsData, styles) cells[i] = new mexui.Component.Entry(this, 1, cellsData[i] + ''); } } - + var entry = new mexui.Entry.GridRow(this, cells, styles); this.axis.y.addEntry(entry); return entry; @@ -127,4 +127,3 @@ mexui.Control.Grid.prototype.getAllEntriesLength = function(axisIndex) return this.axis.y.getAllEntriesLength2(); } }; - diff --git a/third-party/mexui/Core/Control/Hour.js b/third-party/mexui/Core/Control/Hour.js index 465981c0..d4d57148 100644 --- a/third-party/mexui/Core/Control/Hour.js +++ b/third-party/mexui/Core/Control/Hour.js @@ -13,9 +13,9 @@ mexui.Control.Hour.prototype.validateInputCallback = function(e, character) mexui.Control.Hour.prototype.validateValueCallback = function(e) { var _int = parseInt(this.getText()); - + if(_int < 1 || _int > 23) return false; - + return true; }; \ No newline at end of file diff --git a/third-party/mexui/Core/Control/Image.js b/third-party/mexui/Core/Control/Image.js index 1231ab5f..d629e341 100644 --- a/third-party/mexui/Core/Control/Image.js +++ b/third-party/mexui/Core/Control/Image.js @@ -1,7 +1,7 @@ mexui.util.createControlConstructor('Image', false, function(window, x, y, w, h, filePath, styles) { mexui.Component.Control.call(this, window, x, y, w, h, this.linkControlStyles('Image', styles)); - + this.image = mexui.native.loadImage(filePath); }); @@ -12,9 +12,9 @@ mexui.util.linkBaseControlStyles('Image', {}); mexui.Control.Image.prototype.render = function() { var pos = this.getScreenPosition(); - + mexui.native.drawImage(pos, this.size, this.image, this.getStyles('main')); - + if(this.isFocused()) mexui.native.drawRectangleBorder(mexui.util.subtractVec2(pos,new Vec2(2,2)), mexui.util.addVec2(this.size,new Vec2(3,3)), this.getStyles('focused')); }; \ No newline at end of file diff --git a/third-party/mexui/Core/Control/List.js b/third-party/mexui/Core/Control/List.js index 4c6b82a6..fd60c152 100644 --- a/third-party/mexui/Core/Control/List.js +++ b/third-party/mexui/Core/Control/List.js @@ -2,7 +2,7 @@ mexui.util.createControlConstructor('List', true, function(window, x, y, w, h, s { mexui.Component.Control.call(this, window, x, y, w, h, this.linkControlStyles('List', styles), callback); mexui.Entity.ControlWithEntries.call(this, false, false); - + this.activeRow = null; this.rowHeight = 25; }); @@ -35,19 +35,19 @@ mexui.Control.List.prototype.render = function() { var pos = this.getScreenPosition(); var pos2 = new Vec2(pos.x, pos.y); - + for(var i in this.axis.y.entries) { var row = this.axis.y.entries[i]; var rowText = row.text; - + mexui.native.drawRectangle(pos, new Vec2(this.size.x, this.rowHeight), this.getStyles('row')); mexui.native.drawText(pos, new Vec2(this.size.x, this.rowHeight), rowText, this.getStyles('row')); - + pos.y += this.rowHeight; mexui.native.drawAALine(pos, new Vec2(pos.x + this.size.x, pos.y), this.getStyles('rowLine')); } - + if(this.isFocused()) mexui.native.drawRectangleBorder(mexui.util.subtractVec2(pos2,new Vec2(2,2)), mexui.util.addVec2(this.size,new Vec2(3,3)), this.getStyles('focused')); }; @@ -59,4 +59,3 @@ mexui.Control.List.prototype.row = function(text) this.axis.y.addEntry(entry); return entry; }; - diff --git a/third-party/mexui/Core/Control/Minute.js b/third-party/mexui/Core/Control/Minute.js index 432f5227..c8b3e467 100644 --- a/third-party/mexui/Core/Control/Minute.js +++ b/third-party/mexui/Core/Control/Minute.js @@ -13,9 +13,9 @@ mexui.Control.Minute.prototype.validateInputCallback = function(e, character) mexui.Control.Minute.prototype.validateValueCallback = function(e) { var _int = parseInt(this.getText()); - + if(_int < 1 || _int > 59) return false; - + return true; }; \ No newline at end of file diff --git a/third-party/mexui/Core/Control/Password.js b/third-party/mexui/Core/Control/Password.js index 0aaa3019..796b77c8 100644 --- a/third-party/mexui/Core/Control/Password.js +++ b/third-party/mexui/Core/Control/Password.js @@ -1,7 +1,7 @@ mexui.util.createControlConstructor('Password', false, function(window, x, y, w, h, text, styles, callback) { mexui.Control.TextInput.call(this, window, x, y, w, h, text, this.linkControlStyles('Password', styles), callback, false, true); - + this.masked = true; }); mexui.util.extend(mexui.Control.Password, mexui.Control.TextInput); \ No newline at end of file diff --git a/third-party/mexui/Core/Control/ProgressBar.js b/third-party/mexui/Core/Control/ProgressBar.js index a0321d5e..feaafc51 100644 --- a/third-party/mexui/Core/Control/ProgressBar.js +++ b/third-party/mexui/Core/Control/ProgressBar.js @@ -1,9 +1,9 @@ mexui.util.createControlConstructor('ProgressBar', false, function(window, x, y, w, h, text, styles) { mexui.Component.Control.call(this, window, x, y, w, h, this.linkControlStyles('ProgressBar', styles)); - + this.text = text; - + this.progress = 0.0; }); @@ -12,7 +12,7 @@ mexui.util.linkBaseControlStyles('ProgressBar', { innerBar: { backgroundColour: toColour(0, 255, 0, 255), - + hover: { backgroundColour: toColour(80, 255, 0, 255) @@ -24,12 +24,12 @@ mexui.util.linkBaseControlStyles('ProgressBar', { mexui.Control.ProgressBar.prototype.render = function() { var pos = this.getScreenPosition(); - + mexui.native.drawRectangle(pos, this.size, this.getStyles('main')); - + var innerBarSize = new Vec2(this.size.x * this.progress, this.size.y); mexui.native.drawRectangle(pos, innerBarSize, this.getStyles('innerBar')); - + if(this.text != '') mexui.native.drawText(pos, this.size, this.text, this.getStyles('main')); }; \ No newline at end of file diff --git a/third-party/mexui/Core/Control/RadioButton.js b/third-party/mexui/Core/Control/RadioButton.js index 87d686c8..9bae83ea 100644 --- a/third-party/mexui/Core/Control/RadioButton.js +++ b/third-party/mexui/Core/Control/RadioButton.js @@ -1,10 +1,10 @@ mexui.util.createControlConstructor('RadioButton', false, function(window, x, y, w, h, groupId, text, styles, callback) { mexui.Component.Control.call(this, window, x, y, w, h, this.linkControlStyles('RadioButton', styles), callback); - + this.groupId = groupId; this.text = text; - + this.checked = this.isFirstRadioInGroup(); this.textMarginLeft = 5; }); @@ -42,14 +42,14 @@ mexui.Control.RadioButton.prototype.onKeyDown = function(e, key, mods) mexui.Control.RadioButton.prototype.render = function() { var pos = this.getScreenPosition(); - + mexui.native.drawRectangle(pos, this.size, this.getStyles('main')); - + if(this.checked) mexui.native.drawRectangle(mexui.util.addVec2(pos, new Vec2(2, 2)), new Vec2(this.size.x - 4, this.size.y - 4), this.getStyles('innerBox')); - + mexui.native.drawText(mexui.util.addVec2(pos, new Vec2(this.size.x + this.textMarginLeft, 2)), this.size, this.text, this.getStyles('main')); - + if(this.isFocused()) mexui.native.drawRectangleBorder(mexui.util.subtractVec2(pos,new Vec2(2,2)), mexui.util.addVec2(this.size,new Vec2(3,3)), this.getStyles('focused')); }; @@ -68,11 +68,11 @@ mexui.Control.RadioButton.prototype.getGroupRadios = function() for(var i in windows) { var window = mexui.windows[i]; - + for(var i2 in window.controls) { var control = window.controls[i2]; - + if((control instanceof mexui.Control.RadioButton) && this.groupId == control.groupId) { radios.push(control); @@ -103,7 +103,7 @@ mexui.Control.RadioButton.prototype.setChecked = function() var checkedRadio = this.getCheckedRadio(); if(checkedRadio != this.checked) checkedRadio.checked = false; - + this.checked = !this.checked; this.checkToCallCallback(); }; \ No newline at end of file diff --git a/third-party/mexui/Core/Control/RangedInteger.js b/third-party/mexui/Core/Control/RangedInteger.js index dafa0946..0454a8a0 100644 --- a/third-party/mexui/Core/Control/RangedInteger.js +++ b/third-party/mexui/Core/Control/RangedInteger.js @@ -1,7 +1,7 @@ mexui.util.createControlConstructor('RangedInteger', false, function(window, x, y, w, h, min, max, text, styles, callback) { mexui.Control.TextInput.call(this, window, x, y, w, h, text, this.linkControlStyles('RangedInteger', styles), callback, false, false); - + this.min = min === undefined ? 0 : min; this.max = max === undefined ? 100 : max; }); @@ -18,7 +18,7 @@ mexui.Control.RangedInteger.prototype.validateValueCallback = function(e) var text = this.getText(); if(!mexui.util.isInt(text)) return false; - + var _int = parseInt(text); return _int >= this.min && _int <= this.max; }; \ No newline at end of file diff --git a/third-party/mexui/Core/Control/RangedNumber.js b/third-party/mexui/Core/Control/RangedNumber.js index 45e16b05..4257e2c3 100644 --- a/third-party/mexui/Core/Control/RangedNumber.js +++ b/third-party/mexui/Core/Control/RangedNumber.js @@ -1,7 +1,7 @@ mexui.util.createControlConstructor('RangedNumber', false, function(window, x, y, w, h, min, max, text, styles, callback) { mexui.Control.TextInput.call(this, window, x, y, w, h, text, this.linkControlStyles('RangedNumber', styles), callback, false, false); - + this.min = min === undefined ? 0.0 : min; this.max = max === undefined ? 100.0 : max; }); @@ -18,7 +18,7 @@ mexui.Control.RangedNumber.prototype.validateValueCallback = function(e) var text = this.getText(); if(!mexui.util.isFloat(text)) return false; - + var number = parseFloat(text); return number >= this.min && number <= this.max; }; \ No newline at end of file diff --git a/third-party/mexui/Core/Control/ScrollBar.js b/third-party/mexui/Core/Control/ScrollBar.js index 579fb037..ff5daadf 100644 --- a/third-party/mexui/Core/Control/ScrollBar.js +++ b/third-party/mexui/Core/Control/ScrollBar.js @@ -1,11 +1,11 @@ mexui.util.createControlConstructor('ScrollBar', false, function(window, x, y, w, h, isVertical, styles, callback) { mexui.Component.Control.call(this, window, x, y, w, h, this.linkControlStyles('ScrollBar', styles), callback); - + this.isVertical = isVertical; this.axisIndex = isVertical ? 1 : 0; this.otherAxisIndex = isVertical ? 0 : 1; - + this.barHigherLength = 50; this.scrolledRatio = 0.0; this.isScrolling = false; @@ -16,7 +16,7 @@ mexui.util.linkBaseControlStyles('ScrollBar', { main: { backgroundColour: toColour(0, 0, 0, 190), - + hover: { backgroundColour: toColour(0, 0, 0, 150) @@ -25,7 +25,7 @@ mexui.util.linkBaseControlStyles('ScrollBar', { innerBar: { backgroundColour: toColour(79, 161, 246, 190), - + hover: { backgroundColour: toColour(79, 161, 246, 150) @@ -69,7 +69,7 @@ mexui.Control.ScrollBar.prototype.onMouseMove = function(e, offset) this.clampScrolledRatio(); e.used = true; } - + if(!e.used) mexui.Component.Control.prototype.onMouseMove.call(this, e, offset); }; @@ -100,7 +100,7 @@ mexui.Control.ScrollBar.prototype.getInnerBarPosition = function() { var screenPos = this.getScreenPosition(); var pos = new Vec2(screenPos.x, screenPos.y); - + var minPos = pos[this.axisIndex] + 1; var maxPos = pos[this.axisIndex] + this.size[this.axisIndex] - 2; pos[this.axisIndex] = minPos + (this.scrolledRatio * (maxPos - minPos - this.barHigherLength)); diff --git a/third-party/mexui/Core/Control/Second.js b/third-party/mexui/Core/Control/Second.js index 650e8125..e69b6d5e 100644 --- a/third-party/mexui/Core/Control/Second.js +++ b/third-party/mexui/Core/Control/Second.js @@ -13,9 +13,9 @@ mexui.Control.Second.prototype.validateInputCallback = function(e, character) mexui.Control.Second.prototype.validateValueCallback = function(e) { var _int = parseInt(this.getText()); - + if(_int < 1 || _int > 59) return false; - + return true; }; \ No newline at end of file diff --git a/third-party/mexui/Core/Control/Slider.js b/third-party/mexui/Core/Control/Slider.js index 1abfebc6..d0001c2c 100644 --- a/third-party/mexui/Core/Control/Slider.js +++ b/third-party/mexui/Core/Control/Slider.js @@ -4,14 +4,14 @@ mexui.util.createControlConstructor('Slider', false, function(window, x, y, w, h text = text === undefined ? '' : text; minText = minText === undefined ? '' : minText; maxText = maxText === undefined ? '' : maxText; - + mexui.Component.Control.call(this, window, x, y, w, h, this.linkControlStyles('Slider', styles), callback); - + this.isVertical = isVertical; this.text = text; this.minText = minText; this.maxText = maxText; - + this.progress = 0.0; this.axisIndex = isVertical ? 1 : 0; this.innerBarSize = new Vec2(30, 25); @@ -57,7 +57,7 @@ mexui.Control.Slider.prototype.onMouseMove = function(e, offset) { if(!this.sliding) return false; - + this.progress += this.getProgressIncreaseByPixels(offset); this.clampProgress(); e.used = true; @@ -68,21 +68,21 @@ mexui.Control.Slider.prototype.render = function() { var pos = this.getScreenPosition(); var pos2 = new Vec2(pos.x, pos.y); - + mexui.native.drawRectangle(pos, this.size, this.getStyles('main')); mexui.native.drawRectangle(this.getInnerBarPosition(), this.innerBarSize, this.getStyles('innerBar')); - + pos.y += this.size.y; mexui.native.drawText(pos, this.size, this.minText, this.getStyles('minText')); - + var offset = (this.size.x - mexui.native.getTextWidth(this.text, this.getStyles('main'))) / 2; pos.x += offset; mexui.native.drawText(pos, this.size, this.text, this.getStyles('main')); pos.x -= offset; - + pos.x += this.size.x - mexui.native.getTextWidth(this.maxText, this.getStyles('maxText')); mexui.native.drawText(pos, this.size, this.maxText, this.getStyles('maxText')); - + if(this.isFocused()) mexui.native.drawRectangleBorder(mexui.util.subtractVec2(pos2,new Vec2(2,2)), mexui.util.addVec2(this.size,new Vec2(3,3)), this.getStyles('focused')); }; @@ -113,4 +113,3 @@ mexui.Control.Slider.prototype.clampProgress = function() else if(this.progress > 1.0) this.progress = 1.0; }; - diff --git a/third-party/mexui/Core/Control/TabPanel.js b/third-party/mexui/Core/Control/TabPanel.js index aa83369c..39b665ca 100644 --- a/third-party/mexui/Core/Control/TabPanel.js +++ b/third-party/mexui/Core/Control/TabPanel.js @@ -2,7 +2,7 @@ mexui.util.createControlConstructor('TabPanel', true, function(window, x, y, w, { mexui.Component.Control.call(this, window, x, y, w, h, this.linkControlStyles('TabPanel', styles)); mexui.Entity.ControlWithEntries.call(this, false, false); - + this.activeTabIndex = 0; }); @@ -13,7 +13,7 @@ mexui.util.linkBaseControlStyles('TabPanel', { backgroundColour: toColour(240, 20, 20, 200), borderColour: toColour(120, 20, 20, 225), textColour: toColour(0, 0, 0, 255), - + hover: { backgroundColour: toColour(240, 20, 20, 150), @@ -29,24 +29,24 @@ mexui.Control.TabPanel.prototype.onMouseDown = function(e) if(e.button == 0) { var pos = this.getScreenPosition(); - + var tabX = pos.x; for(var i in this.axis.x.entries) { var tab = this.axis.x.entries[i]; - + var tabPos = new Vec2(tabX, pos.y); var tabSize = new Vec2(mexui.native.getTextWidth(tab.text, this.getStyles('tab')) + 10, 25); - + if(mexui.util.isCursorInRectangle(tabPos, tabSize)) { tab.setActive(); break; } - + tabX += tabSize.x; } - + /* var tab = this.axis.x.getEntryByCursor(); if(tab) @@ -59,22 +59,22 @@ mexui.Control.TabPanel.prototype.onMouseDown = function(e) mexui.Control.TabPanel.prototype.render = function() { var pos = this.getScreenPosition(); - + mexui.native.drawRectangle(pos, this.size, this.getStyles('main')); - + var tabX = pos.x; for(var i in this.axis.x.entries) { var tab = this.axis.x.entries[i]; - + var tabPos = new Vec2(tabX, pos.y); var tabSize = new Vec2(mexui.native.getTextWidth(tab.text, this.getStyles('tab')) + 10, 25); mexui.native.drawRectangle(tabPos, tabSize, this.getStyles('tab')); mexui.native.drawText(tabPos, tabSize, tab.text, this.getStyles('tab')); - + tabX += tabSize.x; } - + if(this.isFocused()) mexui.native.drawRectangleBorder(mexui.util.subtractVec2(pos,new Vec2(2,2)), mexui.util.addVec2(this.size,new Vec2(3,3)), this.getStyles('focused')); }; diff --git a/third-party/mexui/Core/Control/Text.js b/third-party/mexui/Core/Control/Text.js index 92532fc6..7b8cbdd1 100644 --- a/third-party/mexui/Core/Control/Text.js +++ b/third-party/mexui/Core/Control/Text.js @@ -1,7 +1,7 @@ mexui.util.createControlConstructor('Text', false, function(window, x, y, w, h, text, styles) { mexui.Component.Control.call(this, window, x, y, w, h, this.linkControlStyles('Text', styles)); - + this.text = text; }); @@ -12,9 +12,9 @@ mexui.util.linkBaseControlStyles('Text', {}); mexui.Control.Text.prototype.render = function() { var pos = this.getScreenPosition(); - + mexui.native.drawText(pos, this.size, this.text, this.getStyles('main')); - + if(this.isFocused()) mexui.native.drawRectangleBorder(mexui.util.subtractVec2(pos,new Vec2(2,2)), mexui.util.addVec2(this.size,new Vec2(3,3)), this.getStyles('focused')); }; \ No newline at end of file diff --git a/third-party/mexui/Core/Control/TextArea.js b/third-party/mexui/Core/Control/TextArea.js index 0d3d1b0a..58478712 100644 --- a/third-party/mexui/Core/Control/TextArea.js +++ b/third-party/mexui/Core/Control/TextArea.js @@ -1,7 +1,7 @@ mexui.util.createControlConstructor('TextArea', false, function(window, x, y, w, h, text, styles, callback) { mexui.Control.TextInput.call(this, window, x, y, w, h, text, this.linkControlStyles('TextArea', styles), callback, false, true); - + this.multiLine = true; }); mexui.util.extend(mexui.Control.TextArea, mexui.Control.TextInput); \ No newline at end of file diff --git a/third-party/mexui/Core/Control/TextInput.js b/third-party/mexui/Core/Control/TextInput.js index ea1e445b..14c3ffb6 100644 --- a/third-party/mexui/Core/Control/TextInput.js +++ b/third-party/mexui/Core/Control/TextInput.js @@ -3,11 +3,11 @@ mexui.util.createControlConstructor('TextInput', false, function(window, x, y, w text = text || ''; if(singleCharacter) multiLineSupported = false; - + mexui.Component.Control.call(this, window, x, y, w, h, this.linkControlStyles('TextInput', styles), callback); - + this.lines = text ? mexui.util.splitLines(text) : ['']; - + this.caretPosition = new Vec2(0, 0); this.multiLineSupported = multiLineSupported === undefined ? true : multiLineSupported; this.multiLine = this.multiLineSupported ? mexui.util.doesContainEOLChar(text) : false; @@ -17,7 +17,7 @@ mexui.util.createControlConstructor('TextInput', false, function(window, x, y, w this.caretShownForBlink = true; this.lineHeight = 25; this.maxLength = this.singleCharacter ? 1 : false; - + this.validValue = true; }); @@ -44,7 +44,7 @@ mexui.Control.TextInput.prototype.onMouseDown = function(e) this.caretPosition = this.getCaretPositionByCursor(); } } - + mexui.Component.Control.prototype.onMouseDown.call(this, e); }; @@ -57,11 +57,11 @@ mexui.Control.TextInput.prototype.onCharacter = function(e, character) if(!isValid1 && isValid1 !== undefined) return; */ - + var isValid2 = this.validateInputCallback ? this.validateInputCallback(e, character) : true; if(!isValid2) return; - + if(this.singleCharacter) { this.resetText(); @@ -73,7 +73,7 @@ mexui.Control.TextInput.prototype.onCharacter = function(e, character) this.lines[this.caretPosition.y] = this.getTextWithNewCharacter(character); this.caretPosition.x++; } - + this.checkToCallCallback(); this.validateValue(e); } @@ -83,9 +83,9 @@ mexui.Control.TextInput.prototype.onKeyDown = function(e, key, mods) { if(mexui.focusedControl != this) return; - + var controlIsDown = (mods & KMOD_CTRL) == KMOD_CTRL; - + switch(key) { case SDLK_LEFT: @@ -156,7 +156,7 @@ mexui.Control.TextInput.prototype.onKeyDown = function(e, key, mods) } break; } - + if(this.multiLine) { switch(key) @@ -199,7 +199,7 @@ mexui.Control.TextInput.prototype.onKeyDown = function(e, key, mods) break; } } - + this.validateValue(e); }; @@ -208,9 +208,9 @@ mexui.Control.TextInput.prototype.render = function() { var pos = this.getScreenPosition(); var pos2 = new Vec2(pos.x, pos.y); - + mexui.native.drawRectangle(pos, this.size, this.getStyles('main')); - + if(this.isEmpty()) { mexui.native.drawText(pos, this.size, this.placeholder, this.getStyles('placeholder')); @@ -222,18 +222,18 @@ mexui.Control.TextInput.prototype.render = function() { var displayedText = this.masked ? '*'.repeat(this.lines[i].length) : this.lines[i]; mexui.native.drawText(pos, lineSize, displayedText, this.getStyles('main')); - + pos.y += this.lineHeight; } } - + var valueIsInvalid = !this.isEmpty() && !this.validValue; - + if(this.isFocused()) { if(!valueIsInvalid) mexui.native.drawRectangleBorder(mexui.util.subtractVec2(pos2,new Vec2(2,2)), mexui.util.addVec2(this.size,new Vec2(3,3)), this.getStyles('focused')); - + if(this.caretShownForBlink) { var pos = this.getScreenPosition(); @@ -246,7 +246,7 @@ mexui.Control.TextInput.prototype.render = function() mexui.native.drawAALine(caretPoint1, caretPoint2, this.getStyles('caret')); } } - + if(valueIsInvalid) mexui.native.drawRectangleBorder(mexui.util.subtractVec2(pos2,new Vec2(2,2)), mexui.util.addVec2(this.size,new Vec2(3,3)), this.getStyles('invalidValue')); }; @@ -269,7 +269,7 @@ mexui.Control.TextInput.prototype.clampCaretPosition = function() this.caretPosition.y = 0; else if(this.caretPosition.y > (this.lines.length - 1)) this.caretPosition.y = this.lines.length - 1; - + if(this.caretPosition.x < 0) this.caretPosition.x = 0; else if(this.caretPosition.x > this.lines[this.caretPosition.y].length) @@ -287,7 +287,7 @@ mexui.Control.TextInput.prototype.getCaretLineIndexByCursor = function() { var yPos = gui.cursorPosition.y - this.getScreenPosition().y; var lineIndex = Math.floor(yPos / this.lineHeight); - + if(lineIndex < 0) return 0; else if(lineIndex > (this.lines.length - 1)) @@ -301,12 +301,12 @@ mexui.Control.TextInput.prototype.getCharIndexByCursor = function(lineIndex) var xPos = gui.cursorPosition.x - this.getScreenPosition().x; var line = this.lines[lineIndex]; var lineStyles = this.getStyles('caret'); - + for(var i=0,j=line.length; i<j; i++) { var text = line.substr(0, i + 1); var textWidth = mexui.native.getTextWidth(text, lineStyles); - + if(xPos < textWidth) return i; } diff --git a/third-party/mexui/Core/Control/Time.js b/third-party/mexui/Core/Control/Time.js index 597bb39c..7904deb1 100644 --- a/third-party/mexui/Core/Control/Time.js +++ b/third-party/mexui/Core/Control/Time.js @@ -1,11 +1,11 @@ mexui.util.createControlConstructor('Time', false, function(window, x, y, w, h, text, styles, callback) { mexui.Control.TextInput.call(this, window, x, y, w, h, text, this.linkControlStyles('Time', styles), callback, false, false); - + this.hour = 0; this.minute = 0; this.second = 0; - + this.inputShown = false; this.valueBoxSize = new Vec2(50, 30); this.arrowBoxSize = new Vec2(25, 22); @@ -35,29 +35,29 @@ mexui.Control.Time.prototype.onMouseDown = function(e) var propIndex = (Math.ceil((arrowIndex + 1) / 2)) - 1; var propName = mexui.Control.Time.units[propIndex]; var isIncrease = (arrowIndex % 2) == 1; - + if(isIncrease) this[propName]++; else this[propName]--; - + this[propName] %= propIndex == 0 ? 24 : 60; if(this[propName] == -1) this[propName] = propIndex == 0 ? 23 : 59; - + this.generateText(); - + return; } } - + if(this.isCursorOverControl()) { this.inputShown = !this.inputShown; e.used = true; return; } - + if(this.inputShown) { this.inputShown = false; @@ -71,18 +71,18 @@ mexui.Control.Time.prototype.renderAfter = function() { if(!this.inputShown) return; - + var screenPos = this.getScreenPosition(); - + var pos = new Vec2(screenPos.x, screenPos.y); for(var i=0; i<3; i++) { mexui.native.drawRectangle(pos, this.valueBoxSize, this.getStyles('main')); mexui.native.drawText(pos, this.valueBoxSize, this[mexui.Control.Time.units[i]], this.getStyles('main')); - + pos.x += this.valueBoxSize.x; } - + pos = new Vec2(screenPos.x, screenPos.y); pos.y += this.valueBoxSize.y; for(var i=0; i<3; i++) @@ -90,10 +90,10 @@ mexui.Control.Time.prototype.renderAfter = function() for(var i2=0; i2<2; i2++) { var text = (i2 % 2) == 0 ? '<' : '>'; - + mexui.native.drawRectangle(pos, this.arrowBoxSize, this.getStyles('main')); mexui.native.drawText(pos, this.arrowBoxSize, text, this.getStyles('main')); - + pos.x += this.arrowBoxSize.x; } } @@ -115,42 +115,42 @@ mexui.Control.Time.prototype.validateInputCallback = function(e, character) mexui.Control.Time.prototype.validateValueCallback = function(e) { var parts = this.getText().split(':'); - + if(parts.length != 3) return false; - + for(var i in parts) { var partAsStr = parts[i]; if(partAsStr === '') return false; - + var part = parseInt(partAsStr); - + if(partAsStr.length == 2 && partAsStr.substr(0, 1) == '0') partAsStr = partAsStr.substr(1); - + if(!mexui.util.isPositiveInt(partAsStr)) return false; - + if(part < 0) return false; - + if(part > (i == 0 ? 23 : 59)) return false; } - + return true; }; mexui.Control.Time.prototype.getArrowIndexByCursor = function() { var cursorPos = gui.cursorPosition; - + var screenPos = this.getScreenPosition(); var firstArrowStartPos = new Vec2(screenPos.x, screenPos.y + this.valueBoxSize.y); var lastArrowEndPos = new Vec2(screenPos.x + (this.arrowBoxSize.x * 6), screenPos.y + this.valueBoxSize.y + this.arrowBoxSize.y); - + if(cursorPos.x >= firstArrowStartPos.x && cursorPos.y >= firstArrowStartPos.y && cursorPos.x <= lastArrowEndPos.x && cursorPos.y <= lastArrowEndPos.y) { return Math.floor((cursorPos.x - firstArrowStartPos.x) / this.arrowBoxSize.x); diff --git a/third-party/mexui/Core/Control/Tree.js b/third-party/mexui/Core/Control/Tree.js index a6e5d56b..948b41b3 100644 --- a/third-party/mexui/Core/Control/Tree.js +++ b/third-party/mexui/Core/Control/Tree.js @@ -2,7 +2,7 @@ mexui.util.createControlConstructor('Tree', true, function(window, x, y, w, h, s { mexui.Component.Control.call(this, window, x, y, w, h, this.linkControlStyles('Tree', styles)); mexui.Entity.ControlWithEntries.call(this, false, false); - + this.rowHeight = 25; this.rowLevelIndentation = 10; this.scrollMultiplier = 10.0; @@ -32,10 +32,10 @@ mexui.Control.Tree.prototype.onMouseDown = function(e) { var pos = this.getScreenPosition(); pos.y -= this.axis.y.getScrolledOffset(); - + this.testRowClick(e, this.axis.y.entries, pos); } - + if(!e.used) mexui.Entity.ControlWithEntries.prototype.onMouseDown.call(this, e); }; @@ -45,9 +45,9 @@ mexui.Control.Tree.prototype.render = function() { var pos = this.getScreenPosition(); pos.y -= this.axis.y.getScrolledOffset(); - + this.renderRows(this.axis.y.entries, 0, pos); - + if(this.isFocused()) mexui.native.drawRectangleBorder(mexui.util.subtractVec2(pos,new Vec2(2,2)), mexui.util.addVec2(this.size,new Vec2(3,3)), this.getStyles('focused')); }; @@ -58,23 +58,23 @@ mexui.Control.Tree.prototype.renderRows = function(rows, level, pos) { var row = rows[i]; var shouldDraw = pos.y >= this.getScreenPosition().y && pos.y <= (this.getScreenPosition().y + this.size.y); - + if(shouldDraw) { if(row.rows.length > 0) mexui.native.drawText(new Vec2(pos.x - (this.rowLevelIndentation * 2), pos.y), new Vec2(this.size.x, this.rowHeight), row.open ? '-' : '+', this.getStyles('rowIcon')); - + mexui.native.drawRectangle(pos, new Vec2(this.size.x - (this.rowLevelIndentation * level), this.rowHeight), this.getStyles('row')); mexui.native.drawText(pos, new Vec2(this.size.x, this.rowHeight), row.text, this.getStyles('row')); } - + pos.y += this.rowHeight; - + if(shouldDraw) { mexui.native.drawAALine(pos, new Vec2(pos.x + this.size.x, pos.y), this.getStyles('rowLine')); } - + if(row.rows.length > 0 && row.open) { pos.x += this.rowLevelIndentation; @@ -106,7 +106,7 @@ mexui.Control.Tree.prototype.testRowClick = function(e, rows, pos) for(var i in rows) { var row = rows[i]; - + var rowPos = new Vec2(pos.x - (this.rowLevelIndentation * 2), pos.y); var rowSize = new Vec2(this.size.x + (this.rowLevelIndentation * 2), this.rowHeight); if(mexui.util.isCursorInRectangle(rowPos, rowSize)) @@ -115,9 +115,9 @@ mexui.Control.Tree.prototype.testRowClick = function(e, rows, pos) e.used = true; return; } - + pos.y += this.rowHeight; - + if(row.rows.length > 0 && row.open) { this.testRowClick(e, row.rows, pos); @@ -132,10 +132,10 @@ mexui.Control.Tree.prototype.onClickRow = function(row) if(row.rows.length > 0) { //var scrollableLengthBefore = this.axis.y.getScrollableLength(); - + row.open = !row.open; this.checkToShowScrollBars(); - + /* if(this.scrollBars[1].shown) { @@ -153,4 +153,3 @@ mexui.Control.Tree.prototype.row = function(text) this.axis.y.addEntry(entry); return entry; }; - diff --git a/third-party/mexui/Core/Control/Week.js b/third-party/mexui/Core/Control/Week.js index a141b319..17e4d026 100644 --- a/third-party/mexui/Core/Control/Week.js +++ b/third-party/mexui/Core/Control/Week.js @@ -13,9 +13,9 @@ mexui.Control.Week.prototype.validateInputCallback = function(e, character) mexui.Control.Week.prototype.validateValueCallback = function(e) { var _int = parseInt(this.getText()); - + if(_int < 1 || _int > 52) return false; - + return true; }; \ No newline at end of file diff --git a/third-party/mexui/Core/Control/Year.js b/third-party/mexui/Core/Control/Year.js index b1921ec4..321bccf0 100644 --- a/third-party/mexui/Core/Control/Year.js +++ b/third-party/mexui/Core/Control/Year.js @@ -1,7 +1,7 @@ mexui.util.createControlConstructor('Year', false, function(window, x, y, w, h, text, styles, callback) { mexui.Control.TextInput.call(this, window, x, y, w, h, text, this.linkControlStyles('Year', styles), callback, false, false); - + this.maxYearOffset = 10; this.minYearCallback = ()=>{ return 1900; }; this.maxYearCallback = ()=>{ return new Date().getFullYear() + this.maxYearOffset; } diff --git a/third-party/mexui/Core/Entity/Component.js b/third-party/mexui/Core/Entity/Component.js index e0afae23..a2821a4e 100644 --- a/third-party/mexui/Core/Entity/Component.js +++ b/third-party/mexui/Core/Entity/Component.js @@ -1,7 +1,7 @@ mexui.Entity.Component = function(moveable) { this.moveable = moveable; - + this.moving = false; }; mexui.util.extend(mexui.Entity.Component, mexui.Entity.StyleableEntity); diff --git a/third-party/mexui/Core/Entity/ControlAxis.js b/third-party/mexui/Core/Entity/ControlAxis.js index 4bddcdec..be5b64f0 100644 --- a/third-party/mexui/Core/Entity/ControlAxis.js +++ b/third-party/mexui/Core/Entity/ControlAxis.js @@ -3,7 +3,7 @@ mexui.Entity.ControlAxis = function(control, isVertical, manualScrollBar, entrie this.control = control; this.isVertical = isVertical; this.manualScrollBar = manualScrollBar; - + this.axisIndex = isVertical ? 1 : 0; this.entriesShown = true; this.entryCountShown = 15; @@ -27,7 +27,7 @@ mexui.Entity.ControlAxis.prototype.initScrollBar = function() var pos = mexui.util.addVec2(this.control.position, new Vec2(this.control.entriesPositionOffset.x, this.control.size.y)); this.scrollBar = new mexui.Control.ScrollBar(this.control.window, pos.x, pos.y, this.getDisplayedEntriesLength(), 25, false, this.control.styles.scrollBar); } - + if(this.manualScrollBar) this.scrollBar.shown = false; }; @@ -73,19 +73,19 @@ mexui.Entity.ControlAxis.prototype.getEntryIndexByPoint = function(point) { return null; } - + var pos = new Vec2(screenPos.x + this.control.entriesPositionOffset.x, screenPos.y + this.control.entriesPositionOffset.y); var index = Math.floor((point.y - pos.y) / this.control.entrySize[this.axisIndex]); index += this.getEntryStartIndex(); - + if(index < 0 || index >= this.entries.length) return null; - + return index; } else { - + } }; @@ -121,7 +121,7 @@ mexui.Entity.ControlAxis.prototype.getDisplayedEntriesLength = function() mexui.Entity.ControlAxis.prototype.setScrollBarManual = function(manual) { this.manualScrollBar = manual; - + if(manual) { this.setScrollBarShown(false); @@ -150,7 +150,7 @@ mexui.Entity.ControlAxis.prototype.checkToShowScrollBar = function() { if(this.manualScrollBar) return; - + this.setScrollBarShown(this.shouldDisplayScrollBar(), true); }; @@ -160,7 +160,7 @@ mexui.Entity.ControlAxis.prototype.getScrolledOffset = function() { if(!this.scrollBar.shown) return 0; - + return this.scrollBar.scrolledRatio * this.getScrollableLength(); } else @@ -197,4 +197,3 @@ mexui.Entity.ControlAxis.prototype.getDisplayedEntryCount = function() var displayedEntryCount = Math.floor(displayedEntriesLength / this.control.entrySize[this.axisIndex]); return this.entries.length < displayedEntryCount ? this.entries.length : displayedEntryCount; }; - diff --git a/third-party/mexui/Core/Entity/ControlWithEntries.js b/third-party/mexui/Core/Entity/ControlWithEntries.js index 732014ff..6a2f612b 100644 --- a/third-party/mexui/Core/Entity/ControlWithEntries.js +++ b/third-party/mexui/Core/Entity/ControlWithEntries.js @@ -4,14 +4,14 @@ mexui.Entity.ControlWithEntries = function(entriesOutsideControl, manualScrollBa this.entriesPositionOffset = entriesPositionOffset || new Vec2(0, 0); this.entrySize = entrySize || new Vec2(this.size.x, 25); this.entriesSizeOffset = entriesSizeOffset || new Vec2(0, 0); - + this.axis = {}; this.axis.x = new mexui.Entity.ControlAxis(this, false, manualScrollBar, entriesPositionOffset); this.axis.y = new mexui.Entity.ControlAxis(this, true, manualScrollBar, entriesPositionOffset); - + this.axis.x.initScrollBar(); this.axis.y.initScrollBar(); - + this.checkToShowScrollBars(); }; mexui.util.extend(mexui.Entity.ControlWithEntries, mexui.Component.Control); @@ -46,7 +46,7 @@ mexui.Entity.ControlWithEntries.prototype.onMouseMove = function(e, offset) } } } - + if(!e.used) this.triggerEvent('onMouseMove', e, offset); }; @@ -74,7 +74,7 @@ mexui.Entity.ControlWithEntries.prototype.triggerEvent = function(eventName, e, return; } } - + mexui.Component.Control.prototype[eventName].call(this, e, data); }; @@ -95,4 +95,3 @@ mexui.Entity.ControlWithEntries.prototype.removeAllEntries = function() this.axis.x.removeAllEntries(); this.axis.y.removeAllEntries(); }; - diff --git a/third-party/mexui/Core/Entity/StyleableEntity.js b/third-party/mexui/Core/Entity/StyleableEntity.js index ea25df16..b51f22d9 100644 --- a/third-party/mexui/Core/Entity/StyleableEntity.js +++ b/third-party/mexui/Core/Entity/StyleableEntity.js @@ -1,12 +1,12 @@ mexui.Entity.StyleableEntity = function(styles) { this.styles = styles; - + this.shown = true; //this.hovered = false; - + this.transitions = {}; // string controlPartName => Transition transition - + /* this.transitionDelayTimer = null; this.transitionStartTime = 0; @@ -26,9 +26,9 @@ mexui.Entity.StyleableEntity.globalDefaultStyles = { textAlign: 0.0, textIndent: 5, textColour: toColour(0, 0, 0, 255), - + backgroundColour: toColour(255, 255, 255, 255), - + lineWeight: 1 } }; @@ -39,14 +39,14 @@ mexui.Entity.StyleableEntity.defaultStyles = mexui.util.linkGlobalStyles(mexui.E backgroundColour: toColour(255, 255, 255, 255), borderColour: 'none', textColour: toColour(0, 0, 0, 255), - + hover: { backgroundColour: toColour(220, 220, 220, 255), borderColour: 'none', textColour: toColour(0, 0, 0, 255) }/*, - + focus: { borderColour: toColour(255, 128, 0, 230), @@ -96,30 +96,30 @@ mexui.Entity.StyleableEntity.prototype.getStyles = function(controlPartName) var isFocused = this.isFocused(); var isHovered = this.isHovered(); var styles = this.styles[controlPartName]; - + var transition = this.getTransition(controlPartName); - + if(transition.isProcessing()) { return mexui.util.getTransitionStyles(styles, ['hover'], transition.getMainToPseudoProgress()); } - + if(isHovered) { return mexui.util.mergeStyles(styles, ['hover']); } - + return styles; }; mexui.Entity.StyleableEntity.prototype.getEntryStyles = function(data) { var styles = {}; - + for(var i in data) { var baseStyles = data[i][0].getStyles(data[i][1]); - + for(var k in baseStyles) { if(baseStyles.hasOwnProperty(k) && styles[k] === undefined) @@ -128,11 +128,11 @@ mexui.Entity.StyleableEntity.prototype.getEntryStyles = function(data) } } } - + for(var i in data) { var baseStyles = data[i][0].getStyles(data[i][1]); - + for(var k in baseStyles) { if(styles[k] === undefined) @@ -141,7 +141,7 @@ mexui.Entity.StyleableEntity.prototype.getEntryStyles = function(data) } } } - + return styles; }; @@ -152,10 +152,10 @@ mexui.Entity.StyleableEntity.prototype.onMouseEnter = function() for(var i in controlParts) { var transition = this.getTransition(controlParts[i]); - + var delay = this.getTransitionDelayStyle(controlParts[i]); var time = this.getTransitionTimeStyle(controlParts[i]); - + transition.onMouseEnter(delay, time); } }; @@ -166,7 +166,7 @@ mexui.Entity.StyleableEntity.prototype.onMouseExit = function() for(var i in controlParts) { var transition = this.getTransition(controlParts[i]); - + transition.onMouseExit(); } }; @@ -207,4 +207,3 @@ mexui.Entity.StyleableEntity.prototype.getTransitionTimeStyle = function(control else return mexui.Entity.Transition.defaultTransitionTime; }; - diff --git a/third-party/mexui/Core/Entity/Transition.js b/third-party/mexui/Core/Entity/Transition.js index b72bcffd..a75d1dea 100644 --- a/third-party/mexui/Core/Entity/Transition.js +++ b/third-party/mexui/Core/Entity/Transition.js @@ -21,10 +21,10 @@ mexui.Entity.Transition.prototype.onMouseEnter = function(transitionDelay, trans if(this.isMouseEntered()) return; this.setMouseEntered(true); - + this.transitionDelay = transitionDelay; this.transitionTime = transitionTime; - + if(transitionDelay > 0) { this.startDelay(); @@ -44,7 +44,7 @@ mexui.Entity.Transition.prototype.onMouseExit = function() if(!this.isMouseEntered()) return; this.setMouseEntered(false); - + if(this.isDelayActive()) { this.clearDelayTimer(); @@ -82,7 +82,7 @@ mexui.Entity.Transition.prototype.stopProcessing = function() { this.stopInterpolation(); } - + this.delayTimer = null; this.processing = false; }; @@ -129,12 +129,12 @@ mexui.Entity.Transition.prototype.increaseMainToPseudoProgress = function() var timeDiff = mexui.util.time() - this.lastUpdateTime; this.lastUpdateTime = mexui.util.time(); var progressDiff = timeDiff / this.transitionTime; - + if(this.direction) this.mainToPseudoProgress += progressDiff; else this.mainToPseudoProgress -= progressDiff; - + if(this.mainToPseudoProgress < 0.0) { this.mainToPseudoProgress = 0.0; @@ -149,7 +149,7 @@ mexui.Entity.Transition.prototype.increaseMainToPseudoProgress = function() mexui.Entity.Transition.prototype.getMainToPseudoProgress = function() { this.increaseMainToPseudoProgress(); - + return this.mainToPseudoProgress; }; @@ -181,4 +181,3 @@ mexui.Entity.Transition.prototype.clearDelayTimer = function() clearTimeout(this.delayTimer); this.delayTimer = null; }; - diff --git a/third-party/mexui/Core/Entry/DropDownItem.js b/third-party/mexui/Core/Entry/DropDownItem.js index e8c7ed01..418a8a3a 100644 --- a/third-party/mexui/Core/Entry/DropDownItem.js +++ b/third-party/mexui/Core/Entry/DropDownItem.js @@ -1,7 +1,7 @@ mexui.Entry.DropDownItem = function(dropDown, text) { mexui.Component.Entry.call(this, dropDown, 1); - + this.text = text; }; mexui.util.extend(mexui.Entry.DropDownItem, mexui.Component.Entry); \ No newline at end of file diff --git a/third-party/mexui/Core/Entry/GridColumn.js b/third-party/mexui/Core/Entry/GridColumn.js index a2135ee0..07f0923c 100644 --- a/third-party/mexui/Core/Entry/GridColumn.js +++ b/third-party/mexui/Core/Entry/GridColumn.js @@ -1,7 +1,7 @@ mexui.Entry.GridColumn = function(grid, text, width, height) { mexui.Component.Entry.call(this, grid, 0); - + this.text = text || 'Column'; this.width = width || 100; this.height = height || 25; diff --git a/third-party/mexui/Core/Entry/GridRow.js b/third-party/mexui/Core/Entry/GridRow.js index 11419eff..8ab16b59 100644 --- a/third-party/mexui/Core/Entry/GridRow.js +++ b/third-party/mexui/Core/Entry/GridRow.js @@ -2,7 +2,7 @@ mexui.Entry.GridRow = function(grid, cells, styles) { mexui.Component.Entry.call(this, grid, 1); mexui.Entity.StyleableEntity.call(this, this.linkEntryStyles('GridRow', styles)); - + this.cells = cells; this.rowHeight = 25; }; @@ -10,4 +10,3 @@ mexui.util.extend(mexui.Entry.GridRow, mexui.Component.Entry); // default styles mexui.Entry.GridRow.defaultStyles = mexui.util.linkStyles(mexui.Entity.StyleableEntity.defaultStyles, {}); - diff --git a/third-party/mexui/Core/Entry/ListRow.js b/third-party/mexui/Core/Entry/ListRow.js index 438ec65e..37a34811 100644 --- a/third-party/mexui/Core/Entry/ListRow.js +++ b/third-party/mexui/Core/Entry/ListRow.js @@ -1,7 +1,7 @@ mexui.Entry.ListRow = function(list, text) { mexui.Component.Entry.call(this, list, 1); - + this.text = text; }; mexui.util.extend(mexui.Entry.ListRow, mexui.Component.Entry); \ No newline at end of file diff --git a/third-party/mexui/Core/Entry/Tab.js b/third-party/mexui/Core/Entry/Tab.js index 436833bb..5e128217 100644 --- a/third-party/mexui/Core/Entry/Tab.js +++ b/third-party/mexui/Core/Entry/Tab.js @@ -1,7 +1,7 @@ mexui.Entry.Tab = function(tabPanel, text) { mexui.Component.Entry.call(this, tabPanel, 0); - + this.text = text; this.controls = []; }; @@ -18,9 +18,9 @@ mexui.Entry.Tab.prototype.setActive = function() { for(var i in this.control.entries[this.control.activeTabIndex].controls) this.control.entries[this.control.activeTabIndex].controls[i].shown = false; - + this.control.activeTabIndex = this.getEntryIndex(); - + for(var i in this.control.entries[this.control.activeTabIndex].controls) this.control.entries[this.control.activeTabIndex].controls[i].shown = true; }; \ No newline at end of file diff --git a/third-party/mexui/Core/Entry/TreeRow.js b/third-party/mexui/Core/Entry/TreeRow.js index 51ed8617..212f0811 100644 --- a/third-party/mexui/Core/Entry/TreeRow.js +++ b/third-party/mexui/Core/Entry/TreeRow.js @@ -1,7 +1,7 @@ mexui.Entry.TreeRow = function(tree, text) { mexui.Component.Entry.call(this, tree, 1); - + this.open = true; this.text = text; this.rows = []; diff --git a/third-party/mexui/Core/Native.js b/third-party/mexui/Core/Native.js index 43746aed..4b226115 100644 --- a/third-party/mexui/Core/Native.js +++ b/third-party/mexui/Core/Native.js @@ -151,4 +151,3 @@ mexui.native.drawImage = function(position, size, image, styles) { drawing.drawRectangle(image, position, size); }; - diff --git a/third-party/mexui/Core/Utility.js b/third-party/mexui/Core/Utility.js index 32d4713c..9655c97a 100644 --- a/third-party/mexui/Core/Utility.js +++ b/third-party/mexui/Core/Utility.js @@ -242,9 +242,9 @@ mexui.util.getWindowSize = function() mexui.util.isRectangleInsideRectangle = function(pos1, size1, pos2, size2) { return !(pos2.x > (pos1.x + size1.x) || - (pos2.x + size2.x) < pos1.x || - pos2.y > (pos1.y + size1.y) || - (pos2.y + size2.y) < pos1.y); + (pos2.x + size2.x) < pos1.x || + pos2.y > (pos1.y + size1.y) || + (pos2.y + size2.y) < pos1.y); }; mexui.util.mergeStyles = function(styles, pseudoPartNames) diff --git a/third-party/mexui/mexui.js b/third-party/mexui/mexui.js index c102c836..238466cf 100644 --- a/third-party/mexui/mexui.js +++ b/third-party/mexui/mexui.js @@ -297,4 +297,3 @@ mexui.setInput = function(showInput) // } //} }; - From 5eb8ac4ea6e467e83f8de118f454939569aaf97a Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Wed, 16 Mar 2022 17:14:02 -0500 Subject: [PATCH 029/177] Add clientside vehicle script (unfinished) --- meta.xml | 3 ++- scripts/client/vehicle.js | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/meta.xml b/meta.xml index 79e7de37..0cf49d8b 100644 --- a/meta.xml +++ b/meta.xml @@ -135,7 +135,8 @@ <script src="scripts/client/skin-select.js" type="client" language="javascript" /> <script src="scripts/client/sync.js" type="client" language="javascript" /> <script src="scripts/client/utilities.js" type="client" language="javascript" /> - + <script src="scripts/client/vehicle.js" type="client" language="javascript" /> + <!-- MexUI --> <file type="client" src="third-party/mexui/Images/down-arrow.png" /> <script language="javascript" type="client" src="third-party/mexui/mexui.js" /> diff --git a/scripts/client/vehicle.js b/scripts/client/vehicle.js index bc8126ff..2b28e5a2 100644 --- a/scripts/client/vehicle.js +++ b/scripts/client/vehicle.js @@ -5,4 +5,14 @@ // FILE: vehicle.js // DESC: Provides vehicle functions and arrays with data // TYPE: Client (JavaScript) +// =========================================================================== + +function receiveVehicleFromServer(vehicleId, position, model, colour1, colour2, colour3 = 0, colour4 = 0) { + logToConsole(LOG_DEBUG, `[VRR.Job] Received vehicle ${vehicleId} (${getVehicleNameFromModel(model, getGame())}) from server`); + + if(getGame() == VRR_GAME_GTA_IV) { + + } +} + // =========================================================================== \ No newline at end of file From 787983a84b8192cc59e0174e4ace82e2a629234b Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Wed, 16 Mar 2022 20:42:00 -0500 Subject: [PATCH 030/177] Play intro music even if auto logged in --- scripts/server/account.js | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/server/account.js b/scripts/server/account.js index aa125ce1..c4316633 100644 --- a/scripts/server/account.js +++ b/scripts/server/account.js @@ -1147,6 +1147,7 @@ function initClient(client) { if(isAccountAutoIPLoginEnabled(tempAccountData) && getPlayerData(client).accountData.ipAddress == client.ip) { messagePlayerAlert(client, getLocaleString(client, "AutoLoggedInIP")); loginSuccess(client); + playRadioStreamForPlayer(client, getServerIntroMusicURL(), true, getPlayerStreamingRadioVolume(client)); } else { if(doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) { logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the login GUI.`); From c8d0f9d5672209e162e2426f736954212b2c69b8 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Wed, 16 Mar 2022 20:42:17 -0500 Subject: [PATCH 031/177] Move login HTML to login.js GUI script --- scripts/client/gui/login.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/scripts/client/gui/login.js b/scripts/client/gui/login.js index 51b5fa03..0e27789d 100644 --- a/scripts/client/gui/login.js +++ b/scripts/client/gui/login.js @@ -20,6 +20,28 @@ let login = { // =========================================================================== +let loginHTML = +`<html> + <head> + <title>Connected RP: Login + + + + +`; + +// =========================================================================== + function initLoginGUI() { logToConsole(LOG_DEBUG, `[VRR.GUI] Creating login GUI ...`); login.window = mexui.window(game.width/2-150, game.height/2-135, 300, 275, 'LOGIN', { From 529a431c87c38919bd4e7c760385a278b6f794a9 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Wed, 16 Mar 2022 20:42:34 -0500 Subject: [PATCH 032/177] Fix button size and pos on yes/no prompt GUI --- scripts/client/gui/yesno.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/client/gui/yesno.js b/scripts/client/gui/yesno.js index a7ee4f32..4a6d4efe 100644 --- a/scripts/client/gui/yesno.js +++ b/scripts/client/gui/yesno.js @@ -48,7 +48,7 @@ function initYesNoDialogGUI() { }, }); - yesNoDialog.yesButton = yesNoDialog.window.button(5, 100, 197, 25, 'YES', { + yesNoDialog.yesButton = yesNoDialog.window.button(5, 105, 190, 30, 'YES', { main: { backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha), textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], 255), @@ -61,7 +61,7 @@ function initYesNoDialogGUI() { }, }, yesNoDialogAnswerYes); - yesNoDialog.noButton = yesNoDialog.window.button(202, 105, 197, 25, 'NO', { + yesNoDialog.noButton = yesNoDialog.window.button(200, 105, 190, 30, 'NO', { main: { backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha), textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], 255), From 75614f215520177bbe5d3c47e2b6a4e941c442bd Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Wed, 16 Mar 2022 20:42:58 -0500 Subject: [PATCH 033/177] Add player cop state util --- scripts/client/server.js | 26 +++++++++++++++++++++++++- scripts/server/client.js | 13 +++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/scripts/client/server.js b/scripts/client/server.js index 5dc99b72..197a46c8 100644 --- a/scripts/client/server.js +++ b/scripts/client/server.js @@ -98,6 +98,8 @@ function addAllNetworkHandlers() { addNetworkEventHandler("vrr.playerPedId", sendLocalPlayerNetworkIdToServer); addNetworkEventHandler("vrr.ped", setLocalPlayerPedPartsAndProps); addNetworkEventHandler("vrr.pedSpeak", makePlayerPedSpeak); + addNetworkEventHandler("vrr.playerCop", setPlayerAsCopState); + addNetworkEventHandler("vrr.spawn", serverRequestedLocalPlayerSpawn); } // =========================================================================== @@ -152,7 +154,9 @@ function onServerSpawnedPlayer(state) { isSpawned = state; if(state) { setUpInitialGame(); - calledDeathEvent = false; + setTimeout(function() { + calledDeathEvent = false; + }, 1000); } } @@ -339,4 +343,24 @@ function makePlayerPedSpeak(speechName) { } } +// =========================================================================== + +function setPlayerAsCopState(state) { + if(getGame() == VRR_GAME_GTA_IV) { + natives.setPlayerAsCop(natives.getPlayerId(), state); + natives.setPoliceIgnorePlayer(natives.getPlayerId(), state); + } +} + +// =========================================================================== + +function serverRequestedLocalPlayerSpawn(skinId, position) { + if(getGame() == VRR_GAME_GTA_IV) { + natives.createPlayer(skinId, position); + //if(isCustomCameraSupported()) { + // game.restoreCamera(true); + //} + } +} + // =========================================================================== \ No newline at end of file diff --git a/scripts/server/client.js b/scripts/server/client.js index 9bd36a65..c4717cbe 100644 --- a/scripts/server/client.js +++ b/scripts/server/client.js @@ -74,6 +74,7 @@ function addAllNetworkHandlers() { addNetworkEventHandler("vrr.clientInfo", updateConnectionLogOnClientInfoReceive); addNetworkEventHandler("vrr.vehBuyState", receiveVehiclePurchaseStateUpdateFromClient); addNetworkEventHandler("vrr.playerPedId", receivePlayerPedNetworkId); + addNetworkEventHandler("vrr.playerCop", setPlayerAsCopState); } // =========================================================================== @@ -1183,4 +1184,16 @@ function makePlayerPedSpeak(client, pedSpeechName) { sendNetworkEventToPlayer("vrr.pedSpeak", client, pedSpeechName); } +// ========================================================================== + +function setPlayerAsCopState(client, state) { + sendNetworkEventToPlayer("vrr.playerCop", client, state); +} + +// ========================================================================== + +function tellPlayerToSpawn(client, skinId, position) { + sendNetworkEventToPlayer("vrr.spawn", client, skinId, position); +} + // ========================================================================== \ No newline at end of file From ab43d462b8fc9aa588523ff28ae88dba59eb48d8 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Wed, 16 Mar 2022 20:43:17 -0500 Subject: [PATCH 034/177] Use switch statement for game setup --- scripts/client/startup.js | 260 +++++++++++++++++++------------------- 1 file changed, 131 insertions(+), 129 deletions(-) diff --git a/scripts/client/startup.js b/scripts/client/startup.js index e8f4b94f..7c4b3e90 100644 --- a/scripts/client/startup.js +++ b/scripts/client/startup.js @@ -25,147 +25,149 @@ function initClientScripts() { // =========================================================================== function setUpInitialGame() { - if(getGame() == VRR_GAME_GTA_III) { - game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), 0); - game.setGameStat(STAT_PROGRESSMADE, 9999); - game.setGameStat(STAT_TOTALPROGRESSINGAME, 9999); - game.SET_CAR_DENSITY_MULTIPLIER(3.0); - game.SET_PED_DENSITY_MULTIPLIER(3.0); - game.onMission = true; - SetStandardControlsEnabled(true); - return true; - } + switch(getGame()) { + case VRR_GAME_GTA_III: + game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), 0); + game.setGameStat(STAT_PROGRESSMADE, 9999); + game.setGameStat(STAT_TOTALPROGRESSINGAME, 9999); + //game.SET_CAR_DENSITY_MULTIPLIER(3.0); // No visual effect. Needs tweaking and testing. + //game.SET_PED_DENSITY_MULTIPLIER(3.0); // No visual effect. Needs tweaking and testing. + game.onMission = true; // Disables taxi/vigilante/etc and other start mission triggers + SetStandardControlsEnabled(true); // Provided by mouse camera script (mousecam.js) + break; - if(getGame() == VRR_GAME_GTA_VC) { - game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), 0); - game.setGameStat(STAT_PROGRESSMADE, 9999); - game.setGameStat(STAT_TOTALPROGRESSINGAME, 9999); - game.SET_CAR_DENSITY_MULTIPLIER(3.0); - game.SET_PED_DENSITY_MULTIPLIER(3.0); + case VRR_GAME_GTA_VC: + game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), 0); + game.setGameStat(STAT_PROGRESSMADE, 9999); + game.setGameStat(STAT_TOTALPROGRESSINGAME, 9999); + //game.SET_CAR_DENSITY_MULTIPLIER(3.0); // No visual effect. Needs tweaking and testing. + //game.SET_PED_DENSITY_MULTIPLIER(3.0); // No visual effect. Needs tweaking and testing. - game.REQUEST_ANIMATION("bikev"); - game.REQUEST_ANIMATION("bikeh"); - game.REQUEST_ANIMATION("biked"); - game.REQUEST_ANIMATION("knife"); - game.REQUEST_ANIMATION("python"); - game.REQUEST_ANIMATION("shotgun"); - game.REQUEST_ANIMATION("buddy"); - game.REQUEST_ANIMATION("tec"); - game.REQUEST_ANIMATION("uzi"); - game.REQUEST_ANIMATION("rifle"); - game.REQUEST_ANIMATION("m60"); - game.REQUEST_ANIMATION("sniper"); - game.REQUEST_ANIMATION("grenade"); - game.REQUEST_ANIMATION("flame"); - game.REQUEST_ANIMATION("medic"); - game.REQUEST_ANIMATION("sunbathe"); - //game.REQUEST_ANIMATION("playidles"); - game.REQUEST_ANIMATION("riot"); - game.REQUEST_ANIMATION("strip"); - game.REQUEST_ANIMATION("lance"); - game.REQUEST_ANIMATION("skate"); + game.REQUEST_ANIMATION("bikev"); + game.REQUEST_ANIMATION("bikeh"); + game.REQUEST_ANIMATION("biked"); + game.REQUEST_ANIMATION("knife"); + game.REQUEST_ANIMATION("python"); + game.REQUEST_ANIMATION("shotgun"); + game.REQUEST_ANIMATION("buddy"); + game.REQUEST_ANIMATION("tec"); + game.REQUEST_ANIMATION("uzi"); + game.REQUEST_ANIMATION("rifle"); + game.REQUEST_ANIMATION("m60"); + game.REQUEST_ANIMATION("sniper"); + game.REQUEST_ANIMATION("grenade"); + game.REQUEST_ANIMATION("flame"); + game.REQUEST_ANIMATION("medic"); + game.REQUEST_ANIMATION("sunbathe"); + //game.REQUEST_ANIMATION("playidles"); + game.REQUEST_ANIMATION("riot"); + game.REQUEST_ANIMATION("strip"); + game.REQUEST_ANIMATION("lance"); + game.REQUEST_ANIMATION("skate"); - game.LOAD_ALL_MODELS_NOW(); - game.onMission = true; - SetStandardControlsEnabled(true); - return true; - } + game.LOAD_ALL_MODELS_NOW(); + game.onMission = true; // Disables taxi/vigilante/etc and other start mission triggers + SetStandardControlsEnabled(true); // Provided by mouse camera script (mousecam.js) + break; - if(getGame() == VRR_GAME_GTA_SA) { - game.setGameStat(STAT_WEAPONTYPE_PISTOL_SKILL, 400); - game.setGameStat(STAT_WEAPONTYPE_PISTOL_SILENCED_SKILL, 400); - game.setGameStat(STAT_WEAPONTYPE_DESERT_EAGLE_SKILL, 400); - game.setGameStat(STAT_WEAPONTYPE_SHOTGUN_SKILL, 400); - game.setGameStat(STAT_WEAPONTYPE_SAWNOFF_SHOTGUN_SKILL, 400); - game.setGameStat(STAT_WEAPONTYPE_SPAS12_SHOTGUN_SKILL, 400); - game.setGameStat(STAT_WEAPONTYPE_MICRO_UZI_SKILL, 400); - game.setGameStat(STAT_WEAPONTYPE_MP5_SKILL, 400); - game.setGameStat(STAT_WEAPONTYPE_AK47_SKILL, 400); - game.setGameStat(STAT_WEAPONTYPE_M4_SKILL, 400); - game.setGameStat(STAT_DRIVING_SKILL, 9999); - game.setGameStat(STAT_FAT, 9999); - game.setGameStat(STAT_ENERGY, 9999); - game.setGameStat(STAT_CYCLE_SKILL, 9999); - game.setGameStat(STAT_BIKE_SKILL, 9999); - game.setGameStat(STAT_GAMBLING, 9999); - game.setGameStat(STAT_PROGRESS_MADE, 9999); - game.setGameStat(STAT_RESPECT, 0); - game.setGameStat(STAT_RESPECT_TOTAL, 0); - game.setGameStat(STAT_SEX_APPEAL, 0); - game.setGameStat(STAT_STAMINA, 9999); - game.setGameStat(STAT_TOTAL_PROGRESS, 9999); - game.setGameStat(STAT_UNDERWATER_STAMINA, 9999); - game.setGameStat(STAT_BODY_MUSCLE, 9999); + case VRR_GAME_GTA_SA: + game.setGameStat(STAT_WEAPONTYPE_PISTOL_SKILL, 400); + game.setGameStat(STAT_WEAPONTYPE_PISTOL_SILENCED_SKILL, 400); + game.setGameStat(STAT_WEAPONTYPE_DESERT_EAGLE_SKILL, 400); + game.setGameStat(STAT_WEAPONTYPE_SHOTGUN_SKILL, 400); + game.setGameStat(STAT_WEAPONTYPE_SAWNOFF_SHOTGUN_SKILL, 400); + game.setGameStat(STAT_WEAPONTYPE_SPAS12_SHOTGUN_SKILL, 400); + game.setGameStat(STAT_WEAPONTYPE_MICRO_UZI_SKILL, 400); + game.setGameStat(STAT_WEAPONTYPE_MP5_SKILL, 400); + game.setGameStat(STAT_WEAPONTYPE_AK47_SKILL, 400); + game.setGameStat(STAT_WEAPONTYPE_M4_SKILL, 400); + game.setGameStat(STAT_DRIVING_SKILL, 9999); + game.setGameStat(STAT_FAT, 9999); + game.setGameStat(STAT_ENERGY, 9999); + game.setGameStat(STAT_CYCLE_SKILL, 9999); + game.setGameStat(STAT_BIKE_SKILL, 9999); + game.setGameStat(STAT_GAMBLING, 9999); + game.setGameStat(STAT_PROGRESS_MADE, 9999); + game.setGameStat(STAT_RESPECT, 0); + game.setGameStat(STAT_RESPECT_TOTAL, 0); + game.setGameStat(STAT_SEX_APPEAL, 0); + game.setGameStat(STAT_STAMINA, 9999); + game.setGameStat(STAT_TOTAL_PROGRESS, 9999); + game.setGameStat(STAT_UNDERWATER_STAMINA, 9999); + game.setGameStat(STAT_BODY_MUSCLE, 9999); - game.setDefaultInteriors(false); - game.onMission = true; - return true; - } + game.setDefaultInteriors(false); // Disables default yellow cone at doors for entering places in singleplayer + game.onMission = true; // Disables taxi/vigilante/etc and other start mission triggers + break; - if(getGame() == VRR_GAME_GTA_IV) { - natives.allowEmergencyServices(false); - natives.setCreateRandomCops(true); - natives.setMaxWantedLevel(0); - natives.setWantedMultiplier(0.0); - natives.allowPlayerToCarryNonMissionObjects(natives.getPlayerId(), true); - natives.setPlayerTeam(natives.getPlayerId(), 0); - natives.loadAllObjectsNow(); - natives.setCellphoneRanked(false); - natives.setOverrideNoSprintingOnPhoneInMultiplayer(false); - natives.setSyncWeatherAndGameTime(false); - natives.usePlayerColourInsteadOfTeamColour(true); - natives.disablePauseMenu(true); - natives.allowReactionAnims(localPlayer, false); - natives.allowGameToPauseForStreaming(false); - natives.allowStuntJumpsToTrigger(false); - natives.setPickupsFixCars(false); - natives.forceFullVoice(localPlayer); + case VRR_GAME_GTA_IV: + natives.allowEmergencyServices(false); + natives.setCreateRandomCops(true); + natives.setMaxWantedLevel(0); + natives.setWantedMultiplier(0.0); + natives.allowPlayerToCarryNonMissionObjects(natives.getPlayerId(), true); + natives.setPlayerTeam(natives.getPlayerId(), 0); + natives.loadAllObjectsNow(); + natives.setCellphoneRanked(false); + natives.setOverrideNoSprintingOnPhoneInMultiplayer(false); + natives.setSyncWeatherAndGameTime(false); + natives.usePlayerColourInsteadOfTeamColour(true); + natives.disablePauseMenu(true); + //natives.allowReactionAnims(localPlayer, false); + natives.allowGameToPauseForStreaming(false); + natives.allowStuntJumpsToTrigger(false); + natives.setPickupsFixCars(false); + natives.forceFullVoice(localPlayer); - // HUD and Display - //natives.displayCash(false); - //natives.displayAmmo(false); - //natives.displayHud(false); - //natives.displayRadar(false); - //natives.displayAreaName(false); - natives.displayPlayerNames(true); - natives.setPoliceRadarBlips(false); - natives.removeTemporaryRadarBlipsForPickups(); - natives.displayNonMinigameHelpMessages(false); - natives.setDisplayPlayerNameAndIcon(natives.getPlayerId(), true); + // HUD and Display + //natives.displayCash(false); + //natives.displayAmmo(false); + //natives.displayHud(false); + //natives.displayRadar(false); + //natives.displayAreaName(false); + natives.displayPlayerNames(true); + natives.setPoliceRadarBlips(false); + natives.removeTemporaryRadarBlipsForPickups(); + natives.displayNonMinigameHelpMessages(false); + natives.setDisplayPlayerNameAndIcon(natives.getPlayerId(), true); - // Item/Money Dropping - natives.setMoneyCarriedByAllNewPeds(0); - natives.setDeadPedsDropWeapons(false); - natives.setPlayersDropMoneyInNetworkGame(false); + // Item/Money Dropping + natives.setMoneyCarriedByAllNewPeds(0); + natives.setDeadPedsDropWeapons(false); + natives.setPlayersDropMoneyInNetworkGame(false); - // Population - //natives.dontSuppressAnyCarModels(5.0); - //natives.dontSuppressAnyPedModels(5.0); - //natives.forceGenerateParkedCarsTooCloseToOthers(true); - //natives.setParkedCarDensityMultiplier(5.0); - //natives.setRandomCarDensityMultiplier(5.0); - //natives.setPedDensityMultiplier(5.0); - //natives.setCarDensityMultiplier(5.0); - //natives.setScenarioPedDensityMultiplier(5.0, 5.0); - natives.switchRandomTrains(true); - natives.switchRandomBoats(true); - natives.switchAmbientPlanes(true); - natives.switchMadDrivers(false); + // Population + //natives.dontSuppressAnyCarModels(5.0); + //natives.dontSuppressAnyPedModels(5.0); + //natives.forceGenerateParkedCarsTooCloseToOthers(true); + //natives.setParkedCarDensityMultiplier(5.0); + //natives.setRandomCarDensityMultiplier(5.0); + //natives.setPedDensityMultiplier(5.0); + //natives.setCarDensityMultiplier(5.0); + //natives.setScenarioPedDensityMultiplier(5.0, 5.0); + natives.switchRandomTrains(true); + natives.switchRandomBoats(true); + natives.switchAmbientPlanes(true); + natives.switchMadDrivers(false); - // Singleplayer Cellphone - natives.requestScript("spcellphone"); - natives.startNewScript("spcellphone", 0); - //natives.setMessagesWaiting(false); + // Singleplayer Cellphone + natives.requestScript("spcellphone"); + natives.startNewScript("spcellphone", 0); + // Script "v-blockedscripts" blocks the mpcellphone scripts + natives.setMessagesWaiting(false); // Seems to have no effect + natives.setMobilePhoneRadioState(false); - // Animation libraries - natives.requestAnims("DANCING"); - return true; - } + // Animation libraries + natives.requestAnims("DANCING"); - if(getGame() == VRR_GAME_MAFIA_ONE) { - game.mapEnabled = false; - game.setTrafficEnabled(false); - return true; + // Some last steps + natives.loadAllObjectsNow(); + break; + + case VRR_GAME_MAFIA_ONE: + game.mapEnabled = false; + game.setTrafficEnabled(false); + break; } } From ab810d5db476b968af19af097797916b642dacdb Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Wed, 16 Mar 2022 20:43:46 -0500 Subject: [PATCH 035/177] Add commands to test prompt, error, & info GUI --- scripts/server/developer.js | 57 +++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/scripts/server/developer.js b/scripts/server/developer.js index 6f3ebe7a..ac348dcb 100644 --- a/scripts/server/developer.js +++ b/scripts/server/developer.js @@ -386,6 +386,63 @@ function setPlayerTesterStatusCommand(command, params, client) { // =========================================================================== +function testPromptGUICommand(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; + } + + showPlayerPromptGUI(targetClient, "Testing the two button prompt GUI", "Testing", "Yes", "No") + return true; +} + +// =========================================================================== + +function testInfoGUICommand(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; + } + + showPlayerInfoGUI(targetClient, "Testing the info dialog GUI", "Testing", "Ok"); + return true; +} + +// =========================================================================== + +function testErrorGUICommand(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; + } + + showPlayerErrorGUI(targetClient, "Testing the error dialog GUI", "Testing", "Ok"); + return true; +} + +// =========================================================================== + function saveAllServerDataCommand(command, params, client) { messageAdmins(`{clanOrange}Vortrex has forced a manual save of all data. Initiating ...`); saveAllServerDataToDatabase(); From 75cd67215ee4aafb7e51a8d8df62dea377a3e6e7 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Wed, 16 Mar 2022 20:45:55 -0500 Subject: [PATCH 036/177] Add speak cmd + allow admins command on discord --- scripts/server/command.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/server/command.js b/scripts/server/command.js index 673c4fed..93c1f15e 100644 --- a/scripts/server/command.js +++ b/scripts/server/command.js @@ -389,9 +389,10 @@ function loadCommands() { commandData("mousecam", toggleMouseCameraCommand, "", getStaffFlagValue("None"), true, false, "Toggles vehicle mouse camera for games that don't have it"), commandData("yes", playerPromptAnswerYesCommand, "", getStaffFlagValue("None"), true, false, "Answers a prompt with YES"), commandData("no", playerPromptAnswerNoCommand, "", getStaffFlagValue("None"), true, false, "Answers a prompt with NO"), - commandData("admins", listOnlineAdminsCommand, "", getStaffFlagValue("None"), true, false, "Shows a list of online admins"), + commandData("admins", listOnlineAdminsCommand, "", getStaffFlagValue("None"), true, true, "Shows a list of online admins"), commandData("stuck", stuckPlayerCommand, "", getStaffFlagValue("None"), true, false, "Fixes your position and virtual world if bugged"), commandData("gps", gpsCommand, "[item or place name]", getStaffFlagValue("None"), true, false, "Shows you locations for special places or where to buy items"), + commandData("speak", playerPedSpeakCommand, "", getStaffFlagValue("None"), true, false, "Makes your ped say something in their game voice (IV only)"), ], radio: [ commandData("radiostation", playStreamingRadioCommand, "", getStaffFlagValue("None"), true, false, "Plays a radio station in your vehicle, house, or business (depending on which one you're in)"), From fcfdf0417d9853907f754292b62e12ab69de599e Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Wed, 16 Mar 2022 21:06:51 -0500 Subject: [PATCH 037/177] Add info texts for a lot of commands --- scripts/server/command.js | 152 +++++++++++++++++++------------------- 1 file changed, 78 insertions(+), 74 deletions(-) diff --git a/scripts/server/command.js b/scripts/server/command.js index 93c1f15e..da6d58bd 100644 --- a/scripts/server/command.js +++ b/scripts/server/command.js @@ -202,28 +202,31 @@ function loadCommands() { ], core: [], database: [ - commandData("dbquery", executeDatabaseQueryCommand, "", getStaffFlagValue("Developer"), true, true), + commandData("dbquery", executeDatabaseQueryCommand, "", getStaffFlagValue("Developer"), true, true, "Run a query on the database"), //commandData("dbinfo", getDatabaseInfoCommand, "", getStaffFlagValue("Developer"), true, true), ], developer: [ - commandData("scode", executeServerCodeCommand, "", getStaffFlagValue("Developer"), true, true), - commandData("ccode", executeClientCodeCommand, "", getStaffFlagValue("Developer"), true, true), - commandData("gmx", restartGameModeCommand, "", getStaffFlagValue("Developer"), true, true), - commandData("saveall", saveAllServerDataCommand, "", getStaffFlagValue("Developer"), true, true), - commandData("docmd", simulateCommandForPlayerCommand, " [params]", getStaffFlagValue("Developer"), true, true), - commandData("docmdall", simulateCommandForAllPlayersCommand, " [params]", getStaffFlagValue("Developer"), true, true), - commandData("addloglvl", addLogLevelCommand, "", getStaffFlagValue("Developer"), true, true), - commandData("delloglvl", removeLogLevelCommand, "", getStaffFlagValue("Developer"), true, true), - commandData("loglvl", getLogLevelCommand, "", getStaffFlagValue("Developer"), true, true), + commandData("scode", executeServerCodeCommand, "", getStaffFlagValue("Developer"), true, true, "Execute serverside code"), + commandData("ccode", executeClientCodeCommand, "", getStaffFlagValue("Developer"), true, true, "Execute clientside code for a player"), + commandData("gmx", restartGameModeCommand, "", getStaffFlagValue("Developer"), true, true, "Restart this gamemode"), + commandData("saveall", saveAllServerDataCommand, "", getStaffFlagValue("Developer"), true, true, "Immediately save all data to database"), + commandData("docmd", simulateCommandForPlayerCommand, " [params]", getStaffFlagValue("Developer"), true, true, "Force a player to use a command"), + commandData("docmdall", simulateCommandForAllPlayersCommand, " [params]", getStaffFlagValue("Developer"), true, true, "Force all players to use a command"), + commandData("addloglevel", addLogLevelCommand, "", getStaffFlagValue("Developer"), true, true, "Adds a log level"), + commandData("delloglevel", removeLogLevelCommand, "", getStaffFlagValue("Developer"), true, true, "Removes an active log level"), + commandData("loglevel", getLogLevelCommand, "", getStaffFlagValue("Developer"), true, true, "Gets the current log level"), - commandData("nosave", togglePauseSavingToDatabaseCommand, "", getStaffFlagValue("Developer"), true, true), - commandData("streamurlall", streamAudioURLToAllPlayersCommand, " ", getStaffFlagValue("Developer"), true, true), - commandData("streamnameall", streamAudioNameToAllPlayersCommand, " ", getStaffFlagValue("Developer"), true, true), + commandData("nosave", togglePauseSavingToDatabaseCommand, "", getStaffFlagValue("Developer"), true, true, "Pauses saving to database (used for testing)"), + commandData("streamurlall", streamAudioURLToAllPlayersCommand, " ", getStaffFlagValue("Developer"), true, true, "Plays a URL radio stream for all players"), + commandData("streamnameall", streamAudioNameToAllPlayersCommand, " ", getStaffFlagValue("Developer"), true, true, "Plays an audio file stream for all players"), commandData("forceresetpass", forceAccountPasswordResetCommand, "", getStaffFlagValue("Developer"), true, true), - commandData("fixblips", fixAllServerBlipsCommand, "", getStaffFlagValue("Developer"), true, true), - commandData("fixpickups", fixAllServerPickupsCommand, "", getStaffFlagValue("Developer"), true, true), - commandData("resetambience", resetAllServerAmbienceElementsCommand, "", getStaffFlagValue("ManageWorld"), true, true), + commandData("fixblips", fixAllServerBlipsCommand, "", getStaffFlagValue("Developer"), true, true, "Clears and recreates all map blips"), + commandData("fixpickups", fixAllServerPickupsCommand, "", getStaffFlagValue("Developer"), true, true, "Clears and recreates all pickups"), + commandData("resetambience", resetAllServerAmbienceElementsCommand, "", getStaffFlagValue("ManageWorld"), true, true, "Clears all current server ambience elements (traffic, peds, etc)"), + commandData("testguiprompt", testPromptGUICommand, "", getStaffFlagValue("Developer"), true, true, "Shows a sample prompt GUI (two buttons) to a player for testing"), + commandData("testguiinfo", testInfoGUICommand, "", getStaffFlagValue("Developer"), true, true, "Shows a sample info dialog GUI to a player for testing"), + commandData("testguierror", testErrorGUICommand, "", getStaffFlagValue("Developer"), true, true, "Shows a sample error dialog GUI to a player for testing"), ], discord: [], economy: [ @@ -235,41 +238,41 @@ function loadCommands() { commandData("testemail", testEmailCommand, "", getStaffFlagValue("Developer"), true, true), ], help: [ - commandData("help", helpCommand, "", getStaffFlagValue("None"), false, false), - commandData("commands", helpCommand, "", getStaffFlagValue("None"), false, false), - commandData("cmds", helpCommand, "", getStaffFlagValue("None"), false, false), - commandData("info", helpCommand, "", getStaffFlagValue("None"), false, false), - commandData("veh", helpGetCarCommand, "", getStaffFlagValue("None"), false, false), - commandData("v", helpGetCarCommand, "", getStaffFlagValue("None"), false, false), - commandData("car", helpGetCarCommand, "", getStaffFlagValue("None"), false, false), - commandData("cars", helpGetCarCommand, "", getStaffFlagValue("None"), false, false), - commandData("spawncar", helpGetCarCommand, "", getStaffFlagValue("None"), false, false), - commandData("spawnveh", helpGetCarCommand, "", getStaffFlagValue("None"), false, false), - commandData("skin", helpGetSkinCommand, "", getStaffFlagValue("None"), false, false), - commandData("skins", helpGetSkinCommand, "", getStaffFlagValue("None"), false, false), - commandData("clothes", helpGetSkinCommand, "", getStaffFlagValue("None"), false, false), - //commandData("setskin", helpGetSkinCommand, "", getStaffFlagValue("None"), false, false), - commandData("changeskin", helpGetSkinCommand, "", getStaffFlagValue("None"), false, false), + commandData("help", helpCommand, "", getStaffFlagValue("None"), false, false, "Shows help messages for information"), + commandData("commands", helpCommand, "", getStaffFlagValue("None"), false, false, "Shows help messages for information"), + commandData("cmds", helpCommand, "", getStaffFlagValue("None"), false, false, "Shows help messages for information"), + commandData("info", helpCommand, "", getStaffFlagValue("None"), false, false, "Shows help messages for information"), + commandData("veh", helpGetCarCommand, "", getStaffFlagValue("None"), false, false, "Explains how to get/buy a vehicle"), + commandData("v", helpGetCarCommand, "", getStaffFlagValue("None"), false, false, "Explains how to get/buy a vehicle"), + commandData("car", helpGetCarCommand, "", getStaffFlagValue("None"), false, false), "Explains how to get/buy a vehicle", + commandData("cars", helpGetCarCommand, "", getStaffFlagValue("None"), false, false, "Explains how to get/buy a vehicle"), + commandData("spawncar", helpGetCarCommand, "", getStaffFlagValue("None"), false, false, "Explains how to get/buy a vehicle"), + commandData("spawnveh", helpGetCarCommand, "", getStaffFlagValue("None"), false, false, "Explains how to get/buy a vehicle"), + commandData("skin", helpGetSkinCommand, "", getStaffFlagValue("None"), false, false, "Explains how to change your skin"), + commandData("skins", helpGetSkinCommand, "", getStaffFlagValue("None"), false, false, "Explains how to change your skin"), + commandData("clothes", helpGetSkinCommand, "", getStaffFlagValue("None"), false, false, "Explains how to change your skin"), + //commandData("setskin", helpGetSkinCommand, "", getStaffFlagValue("None"), false, false, "Explains how to change your skin"), + commandData("changeskin", helpGetSkinCommand, "", getStaffFlagValue("None"), false, false, "Explains how to change your skin"), ], house: [ - commandData("addhouse", createHouseCommand, "", getStaffFlagValue("ManageHouses"), true, false), - commandData("delhouse", deleteHouseCommand, "", getStaffFlagValue("ManageHouses"), true, false), - commandData("housereloadall", reloadAllHousesCommand, "", getStaffFlagValue("ManageHouses"), true, false), + commandData("addhouse", createHouseCommand, "", getStaffFlagValue("ManageHouses"), true, false, "Creates a new house"), + commandData("delhouse", deleteHouseCommand, "", getStaffFlagValue("ManageHouses"), true, false, "Deletes a house"), + commandData("housereloadall", reloadAllHousesCommand, "", getStaffFlagValue("ManageHouses"), true, false, "Reloads all houses from the database"), - commandData("houseinfo", getHouseInfoCommand, "", getStaffFlagValue("None"), true, false), - commandData("housebuy", buyHouseCommand, "", getStaffFlagValue("None"), true, false), - commandData("houseclan", setHouseClanCommand, "", getStaffFlagValue("None"), true, false), - commandData("housedesc", setHouseDescriptionCommand, "", getStaffFlagValue("ManageHouses"), true, false), - commandData("houselock", lockUnlockHouseCommand, "", getStaffFlagValue("None"), true, false), - commandData("houselights", toggleHouseInteriorLightsCommand, "", getStaffFlagValue("None"), true, false), - commandData("houseowner", setHouseOwnerCommand, "", getStaffFlagValue("None"), true, false), - commandData("housebuyprice", setHouseBuyPriceCommand, "", getStaffFlagValue("None"), true, false), - commandData("houserentprice", setHouseRentPriceCommand, "", getStaffFlagValue("None"), true, false), - commandData("houseblip", setHouseBlipCommand, "", getStaffFlagValue("ManageHouses"), true, true), - commandData("housepickup", setHousePickupCommand, "", getStaffFlagValue("ManageHouses"), true, true), - commandData("houseentrance", moveHouseEntranceCommand, "", getStaffFlagValue("ManageHouses"), true, true), - commandData("houseexit", moveHouseExitCommand, "", getStaffFlagValue("ManageHouses"), true, true), - commandData("houseinttype", setHouseInteriorTypeCommand, "", getStaffFlagValue("ManageHouses"), true, true), + commandData("houseinfo", getHouseInfoCommand, "", getStaffFlagValue("None"), true, false, "Shows a house's information"), + commandData("housebuy", buyHouseCommand, "", getStaffFlagValue("None"), true, false, "Purchases a house"), + commandData("houseclan", setHouseClanCommand, "", getStaffFlagValue("None"), true, false, "Gives a house to your clan"), + commandData("housedesc", setHouseDescriptionCommand, "", getStaffFlagValue("ManageHouses"), true, false, "Sets a house's description"), + commandData("houselock", lockUnlockHouseCommand, "", getStaffFlagValue("None"), true, false, "Locks/unlocks a house door"), + commandData("houselights", toggleHouseInteriorLightsCommand, "", getStaffFlagValue("None"), true, false, "Turns on and off the lights inside a house"), + commandData("houseowner", setHouseOwnerCommand, "", getStaffFlagValue("None"), true, false, "Gives a house to a player"), + commandData("housebuyprice", setHouseBuyPriceCommand, "", getStaffFlagValue("None"), true, false, "Sets the purchase price of a house so people can buy it"), + commandData("houserentprice", setHouseRentPriceCommand, "", getStaffFlagValue("None"), true, false, "Sets the rent price of a house so people can rent it"), + commandData("houseblip", setHouseBlipCommand, "", getStaffFlagValue("ManageHouses"), true, true, "Changes or removes a house's map icon"), + commandData("housepickup", setHousePickupCommand, "", getStaffFlagValue("ManageHouses"), true, true, "Changes or removes a house's pickup"), + commandData("houseentrance", moveHouseEntranceCommand, "", getStaffFlagValue("ManageHouses"), true, true, "Moves a house's entrance (outside/exterior location to enter the house)"), + commandData("houseexit", moveHouseExitCommand, "", getStaffFlagValue("ManageHouses"), true, true, "Moves a house's exit (inside/interior location to exit the house)"), + commandData("houseinttype", setHouseInteriorTypeCommand, "", getStaffFlagValue("ManageHouses"), true, true, "Sets a house's interior to a pre-defined type"), ], item: [ commandData("i", playerSwitchHotBarSlotCommand, "", getStaffFlagValue("None"), true, false, "Switches to the item in the specified slot of your inventory."), @@ -291,43 +294,44 @@ function loadCommands() { commandData("bizfloor", listBusinessFloorInventoryCommand, "", getStaffFlagValue("None"), true, false, "Shows the items that can be bought from the business"), commandData("buylist", listBusinessFloorInventoryCommand, "", getStaffFlagValue("None"), true, false, "Shows the items that can be bought from the business"), - commandData("power", toggleItemEnabledCommand, "", getStaffFlagValue("None"), true, false), - commandData("freq", setWalkieTalkieFrequencyCommand, "[frequncy number]", getStaffFlagValue("None"), true, false), + commandData("power", toggleItemEnabledCommand, "", getStaffFlagValue("None"), true, false, "Turns on or off an item"), + commandData("freq", setWalkieTalkieFrequencyCommand, "[frequncy number]", getStaffFlagValue("None"), true, false, "Sets a radio item's frequency"), //commandData("call", callWithPhoneCommand, "[number]", getStaffFlagValue("None"), true, false), //commandData("speakerphone", togglePhoneSpeakerCommand, "", getStaffFlagValue("None"), true, false), - commandData("radio", walkieTalkieChatCommand, "", getStaffFlagValue("None"), true, false), - commandData("r", walkieTalkieChatCommand, "", getStaffFlagValue("None"), true, false), + commandData("radio", walkieTalkieChatCommand, "", getStaffFlagValue("None"), true, false, "Chat over a radio item (item must be able to transmit)"), + commandData("r", walkieTalkieChatCommand, "", getStaffFlagValue("None"), true, false, "Chat over a radio item (item must be able to transmit)"), - commandData("additemtype", createItemTypeCommand, "", getStaffFlagValue("ManageItems"), true, false), - commandData("itemtypeusetype", setItemTypeUseTypeCommand, " ", getStaffFlagValue("ManageItems"), true, false), - commandData("itemtypeuseval", setItemTypeUseValueCommand, " ", getStaffFlagValue("ManageItems"), true, false), - commandData("itemtypeorderprice", setItemTypeOrderPriceCommand, " ", getStaffFlagValue("ManageItems"), true, false), - commandData("itemtyperiskmult", setItemTypeRiskMultiplierCommand, " ", getStaffFlagValue("ManageItems"), true, false), - commandData("itemtypeenabled", toggleItemTypeEnabledCommand, "", getStaffFlagValue("ManageItems"), true, false), + commandData("additemtype", createItemTypeCommand, "", getStaffFlagValue("ManageItems"), true, false, "Adds a new item type"), + commandData("itemtypeusetype", setItemTypeUseTypeCommand, " ", getStaffFlagValue("ManageItems"), true, false, "Sets an item type's use-type (what kind of action is performed when using it)"), + commandData("itemtypeuseval", setItemTypeUseValueCommand, " ", getStaffFlagValue("ManageItems"), true, false, "Sets an item type's use-value (how much gets subtracted when using it)"), + commandData("itemtypeorderprice", setItemTypeOrderPriceCommand, " ", getStaffFlagValue("ManageItems"), true, false, "Sets an item type's order price (base price when ordering for a business"), + commandData("itemtyperiskmult", setItemTypeRiskMultiplierCommand, " ", getStaffFlagValue("ManageItems"), true, false, "Sets an item type's risk multiplayer (higher value for more dangerous or rare illegal items)"), + commandData("itemtypeenabled", toggleItemTypeEnabledCommand, "", getStaffFlagValue("ManageItems"), true, false, "Toggles an item type on or off (if off, any items with that type can't be interacted with)"), - commandData("delplritem", deleteItemInPlayerInventoryCommand, " ", getStaffFlagValue("ManageItems"), true, false), - commandData("delplritems", deleteAllItemsInPlayerInventoryCommand, "", getStaffFlagValue("ManageItems"), true, false), + commandData("delplritem", deleteItemInPlayerInventoryCommand, " ", getStaffFlagValue("ManageItems"), true, false, "Removes an item by slot from a player's personal inventory"), + commandData("delplritems", deleteAllItemsInPlayerInventoryCommand, "", getStaffFlagValue("ManageItems"), true, false, "Removes all items from a player's personal inventory"), ], job: [ - commandData("takejob", takeJobCommand, "", getStaffFlagValue("None"), true, false), - commandData("startwork", startWorkingCommand, "", getStaffFlagValue("None"), true, false), - commandData("stopwork", stopWorkingCommand, "", getStaffFlagValue("None"), true, false), - commandData("startjob", startWorkingCommand, "", getStaffFlagValue("None"), true, false), - commandData("stopjob", stopWorkingCommand, "", getStaffFlagValue("None"), true, false), - commandData("quitjob", quitJobCommand, "", getStaffFlagValue("None"), true, false), - commandData("uniform", jobUniformCommand, "[uniform]", getStaffFlagValue("None"), true, false), - commandData("equip", jobEquipmentCommand, "[equipment]", getStaffFlagValue("None"), true, false), + commandData("takejob", takeJobCommand, "", getStaffFlagValue("None"), true, false, "Gives you the job"), + commandData("startwork", startWorkingCommand, "", getStaffFlagValue("None"), true, false, "Start working at your job (use at a job location or near a job vehicle)"), + commandData("stopwork", stopWorkingCommand, "", getStaffFlagValue("None"), true, false, "Stop working at your job"), + commandData("startjob", startWorkingCommand, "", getStaffFlagValue("None"), true, false, "Start working at your job (use at a job location or near a job vehicle)"), + commandData("stopjob", stopWorkingCommand, "", getStaffFlagValue("None"), true, false, "Stop working at your job"), + commandData("quitjob", quitJobCommand, "", getStaffFlagValue("None"), true, false, "Leave your job and be unemployed"), + commandData("uniform", jobUniformCommand, "[uniform]", getStaffFlagValue("None"), true, false, "Use a job uniform"), + commandData("equip", jobEquipmentCommand, "[equipment]", getStaffFlagValue("None"), true, false, "Get equipment for your job"), - commandData("department", jobDepartmentRadioCommand, "", getStaffFlagValue("None"), true, false), - commandData("d", jobDepartmentRadioCommand, "", getStaffFlagValue("None"), true, false), + // Emergency Services (Police, Fire, EMS, etc) + commandData("department", jobDepartmentRadioCommand, "", getStaffFlagValue("None"), true, false, "Communicate with all emergency services (radio must be on and able to transmit)"), + commandData("d", jobDepartmentRadioCommand, "", getStaffFlagValue("None"), true, false, "Communicate with all emergency services (radio must be on and able to transmit)"), // Taxi - commandData("fare", taxiSetFareCommand, "", getStaffFlagValue("None"), true, false), + commandData("fare", taxiSetFareCommand, "", getStaffFlagValue("None"), true, false, "Sets the fare for passengers in your taxi (amount is charged every 10 seconds)"), // Police - commandData("detain", policeDetainCommand, "", getStaffFlagValue("None"), true, false), - commandData("drag", policeDragCommand, "", getStaffFlagValue("None"), true, false), - commandData("search", policeSearchCommand, "", getStaffFlagValue("None"), true, false), + commandData("detain", policeDetainCommand, "", getStaffFlagValue("None"), true, false, "Puts a handcuffed person in the back of your police vehicle"), + commandData("drag", policeDragCommand, "", getStaffFlagValue("None"), true, false, "Drags a handcuffed person around"), + commandData("search", policeSearchCommand, "", getStaffFlagValue("None"), true, false, "Searches a person"), // Routes commandData("startroute", jobStartRouteCommand, "", getStaffFlagValue("None"), true, false), From e3f44d301d9b27a55e2569792eb099a700d80b1d Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Thu, 17 Mar 2022 08:03:56 -0500 Subject: [PATCH 038/177] Use index to save item data + add JSDoc info --- scripts/server/item.js | 66 +++++++++++++++++++++++++++++++++--------- 1 file changed, 53 insertions(+), 13 deletions(-) diff --git a/scripts/server/item.js b/scripts/server/item.js index fa5b0544..5707d0ec 100644 --- a/scripts/server/item.js +++ b/scripts/server/item.js @@ -1472,6 +1472,10 @@ function listItemInventoryCommand(command, params, client) { // =========================================================================== +/** + * @param {number} itemId - The data index of the item + * @return {ItemData} The item's data (class instance) + */ function getItemData(itemId) { if(typeof getServerData().items[itemId] != "undefined") { return getServerData().items[itemId]; @@ -1481,6 +1485,10 @@ function getItemData(itemId) { // =========================================================================== +/** + * @param {number} itemTypeId - The data index of the item type + * @return {ItemTypeData} The item type's data (class instance) + */ function getItemTypeData(itemTypeId) { return getServerData().itemTypes[itemTypeId]; } @@ -1489,11 +1497,7 @@ function getItemTypeData(itemTypeId) { function saveAllItemsToDatabase() { for(let i in getServerData().items) { - if(getServerData().items[i].needsSaved) { - if(getServerData().items[i].databaseId != -1) { - saveItemToDatabase(getServerData().items[i]); - } - } + saveItemToDatabase(i); } } @@ -1501,17 +1505,26 @@ function saveAllItemsToDatabase() { function saveAllItemTypesToDatabase() { for(let i in getServerData().itemTypes) { - if(getServerData().itemTypes[i].needsSaved) { - if(getServerData().itemTypes[i].databaseId != -1) { - saveItemTypeToDatabase(getServerData().itemTypes[i]); - } - } + saveItemTypeToDatabase(i); } } // =========================================================================== -function saveItemToDatabase(itemData) { +function saveItemToDatabase(itemId) { + let itemData = getItemData(itemId); + if(itemData == false) { + return false; + } + + if(itemData.databaseId == -1) { + return false; + } + + if(!itemData.needsSaved) { + return false; + } + logToConsole(LOG_VERBOSE, `[VRR.Item]: Saving item '${itemData.index}' to database ...`); let dbConnection = connectToDatabase(); @@ -1553,15 +1566,36 @@ function saveItemToDatabase(itemData) { // =========================================================================== -function saveItemTypeToDatabase(itemTypeData) { +function saveItemTypeToDatabase(itemTypeId) { + let itemTypeData = getItemTypeData(itemTypeId); + if(itemTypeData == false) { + return false; + } + + if(itemTypeData.databaseId == -1) { + return false; + } + + if(!itemTypeData.needsSaved) { + return false; + } + logToConsole(LOG_VERBOSE, `[VRR.Item]: Saving item type '${itemTypeData.name}' to database ...`); let dbConnection = connectToDatabase(); if(dbConnection) { + let safeItemTypeName = escapeDatabaseString(dbConnection, itemTypeData.name); + let safeAnimationUse = escapeDatabaseString(dbConnection, itemTypeData.useAnimationName); + let safeAnimationDrop = escapeDatabaseString(dbConnection, itemTypeData.dropAnimationName); + let safeAnimationPickup = escapeDatabaseString(dbConnection, itemTypeData.pickupAnimationName); + let safeAnimationGive = escapeDatabaseString(dbConnection, itemTypeData.giveAnimationName); + let safeAnimationTake = escapeDatabaseString(dbConnection, itemTypeData.takeAnimationName); + let safeAnimationSwitch = escapeDatabaseString(dbConnection, itemTypeData.switchAnimationName); + let data = [ ["item_type_id", itemTypeData.databaseId], ["item_type_server", itemTypeData.serverId], - ["item_type_name", itemTypeData.name], + ["item_type_name", safeItemTypeName], ["item_type_enabled", itemTypeData.enabled], ["item_type_use_type", itemTypeData.useType], ["item_type_drop_type", itemTypeData.dropType], @@ -1592,6 +1626,12 @@ function saveItemTypeToDatabase(itemTypeData) { ["item_type_delay_take", itemTypeData.takeDelay], ["item_type_delay_give", itemTypeData.giveDelay], ["item_type_delay_drop", itemTypeData.dropDelay], + ["item_type_anim_use", safeAnimationUse], + ["item_type_anim_drop", safeAnimationDrop], + ["item_type_anim_pickup", safeAnimationPickup], + ["item_type_anim_give", safeAnimationGive], + ["item_type_anim_take", safeAnimationTake], + ["item_type_anim_switch", safeAnimationSwitch], ]; let dbQuery = null; From 842f13e382cd52e67bf9f4e37bde67f81f4af19d Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Thu, 17 Mar 2022 08:05:13 -0500 Subject: [PATCH 039/177] Add some JSDoc + check if clan ID is -1 for temp --- scripts/server/clan.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/scripts/server/clan.js b/scripts/server/clan.js index 375cbe6c..2580d6da 100644 --- a/scripts/server/clan.js +++ b/scripts/server/clan.js @@ -948,6 +948,10 @@ function saveClanToDatabase(clanId) { return false; } + if(tempClanData.databaseId == -1) { + return false; + } + if(!tempClanData.needsSaved) { return false; } @@ -1134,6 +1138,11 @@ function getClanRankIdFromDatabaseId(clanId, databaseId) { // =========================================================================== +/** + * @param {number} clanId - The data index of the clan + * @param {number} clanRankId - The data index of the clan rank + * @return {ClanRankData} The clan rank's data (class instance) + */ function getClanRankData(clanId, rankId) { return getServerData().clans[clanId].ranks[rankId]; } @@ -1213,6 +1222,10 @@ let rankId = getClanRankFromParams(clanId, getParam(params, " ", 1)); } */ +/** + * @param {String} params - The params to search for + * @return {Number} The data index of a matching clan + */ function getClanFromParams(params) { if(isNaN(params)) { for(let i in getServerData().clans) { @@ -1231,6 +1244,11 @@ function getClanFromParams(params) { // =========================================================================== +/** + * @param {Number} clanId - The clan ID to search ranks for + * @param {String} params - The params to search for + * @return {Number} The data index of a matching clan + */ function getClanRankFromParams(clanId, params) { if(isNaN(params)) { for(let i in getClanData(clanId).ranks) { From 9f6c8b1026ff2ebda2afbc5754fb1f7ad17270cd Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Thu, 17 Mar 2022 08:05:32 -0500 Subject: [PATCH 040/177] Start working on combo keybind support --- scripts/server/keybind.js | 46 +++++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/scripts/server/keybind.js b/scripts/server/keybind.js index d392bd68..e7d33dd6 100644 --- a/scripts/server/keybind.js +++ b/scripts/server/keybind.js @@ -19,19 +19,16 @@ function initKeyBindScript() { function addKeyBindCommand(command, params, client) { let splitParams = params.split(" "); - let keyId = getKeyIdFromParams(getParam(params, " ", 1)); + let keys = getKeysInComboName(getParam(params, " ", 1)); let tempCommand = getParam(params, " ", 2); let tempParams = (splitParams.length > 2) ? splitParams.slice(2).join(" ") : ""; - if(!keyId) { - messagePlayerError(client, "The key ID or name you input is invalid!"); - messagePlayerTip(client, "Use simple key names, letters, or numbers. Don't add spaces."); + if(keys.indexOf(false) != -1) { + messagePlayerError(client, "One of the key names you input is invalid!"); + messagePlayerTip(client, "Use simple key names, letters, or numbers. Don't add spaces. Must be lowercase."); + messagePlayerTip(client, "No actual symbols, use a name for those if needed like ampersand, hashtag, tilde, etc"); messagePlayerInfo(client, `Examples: {ALTCOLOUR}1, 2, a, b, numplus, num1, f1, f2, pageup, delete, insert, rightshift, leftctrl`); - return false; - } - - if(!keyId) { - messagePlayerError(client, "That key name/id is invalid!"); + messagePlayerInfo(client, `For combos, use a plus sign between the keys. No spaces! Example: {ALTCOLOUR}rightctrl+num3{MAINCOLOUR}`); return false; } @@ -41,14 +38,12 @@ function addKeyBindCommand(command, params, client) { } addPlayerKeyBind(client, keyId, tempCommand, tempParams); - messagePlayerSuccess(client, `You binded the {ALTCOLOUR}${toUpperCase(getKeyNameFromId(keyId))} {MAINCOLOUR}key to command: {ALTCOLOUR}/${tempCommand} ${tempParams}`); + messagePlayerSuccess(client, `You binded the {ALTCOLOUR}${toUpperCase(keys.join(" + "))} {MAINCOLOUR}keys to command: {ALTCOLOUR}/${tempCommand} ${tempParams}`); } // =========================================================================== function removeKeyBindCommand(command, params, client) { - let splitParams = params.split(" "); - let keyId = getKeyIdFromParams(getParam(params, " ", 1)); if(!keyId) { @@ -75,6 +70,8 @@ function addPlayerKeyBind(client, keys, command, params, tempKey = false) { keyBindData.databaseId = -1; } + keyBindData.needsSaved = true; + getPlayerData(client).keyBinds.push(keyBindData); sendAddAccountKeyBindToClient(client, keys, (keys.length > 1) ? VRR_KEYSTATE_COMBO : VRR_KEYSTATE_UP); @@ -217,4 +214,29 @@ function showKeyBindListCommand(command, params, client) { } } +// =========================================================================== + +function getKeyNamesInComboName(comboName) { + if(comboName.indexOf("+") != -1) { + return comboName.split("+"); + } else { + return [comboName]; + } +} + +// =========================================================================== + +function getKeysInComboName(comboName) { + let keyNames = getKeyNamesInComboName(comboName); + let keys = []; + for(let i in keyNames) { + if(getKeyIdFromParams(keyNames[i])) { + keys.push(getKeyIdFromParams(keyNames[i])); + } else { + keys.push(false); + } + } + return keys +} + // =========================================================================== \ No newline at end of file From 406334555d13adf8989fc29c5c1267e662c83638 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Thu, 17 Mar 2022 08:05:41 -0500 Subject: [PATCH 041/177] Ped for net event util --- scripts/server/utilities.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/server/utilities.js b/scripts/server/utilities.js index e23bd23c..9959a901 100644 --- a/scripts/server/utilities.js +++ b/scripts/server/utilities.js @@ -464,4 +464,14 @@ function isClientInitialized(client) { return (typeof getServerData().clients[client.index] != "undefined"); } +// =========================================================================== + +function getPedForNetworkEvent(ped) { + if(getGame() == VRR_GAME_GTA_IV) { + return ped; + } else { + return ped.id; + } +} + // =========================================================================== \ No newline at end of file From a33c44544ff98aaf14e599d5b9a8003acef8df8a Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Thu, 17 Mar 2022 08:10:17 -0500 Subject: [PATCH 042/177] Add all command array util --- scripts/server/command.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/server/command.js b/scripts/server/command.js index da6d58bd..d9e87bdc 100644 --- a/scripts/server/command.js +++ b/scripts/server/command.js @@ -772,6 +772,19 @@ function listAllCommands() { // =========================================================================== +function getAllCommandsInSingleArray() { + let tempCommands = []; + for(let i in serverCommands) { + for(let j in serverCommands[i]) { + tempCommands.push(serverCommands[i][j]); + } + } + + return tempCommands; +} + +// =========================================================================== + function doesCommandExist(command) { if(getCommandData(command)) { return true; From 989097653be03f1577bcc65f1483d35c4bbf6603 Mon Sep 17 00:00:00 2001 From: Kasir ! <83297393+xKasir@users.noreply.github.com> Date: Fri, 18 Mar 2022 12:59:48 +0200 Subject: [PATCH 043/177] Update arabic.json --- locale/arabic.json | 694 ++++++++++++++++++++++----------------------- 1 file changed, 347 insertions(+), 347 deletions(-) diff --git a/locale/arabic.json b/locale/arabic.json index 461e9fcf..74944a52 100644 --- a/locale/arabic.json +++ b/locale/arabic.json @@ -1,399 +1,399 @@ { - "TranslationProvidedBy": "Name_Here", + "TranslationProvidedBy": "Kasir", "LocaleEnglishName": "Arabic", - "LocaleNativeName": "Arabic (Translate this to Arabic)", - "LocaleOffer": "This server is available in English. Use {1} to use it.", - "LocaleChanged1": "Your language is now set to {1}", - "LocaleChanged2": "The server will now display messages in {1}", - "LocaleChangedNote": "This does not change messages from other players", - "AccentsListHeader": "Accents", - "HeaderHelpMainList": "Help Categories", - "AccentNotFound": "Accent not found", - "AccentSet": "You set your accent to {1}", - "AnimationNotFound": "That animation doesn't exist", - "AnimationCommandTip": "Use {1} to see a list of valid animations", - "AnimationInvalidDistance": "The distance must be between 0 and 3", - "AnimationStopCommandTip": "Use {1} to stop your animation", - "CantBanClient": "You cannot ban this person", - "PlayerAccountBanned": "{1} has been account banned", - "ClanNotFound": "Clan not found", - "ClanNameTaken": "A clan with that name already exists", - "PlayerNotFound": "Player not found", - "ClanCantRemoveRanks": "You can't remove clan ranks", - "ClanCantAddRanks": "You can't add clan ranks", - "ClanRankNotFound": "Clan rank not found", - "ClanCantChangeMemberTag": "You can not change clan member's tags", - "ClanPlayerNotInSameClan": "That player is not in your clan", - "ClanCantChangeRankLevel": "You can not change clan rank's level", - "ClanCantChangeRankTag": "You can not change clan rank's tags", - "NameNotRegistered": "Your name is not registered! Use {1} to make an account.", - "AutomaticLoginIPToggle": "Automatic login by IP is now {1}", - "CouldNotRegisterAccount": "There was a problem creating your account. Please contact an admin.", - "RandomTipsToggle": "Random tips are now {1}", - "ActionTipsToggle": "Action tips are now {1}", - "AutoSpawnLastCharToggle": "Automatic spawn as last used character is {1}", - "AccountGUISettingToggle": "GUI is now {1}", - "On": "On", - "Off": "Off", - "Yes": "Yes", - "No": "No", - "True": "True", - "False": "False", - "Locked": "Locked", - "Unlocked": "Unlocked", - "PasswordNotGoodEnough": "The new password must meet the requirements!", - "PasswordNeedsBase": "Passwords must have at least {1}", - "PasswordNeedsCapitals": "{1} capital letters", - "PasswordNeedsNumbers": "{1} numbers", - "PasswordNeedsSymbols": "{1} symbols", - "PasswordsDontMatch": "The new password and confirm new password aren't the same!", - "PasswordChanged": "Your password has been changed!", - "AutoLoggedInIP": "You have been automatically logged in by IP!", - "WelcomeBack": "Welcome back to {1}, {2}! Please {3} to continue.", - "WelcomeNewPlayer": "Welcome to {1}, {2}! Please {3} to play.", - "InvalidPlayer": "Player not found!", - "InvalidBusiness": "Business not found!", - "InvalidHouse": "House not found!", - "InvalidVehicle": "Vehicle not found!", - "InvalidClan": "Clan not found!", - "InvalidClanRank": "Clan rank not found!", - "InvalidJob": "Job not found!", - "InvalidItem": "Item not found!", - "InvalidItemType": "Item type not found!", - "InvalidRadioStation": "Radio station not found!", - "InvalidGate": "Gate not found!", - "EntersProperty": "opens the door and enters the {1}", - "ExitsProperty": "opens the door and exits the {1}", - "EnterExitPropertyDoorLocked": "tries to open the {1} door but fails because it's locked", - "PropertyNoInterior": "This {1} does not have an interior, but you can still use commands at the door icon.", - "NoBusinessWithItemType": "There is no business with that item available", - "HeaderKeyBinds": "Key Binds", - "HeaderAccountHelp": "Account Help", - "HeaderVehicleHelp": "Vehicle Help", - "HeaderVehicleDealershipHelp": "Vehicle Dealership Help", - "HeaderJobHelp": "Job Help", - "HeaderChatHelp": "Chat Help", - "HeaderServerRules": "Server Rules", - "HeaderWebsiteInfo": "Website", - "HeaderDiscordInfo": "Discord", - "HeaderAnimationsList": "Animation List", - "HeaderPayAndSprayHelp": "Pay and Spray Help", - "HeaderAmmunationHelp": "Ammunation Help", - "HeaderVehicleTuneupHelp": "Vehicle Tune Help", - "HeaderBindableKeysHelp": "Bindable Keys", - "HeaderSkinHelp": "Clothes/Skin Help", - "HeaderBusinessHelp": "Business Help", - "HeaderClanHelp": "Clan Help", - "HeaderPlayerVehiclesList": "Player Vehicles ({1})", - "HeaderPlayerBusinessesList": "Player Businesses ({1})", - "HeaderClansList": "Clan List", - "HeaderAdminsList": "Admin List", - "HeaderBadgeInfo": "Badge Information", - "HeaderAccentsList": "Accent List", - "HeaderPlayerInfo": "Player Information ({1})", - "HeaderWealthandTaxHelp": "Wealth and Tax Information", - "HeaderCommandInfo": "Command Information ({1})", - "HeaderRadioHelp": "Radio Help", - "HeaderRadioStationsList": "Radio Stations", - "HeaderKeyBindsList": "Key Binds List", - "RadioVolumeChanged": "{1} You changed your streaming radio volume to {2}%", - "VolumeLevelNotNumber": "The volume level must be a number", - "RadioStationLocationInvalid": "You must be in a vehicle, house, or business or have a personal device to change the station!", - "ActionBusinessRadioStationChange": "changes the business radio station to {1} ({2})", - "ActionHouseRadioStationChange": "changes the house radio station to {1} ({2})", - "ActionVehicleRadioStationChange": "changes the vehicle radio station to {1} ({2})", - "ActionItemRadioStationChange": "changes the {1}'s station to {2} ({3})", - "RandomVehicleCommandsDisabled": "This is a random traffic vehicle and commands can't be used for it.", - "HouseDoorLock": "House {1} {2}!", - "BusinessDoorLock": "Business {1} {2}!", - "ServerGameModeRestarting": "The server game mode is restarting!", - "HeaderSelfItemList": "Your Inventory", - "HeaderPlayerItemList": "Player Inventory ({1})", - "HeaderHouseItemList": "House Inventory", - "HeaderBusinessFloorItemList": "Business Inventory (For Sale)", - "HeaderBusinessStorageItemList": "Business Inventory (Storage)", - "HeaderItemItemList": "{1}'s Inventory", - "ItemSlotNotNumber": "The item slot must be a number", + "LocaleNativeName": "عربى", + "LocaleOffer": ".الخادم متاح باللغة الإنجليزية.استخدم {1} لاستخدامه", + "LocaleChanged1": "لغتك الآن على {1}", + "LocaleChanged2": "سيعرض الخادم الآن الرسائل في {1}", + "LocaleChangedNote": "هذا لا يغير الرسائل من اللاعبين الآخرين", + "AccentsListHeader": "لهجآت", + "HeaderHelpMainList": "فئة الدعم", + "AccentNotFound": "اللكنة الحالية غير متوفرة", + "AccentSet": "قمت بتعيين لهجتك على {1}", + "AnimationNotFound": "هذه الرسوم المتحركة غير متوفرة", + "AnimationCommandTip": "استخدم {1} لمشاهدة قائمة الرسوم المتحركة المتاحة", + "AnimationInvalidDistance": "يجب المسافة تكون بين 0 و 3", + "AnimationStopCommandTip": "استخدم {1} لإيقاف الرسوم المتحركة", + "CantBanClient": "لا يمكنك حظر هذا الإعب", + "PlayerAccountBanned": "تم حظر حساب {1}", + "ClanNotFound": "لم يتم العثور على المجموعة", + "ClanNameTaken": "توجد مجموعة بهذا الاسم بالفعل", + "PlayerNotFound": "الاعب غير موجود", + "ClanCantRemoveRanks": "لا يمكنك إزالة رتب المجموعة", + "ClanCantAddRanks": "لأ يمكنك إضافة رتب", + "ClanRankNotFound": "رتبة غير موجودهـ", + "ClanCantChangeMemberTag": "ليس لديك الصلاحيات لتعديل على علامات رتب الاعضاء", + "ClanPlayerNotInSameClan": "الاعب غير موجود بمجموعتك", + "ClanCantChangeRankLevel": "ليس لديك صلاحيات لتغيير مستوى رتبة المجموعة", + "ClanCantChangeRankTag": "لا يمكنك تغيير علامات رتب المجموعة", + "NameNotRegistered": "اسمك غير مسجل! استخدم {1} لإنشاء حساب.", + "AutomaticLoginIPToggle": "IP تم تفعيل {1} تسجيل الدخول التلقائي عن طربق", + "CouldNotRegisterAccount": "حدثت مشكلة في إنشاء حسابك, يرجى التواصل بـ إلاداره.", + "RandomTipsToggle": "النصائح العشوائية{1}", + "ActionTipsToggle": "نصائح العمل{1}", + "AutoSpawnLastCharToggle": "النشر التلقائي كأخر حرف تم استخدامه هو {1}", + "AccountGUISettingToggle": "واجهة المستخدم الرسومية هي الآن {1}", + "On": "تشغيل", + "Off": "إيقاف", + "Yes": "موافق", + "No": "لا", + "True": "صحيح", + "False": "خطأ", + "Locked": "مغلق", + "Unlocked": "مفتوح", + "PasswordNotGoodEnough": "كلمة المرور الجديدة يجب أن تفي بالمتطلبات!", + "PasswordNeedsBase": " {1} يجب أن تحتوي كلمات المرور على الأقل", + "PasswordNeedsCapitals": "{1}من الأحرف الكبيرة", + "PasswordNeedsNumbers": "{1} أرقام", + "PasswordNeedsSymbols": "{1} حروف او رموز", + "PasswordsDontMatch": "كلمة المرور الجديدة وتأكيد كلمة المرور الجديدة ليسا متطابقين!!", + "PasswordChanged": "تم بنجاح تغيير كلمة المرور!", + "AutoLoggedInIP": "IP تم تسجيل دخولك تلقائيًا بواسطة!", + "WelcomeBack": "مرحبًا بك مرة أخرى في {1} ، {2}! من فضلك {3} للمتابعة.", + "WelcomeNewPlayer": "مرحبًا بك في {1} ، {2}! من فضلك {3} للعب.", + "InvalidPlayer": "اللاعب غير موجود!", + "InvalidBusiness": "لم يتم العثور على الأعمال!", + "InvalidHouse": "البيت غير موجود!", + "InvalidVehicle": "لم يتم ايجاد السيارة!", + "InvalidClan": "لم يتم العثور على المجموعة!", + "InvalidClanRank": "رتبة غير موجوده!", + "InvalidJob": "لم يتم العثور على الوظيفة!", + "InvalidItem": "العنصر غير موجود!", + "InvalidItemType": "نوع العنصر غير موجود!", + "InvalidRadioStation": "لم يتم العثور على محطة راديو!", + "InvalidGate": "البوابة غير موجودة!", + "EntersProperty": "يفتح الباب ويدخل {1}", + "ExitsProperty": "يفتح الباب ويخرج من {1}", + "EnterExitPropertyDoorLocked": "يحاول فتح الباب {1} ولكنه يفشل لأنه مغلق", + "PropertyNoInterior": "هذا ليس له جزء داخلي {1}، ولكن لا يزال بإمكانك استخدام الأوامر على أيقونة الباب.", + "NoBusinessWithItemType": "لا يوجد عمل مع هذا الخيار متاح", + "HeaderKeyBinds": "مفتاح الروابط", + "HeaderAccountHelp": "مساعدة الحساب", + "HeaderVehicleHelp": "تعليمات السيارة", + "HeaderVehicleDealershipHelp": "مساعدة بيع سيارات", + "HeaderJobHelp": "تعليمات الوظيفة", + "HeaderChatHelp": "تعليمات الدردشة", + "HeaderServerRules": "قوانين سيرفر", + "HeaderWebsiteInfo": "الموقع الرسمي", + "HeaderDiscordInfo": "ديسكورد", + "HeaderAnimationsList": "قائمة الرسوم المتحركة", + "HeaderPayAndSprayHelp": "الدفع ,ورشٌ المساعده", + "HeaderAmmunationHelp": "مساعدة الذخيرة", + "HeaderVehicleTuneupHelp": "مساعدة تعديل السيارة", + "HeaderBindableKeysHelp": "مفاتيح قابلة للربط", + "HeaderSkinHelp": "مساعدة الملابس / الجلد", + "HeaderBusinessHelp": "تعليمات الأعمال", + "HeaderClanHelp": "تعليمات المجموعة", + "HeaderPlayerVehiclesList": "مركبات المشغل ({1})", + "HeaderPlayerBusinessesList": "أعمال اللاعب ({1})", + "HeaderClansList": "قائمة المجموعة", + "HeaderAdminsList": "قائمة الادمن", + "HeaderBadgeInfo": "معلومات الشاره", + "HeaderAccentsList": "قائمة اللغة", + "HeaderPlayerInfo": "معلومات الاعب", + "HeaderWealthandTaxHelp": "معلومات المال", + "HeaderCommandInfo": "معلومات الإوامر ({1})", + "HeaderRadioHelp": "تعليمات راديو", + "HeaderRadioStationsList": "محطات الردايو", + "HeaderKeyBindsList": "قائمة روابط المفاتيح", + "RadioVolumeChanged": "{1} لقد {2} غيرت مستوى صوت البث اللاسلكى إلى٪", + "VolumeLevelNotNumber": "يجب أن يكون مستوى الصوت رقمًا", + "RadioStationLocationInvalid": "يجب أن تكون في سيارة أو منزل أو عمل أو لديك جهاز شخصي لتغيير المحطة!", + "ActionBusinessRadioStationChange": "تغيير محطة راديو الأعمال إلى {1} ({2})", + "ActionHouseRadioStationChange": "تغيير محطة راديو المنزل إلى {1} ({2})", + "ActionVehicleRadioStationChange": "يغير محطة راديو السيارة إلى {1} ({2})", + "ActionItemRadioStationChange": "يغير محطة {1} إلى {2} ({3})", + "RandomVehicleCommandsDisabled": "هذه مركبة مرور عشوائية ولا يمكن استخدام الأوامر لها.", + "HouseDoorLock": "البيت {1} {2}!", + "BusinessDoorLock": "الأعمال {1} {2}!", + "ServerGameModeRestarting": "يتم إعادة تشغيل وضع لعبة الخادم!", + "HeaderSelfItemList": "المخزون الخاص بك", + "HeaderPlayerItemList": "مخزون الاعب ({1})", + "HeaderHouseItemList": "بيت الاعب", + "HeaderBusinessFloorItemList": "جرد الأعمال (للبيع)", + "HeaderBusinessStorageItemList": "جرد الأعمال (التخزين)", + "HeaderItemItemList": "مخزون {1}", + "ItemSlotNotNumber": "يجب أن تكون خانة العنصر رقمًا", "ItemSlotMustBeBetween": "The item slot must be between {1} and {2}!", - "UseItemBugged": "The item you're trying to use is bugged. A bug report has been sent to the server developers.", - "PickupItemBugged": "The item you're trying to pickup is bugged. A bug report has been sent to the server developers.", - "DropItemBugged": "The item you're trying to drop is bugged. A bug report has been sent to the server developers.", - "HandsBusy": "Your hands are busy", - "CantUseItemInSkinChange": "You can't use an item while customizing your appearance", - "CantDropItemInSkinChange": "You can't drop an item while customizing your appearance", - "CantPickupItemInSkinChange": "You can't pickup an item while customizing your appearance", - "CantSwitchItemInSkinChange": "You can't switch an item while customizing your appearance", - "CantGiveItemInSkinChange": "You can't give an item while customizing your appearance", - "CantTakeItemInSkinChange": "You can't take an item while customizing your appearance", - "ItemUnequippableNoAmmo": "The {1} in slot {2} has no ammo, and can't be equipped!", - "NoSpaceSelfInventory": "You don't have any more space in your inventory", - "Business": "business", - "House": "house", - "Clan": "clan", - "Vehicle": "vehicle", - "Item": "item", - "ItemType": "item type", - "Gate": "gate", - "Door": "door", - "ClanRank": "clan rank", - "JobRank": "job rank", - "RadioStation": "radio station", + "UseItemBugged": "العنصر الذي تحاول استخدامه به التنصت. تم إرسال تقرير خطأ إلى مطوري الخادم.", + "PickupItemBugged": "العنصر الذي تحاول استلامه به التنصت. تم إرسال تقرير خطأ إلى مطوري الخادم.", + "DropItemBugged": "تم التنصت على العنصر الذي تحاول إسقاطه. تم إرسال تقرير خطأ إلى مطوري الخادم.", + "HandsBusy": "يديك مشغولتان", + "CantUseItemInSkinChange": "لا يمكنك استخدام عنصر أثناء تخصيص مظهرك", + "CantDropItemInSkinChange": "لا يمكنك إسقاط عنصر أثناء تخصيص مظهرك", + "CantPickupItemInSkinChange": "لا يمكنك التقاط عنصر أثناء تخصيص مظهرك", + "CantSwitchItemInSkinChange": "لا يمكنك تبديل عنصر أثناء تخصيص مظهرك", + "CantGiveItemInSkinChange": "لا يمكنك إعطاء عنصر أثناء تخصيص مظهرك", + "CantTakeItemInSkinChange": "لا يمكنك أن تأخذ عنصرًا أثناء تخصيص مظهرك", + "ItemUnequippableNoAmmo": "لا تحتوي الفتحة {1} الموجودة في الفتحة {2} على ذخيرة ، ولا يمكن تجهيزها!", + "NoSpaceSelfInventory": "ليس لديك أي مساحة إضافية في مخزونك", + "Business": "الاعمال", + "House": "البيت", + "Clan": "المجموعة", + "Vehicle": "السيارة", + "Item": "الاغراض", + "ItemType": "نوع العنصر", + "Gate": "بوابة", + "Door": "باب", + "ClanRank": "رتبة المجموعة", + "JobRank": "رتبة الوظيفة", + "RadioStation": "المحطة الإذاعية", "Months": [ - "January", - "February", - "March", - "April", - "May", - "June", - "July", - "August", - "September", - "October", - "November", - "December" + "يناير", + "فبراير", + "مارس", + "أبريل", + "مايو", + "يونيو", + "يوليو", + "أغسطس", + "سبتمبر", + "أكتوبر", + "نوفمبر", + "ديسمبر" ], "WeekDays": [ - "Sunday", - "Monday", - "Tuesday", - "Wednesday", - "Thursday", - "Friday", - "Saturday" - ], + "الأحد", + "الإثنين", + "الثلاثاء", + "الاربعاء", + "الخميس", + "الجمعه", + "السبت" + ], "CardinalDirections": [ - "North", - "Northeast", - "East", - "Southeast", - "South", - "Southwest", - "West", - "Northwest" + "شمال", + "الشمال الشرقي", + "شرق", + "الجنوب الشرقي", + "جنوب", + "جنوب غرب", + "غرب", + "الشمال الغربي" ], "NewPlayerReadyToPlay": [ - "You have been given some cash. Use {1} to find places to buy items.", - "If you need money, jobs are the yellow dots on the radar.", - "For a car, visit the car dealership. You can also use a rental vehicle near spawn or take the train", - "Be sure to read the {1} and use {2} for info." + "لقد حصلت على بعض من المال. استخدم {1} للبحث عن أماكن لشراء العناصر.", + "إذا كنت بحاجة إلى المال،الوظائف هي النقاط الصفراء على الخريطة.", + "للحصول على سيارة ، قم بزيارة وكالة السيارات. يمكنك أيضًا استخدام سيارة مستأجرة بالقرب من السباون أو ركوب القطار", + "تأكد من قراءة {1} واستخدم {2} للحصول على معلومات." ], - "YourCurrentVehicleDeleted": "The vehicle you were in was deleted.", - "Distance": "Distance", - "Meters": "Meters", - "Feet": "Feet", - "Kilometers": "Kilometers", - "Miles": "Miles", - "MustBeVehicleDriver": "You must be the driver of the vehicle!", - "PlayerJoinedServer": "{1} has joined the game from {1}!", - "PlayerLeftServer": "{1} has left the game! ({1})", + "YourCurrentVehicleDeleted": "تم حذف السيارة التي كنت بداخلها.", + "Distance": "مسافة", + "Meters": "أمتار", + "Feet": "قدم", + "Kilometers": "كيلومترات", + "Miles": "اميال", + "MustBeVehicleDriver": "يجب أن تكون سائق السيارة!", + "PlayerJoinedServer": "انضم إلى اللعبة من {1}!", + "PlayerLeftServer": "غادر {1} اللعبة! ({1})", "DisconnectReasons": [ - "Lost Connection", - "Disconnected", - "Unsupported Client", - "Wrong Game", - "Incorrect Password", - "Unsupported Executable", - "Disconnected", - "Banned", - "Failed", - "Invalid Name", - "Crashed" + "انقطع الإتصال", + "انقطع الاتصال", + "عميل غير مدعوم", + "تحذير للعبة", + "كلمة سر غير صحيحه", + "قابل للتنفيذ غير معتمد", + "انقطع الاتصال", + "حظر", + "فشل", + "اسم غير صالح", + "خطأ" ], - "TakeItemFromHouse": "takes a {1} from the house", - "TakeItemFromBusinessStorage": "takes a {1} from the business storage", - "TakeItemFromBusiness": "takes a {1} from the business", - "TakeItemFromItem": "takes a {1} from the {2}", - "TakeItemFromVehicleTrunk": "takes a {1} from the trunk", - "TakeItemFromVehicleDash": "takes a {1} from the glove compartment", - "JobEquipmentInventoryKeyBindTip": "The job equipment is in your inventory. Press {1} to see them.", - "JobEquipmentInventoryCommandTip": "The job equipment is in your inventory. Use {1} to see them.", + "TakeItemFromHouse": "يأخذ {1} من المنزل", + "TakeItemFromBusinessStorage": "يأخذ {1} من تخزين الشركة", + "TakeItemFromBusiness": "يأخذ {1} من الأعمال", + "TakeItemFromItem": "يأخذ {1} من {2}", + "TakeItemFromVehicleTrunk": "يأخذ {1} من صندوق السيارة", + "TakeItemFromVehicleDash": "يأخذ {1} من صندوق القفازات", + "JobEquipmentInventoryKeyBindTip": "معدات العمل في مخزونك. اضغط على {1} لمشاهدتها.", + "JobEquipmentInventoryCommandTip": "معدات العمل في مخزونك. استخدم {1} لمشاهدتها.", "AccountHelp": [ - "Do NOT share your password with anybody else. {1} staff will never ask you for your password", - "Use {1} to change your password, and {2} if you forgot it", - "Some settings you can use: {1}" + "لا تشارك كلمة مرورك مع أي شخص آخر. لن يطالبك فريق عمل {1} بكلمة المرور مطلقًا", + "استخدم {1} لتغيير كلمة المرور الخاصة بك ، و {2} إذا نسيتها", + "بعض الإعدادات التي يمكنك استخدامها: {1}" ], "VehicleHelp": [ - "Your personal vehicles will save wherever you or somebody else leaves them!", - "Visit dealerships to buy new vehicles (Use {1} for more information)", + "ستوفر مركباتك الشخصية أينما تتركها أنت أو أي شخص آخر!", + "قم بزيارة المعرض لشراء مركبات جديدة (استخدم {1} لمزيد من المعلومات)", "Some commands: {1}", - "Visit a mechanic garage to repair, colour, and tune up your car! {1} for info" + "قم بزيارة مرآب ميكانيكي لإصلاح وتلوين وضبط سيارتك! {1} للحصول على معلومات" ], "VehicleDealershipHelp": [ - "Visit a vehicle dealer to buy new vehicles. Use {1} to find one.", - "At the dealer, enter a car you want to buy, and the price will be shown to you", - "If you want to buy the vehicle, use {1} and you will be given keys to test drive it around the parking lot.", - "Drive away from the dealership with the new vehicle to confirm the purchase." + "قم بزيارة تاجر سيارات لشراء مركبات جديدة. استخدم {1} للعثور على واحد.", + "عند التاجر ، أدخل السيارة التي تريد شراءها ، وسيظهر لك السعر", + "إذا كنت ترغب في شراء السيارة ، فاستخدم {1} وستحصل على مفاتيح لاختبار قيادتها حول ساحة الانتظار.", + "ابتعد عن الوكالة مع السيارة الجديدة لتأكيد الشراء." ], "JobHelp": [ - "Visit job locations to get a job and earn money. Look for yellow spots on the map", - "At a job location, use {1} to get the job. Use {2} to quit your job", - "Use {1} to begin working. You can also get a job {2} and {3}", - "Most job vehicles are locked. Use {1} near one to enter it.", - "When entering a job vehicle, information on how to do the job will be shown to you." + "قم بزيارة مواقع العمل للحصول على وظيفة وكسب المال. ابحث عن علامات الصفراء على الخريطة", + "في موقع العمل ، استخدم {1} للحصول على الوظيفة. استخدم {2} لإنهاء عملك", + "استخدم {1} لبدء العمل. يمكنك أيضًا الحصول على وظيفة {2} و {3}", + "يتم تأمين معظم مركبات العمل. استخدم {1} بالقرب من واحد للدخول إليه.", + "عند دخول مركبة عمل ، ستظهر لك معلومات حول كيفية القيام بالمهمة." ], "ChatHelp": [ - "There are two main types of chat: out-of-character (OOC) and in-character (IC)", - "Mixing these two types is not proper roleplay. See {1} for info.", - "Some chat commands: {1}", - "Some have shorter names available ({1} to talk, {2} to shout, etc)" + "(IC)والشخصية(OOC)هناك نوعان رئيسيان من الدردشة: خارج الطابع الشخصي", + "الخلط بين هذين النوعين ليس لعب الأدوار المناسب. راجع {1} للحصول على معلومات.", + "بعض أوامر الدردشة: {1}", + "يتوفر لبعضها أسماء أقصر ({1} للتحدث ، {2} للصراخ ، إلخ)" ], "ServerRulesHelp": [ - "Unrealistic actions (powergaming) are not allowed. You aren't superman.", - "No terrorist or terrorism roleplay is allowed.", - "Always follow instructions given by moderators and admins.", - "Do not mix the chats (metagaming). You can't use info in IC that was received OOC", - "Keep English in main chats. If you aren't good at English, use {1}" + ".غير مسموح بها.انت لست سوبر مان(powergaming)الإجراءات غير الواقعية", + "لا يسمح بأدوار إرهابية", + "اتبع دائمًا التعليمات التي قدمها المشرفون والاداره", + "لا تخلط الدردشات (metagaming). لا يمكنك استخدام المعلومات في IC التي تم استلامها OOC", + "حافظ على اللغة الإنجليزية في الدردشات الرئيسية. إذا لم تكن جيدًا في اللغة الإنجليزية ، فاستخدم {1}" ], "AnimationHelp": [ - "Animations allow you to enhance roleplay with visual actions", - "Use {1} or {2} with a name to use an animation.", - "To see a list of animations, use {1}" + "تتيح لك الرسوم المتحركة تحسين لعب الأدوار من خلال الإجراءات المرئية", + "استخدم {1} أو {2} مع اسم لاستخدام الرسم المتحرك.", + "لمشاهدة قائمة الرسوم المتحركة ، استخدم {1}" ], "WeaponHelp": [ - "Visit an gun store to buy weapons. Use {1} to find one.", - "Buying a weapon requires a weapon license.", - "Weapon licenses are managed by the police department. Apply there to get one.", - "Weapons can also be purchased illegally from some businesses, weapon dealers, and clans." + "قم بزيارة متجر أسلحة لشراء أسلحة. استخدم {1} للعثور على واحد.", + "شراء سلاح يتطلب رخصة سلاح.", + "يتم إدارة تراخيص الأسلحة من قبل قسم الشرطة. قدم طلبًا للحصول على واحدة "., + "يمكن أيضًا شراء الأسلحة بشكل غير قانوني من بعض الشركات وتجار الأسلحة والعصابات." ], "SkinHelp": [ - "At a clothing store, use {1} to purchase clothes", - "When you have a clothing item, equip and use it like any other item to show the skin selection (check {1} to learn how to use items)", + "في متجر الملابس ، استخدم {1} لشراء الملابس", + "عندما يكون لديك عنصر من الملابس ، قم بتجهيزه واستخدامه مثل أي عنصر آخر لإظهار اختيار الجلد (حدد {1} لمعرفة كيفية استخدام العناصر)", "Some skins are restricted to jobs, clans, or for other reasons." ], "KeyBindHelp": [ - "You can set your own key binds. Use {1} to see your binded keys.", - "Use {1} to add a new keybind and {2} to remove one.", - "Default keys are: {1} for vehicle engine, {1} for lights, and {3} for lock/unlock", - "Press {1} to see your items and {2} to equip an item or {3} to unequip all.", - "Press {1} to use the item you're holding, press {2} to drop it, or press {3} to pickup an item from the ground." + "يمكنك تعيين روابط المفاتيح الخاصة بك. استخدم {1} لرؤية المفاتيح التي تم ربطها.", + "استخدم {1} لإضافة رابط مفتاح جديد و {2} لإزالة واحد.", + "المفاتيح الافتراضية هي: {1} لمحرك السيارة و {1} للأضواء و {3} للقفل / فتح القفل", + "اضغط على {1} لمشاهدة عناصرك و {2} لتجهيز عنصر أو {3} لإلغاء تجهيز الكل.", + "اضغط على {1} لاستخدام العنصر الذي تمسكه ، أو اضغط على {2} لإسقاطه ، أو اضغط على {3} لالتقاط عنصر من الأرض." ], "BusinessHelp": [ - "Use {1} to purchase items or {2} to see a list of what's for sale at any business", - "Businesses are shown with blue names above the icon at their entrance.", - "Business owner commands: {1}", - "A new car for sale will appear when you drive away from the dealer." + "استخدم {1} لشراء العناصر أو {2} لمشاهدة قائمة بما هو معروض للبيع في أي شركة", + "تظهر الشركات بأسماء زرقاء فوق الرمز عند مدخلها.", + "أوامر صاحب العمل: {1}", + "ستظهر سيارة جديدة معروضة للبيع عندما تبتعد عن الوكيل." ], "ClanHelp": [ - "Ask an administrator to create a clan (Similar to factions/groups/families)", - "Clan owners have full control over their clan once it's created", - "Clan commands: {1}", - "More clan commands: {1}" + "اطلب من الإدارة إنشاء تيم(القبيلة) (على غرار الفصائل / المجموعات / العائلات)", + "يتمتع مالكو التيم(القبيلة) بالسيطرة الكاملة على افراد المجموعة بمجرد إنشائها", + "أوامر القبيلة: {1}", + "أوامر القبيلة: {1}" ], "RadioStationHelp": [ - "Use {1} to set the station for your vehicle, house, or business", - "Use {2} to see a list of stations", - "You can change your radio streaming volume using {1} with 0-100 as the percent" + "استخدم {1} لتعيين المحطة لمركبتك أو منزلك أو عملك", + "استخدم {2} لمشاهدة قائمة المحطات", + "يمكنك تغيير حجم تدفق الراديو باستخدام {1} مع 0-100 كنسبة مئوية" ], "WealthAndTaxHelp": [ - "Your taxes on payday are {1} percent of your calculated wealth.", - "Your calculated wealth is a total sum based on how many vehicles, houses, and businesses you have.", - "Each vehicle is {1}, each house is {2}, and each business is {3}", - "Use {1} to see your current wealth, and {2} to see how much you'll pay in tax each payday" + "ضرائبك في يوم الدفع هي {1} بالمائة من ثروتك المحسوبة.", + "ثروتك المحسوبة هي مجموع إجمالي يعتمد على عدد المركبات والمنازل والشركات التي لديك.", + "كل سيارة {1} ، كل منزل {2} ، وكل عمل {3}", + "استخدم {1} لمعرفة ثروتك الحالية ، و {2} لمعرفة المبلغ الذي ستدفعه كضريبة في كل يوم دفع" ], - "MustBeInAVehicle": "You need to be in a vehicle!", - "MustBeInOrNearVehicle": "You need to be in or near a vehicle!", - "MustBeInVehicleFrontSeat": "You need to be in the vehicle front seats!", - "MustBeInVehicleDriverSeat": "You need to be the driver!", - "DontHaveVehicleKey": "You don't have a key for this vehicle!", - "NoGateAccess": "You don't have access to this gate!", - "GateBroken": "This gate is broken!", - "GateHacked": "The gate does not respond!", - "RadioJammed": "You hear only static from the radio.", - "VehicleNotForSale": "This vehicle is not for sale!", - "VehicleNotForRent": "This vehicle is not for rent!", - "BusinessNotForSale": "This business is not for sale!", - "BusinessNotForRent": "This business is not for rent!", - "HouseNotForSale": "This house is not for sale!", - "HouseNotForRent": "This house is not for rent!", - "DealershipPurchaseTestDrive": "Drive the vehicle away from the dealership to buy it, or get out to cancel.", - "DealershipPurchaseExitedVehicle": "You canceled the vehicle purchase by exiting the vehicle!", - "VehiclePurchaseComplete": "This vehicle is now yours! It will save wherever you leave it.", - "VehiclePurchaseNotEnoughMoney": "You don't have enough money to buy this vehicle!", - "HousePurchaseNotEnoughMoney": "You don't have enough money to buy this house!", - "BusinessPurchaseNotEnoughMoney": "You don't have enough money to buy this business!", + "MustBeInAVehicle": "يجب أن تكون في مركبة!", + "MustBeInOrNearVehicle": "أنت بحاجة إلى أن تكون في السيارة أو بالقرب منها!", + "MustBeInVehicleFrontSeat": "يجب أن تكون في المقاعد الأمامية للسيارة!", + "MustBeInVehicleDriverSeat": "يجب أن تكون السائق!", + "DontHaveVehicleKey": "ليس لديك مفتاح لهذه السيارة!", + "NoGateAccess": "لا يمكنك الوصول إلى هذه البوابة!", + "GateBroken": "هذه البوابة مكسورة!", + "GateHacked": "البوابة لا تستجيب!", + "RadioJammed": "تسمع صوتًا ثابتًا فقط من الراديو.", + "VehicleNotForSale": "هذه السيارة ليست للبيع!", + "VehicleNotForRent": "هذه السيارة ليست للإيجار!", + "BusinessNotForSale": "هذا العمل ليس للبيع!", + "BusinessNotForRent": "هذا العمل ليس للإيجار!", + "HouseNotForSale": "هذا المنزل ليس للبيع!", + "HouseNotForRent": "هذا المنزل ليس للإيجار!", + "DealershipPurchaseTestDrive": "قم بقيادة السيارة بعيدًا عن الوكالة لشرائها ، أو اخرج للإلغاء.", + "DealershipPurchaseExitedVehicle": "لقد ألغيت شراء السيارة بالخروج من السيارة!", + "VehiclePurchaseComplete": "هذه السيارة الآن لك!", + "VehiclePurchaseNotEnoughMoney": "ليس لديك ما يكفي من المال لشراء هذه السيارة!", + "HousePurchaseNotEnoughMoney": "ليس لديك ما يكفي من المال لشراء هذا المنزل!", + "BusinessPurchaseNotEnoughMoney": "ليس لديك ما يكفي من المال لشراء هذا العمل!", "Locales": { - "English": "English", - "Russian": "Russian", - "Spanish": "Spanish", - "German": "German", - "Dutch": "Dutch", - "Polish": "Polish" + "English": "انجلزي", + "Russian": "روسي", + "Spanish": "الإسبانية", + "German": "الإلمانية", + "Dutch": "الهولندية", + "Polish": "البولندية" }, "ADDED-21JAN2022": "DO NOT TRANSLATE. This string is just a comment to separate newly added translations.", - "HeaderPlayerHousesList": "Player Houses ({1})", - "HeaderPlayerStaffFlagsList": "Player Staff Flags ({1})", - "HeaderStaffFlagsList": "Staff Flags", - "NonRPName": "Non-RP name! Choose a new one:", - "InvalidStaffFlag": "Staff flag not found!", - "InvalidClanFlag": "Clan flag not found!", - "InvalidLocale": "Language not found!", - "HeaderJobUniformList": "Job Uniforms ({1})", - "HeaderJobEquipmentList": "Job Equipment ({1})", - "InvalidJobUniform": "Job uniform not found!", - "InvalidJobEquipment": "Job equipment not found!", - "HeaderVehiclesInRangeList": "Vehicles within {1}", - "NoVehiclesWithInRange": "There are no vehicles within {1}", - "AmountNotNumber": "The amount must be a number!", - "NeedToBeWorking": "You need to be working! Use {1} at a job location or near a job vehicle.", - "NeedToBeOnJobRoute": "You need to be doing a job route! Use {1} in a job vehicle", - "CurrentJobRouteDeleted": "The job route you were on has been deleted by an admin", - "CurrentJobRouteVehicleColoursChanged": "Your job route's vehicle colours were changed by an admin", - "NotYourJob": "This is not your job!", - "JobPoints": "You can get a job by going the yellow points on the map.", - "QuitJobToTakeAnother": "If you want this job, use {1} to quit your current job.", - "NotAJobVehicle": "This is not a job vehicle!", - "NotYourJobVehicle": "This is not your job's vehicle!", - "JobRouteDisabled": "The job route you were on has been disabled by an admin", - "HeaderPickupTypes": "Pickup Types", - "HeaderBlipTypes": "Map Icon Types", - "InvalidGPSLocation": "There are no locations with that name or type", - "HeaderBusinessList": "Businesses", - "VehicleForSale": "This {1} is buyable for {2}! Use {3} if you want to buy it", - "VehicleForRent": "This {1} is rentable for {2}! Use {3} if you want to rent it", + "HeaderPlayerHousesList": "بيوت اللاعبين ({1})", + "HeaderPlayerStaffFlagsList": "أعلام طاقم العمل ({1})", + "HeaderStaffFlagsList": "أعلام الموظفين", + "NonRPName": "اسم غير RP! اختر واحدة جديدة:", + "InvalidStaffFlag": "لم يتم العثور على علم الموظفين!", + "InvalidClanFlag": "علم القبيلة غير موجود!", + "InvalidLocale": "اللغة غير موجودة!", + "HeaderJobUniformList": "زي العمل ({1})", + "HeaderJobEquipmentList": "معدات العمل ({1})", + "InvalidJobUniform": "زي العمل غير موجود!", + "InvalidJobEquipment": "لم يتم العثور على معدات العمل!", + "HeaderVehiclesInRangeList": "مركبات داخل {1}", + "NoVehiclesWithInRange": "لا توجد مركبات داخل {1}", + "AmountNotNumber": "المبلغ يجب أن يكون رقما!", + "NeedToBeWorking": "يجب أن تعمل! استخدم {1} في موقع العمل أو بالقرب من سيارات العمل.", + "NeedToBeOnJobRoute": "عليك أن تفعل طريق عمل! استخدم {1} في مركبة عمل", + "CurrentJobRouteDeleted": "تم حذف مسار العمل الذي كنت تعمل فيه بواسطة الإدمن", + "CurrentJobRouteVehicleColoursChanged": "تم تغيير ألوان السيارة لمسار وظيفتك بواسطة الإدمن", + "NotYourJob": "هذه ليست وظيفتك!", + "JobPoints": "يمكنك الحصول على وظيفة من خلال الذهاب إلى النقاط الصفراء على الخريطة.", + "QuitJobToTakeAnother": "إذا كنت تريد هذه الوظيفة ، فاستخدم {1} لإنهاء وظيفتك الحالية.", + "NotAJobVehicle": "هذه ليست وسيلة عمل!", + "NotYourJobVehicle": "هذه ليست مركبة عملك!", + "JobRouteDisabled": "تم تعطيل مسار العمل الذي كنت تسلكه بواسطة أحد الإداريين", + "HeaderPickupTypes": "أنواع الالتقاط", + "HeaderBlipTypes": "أنواع أيقونات الخريطة", + "InvalidGPSLocation": "لا توجد مواقع بهذا الاسم أو النوع", + "HeaderBusinessList": "الأعمال", + "VehicleForSale": "يمكن شراء {1} مقابل {2}! استخدم {3} إذا كنت ترغب في شرائه", + "VehicleForRent": "هذا {1} قابل للتأجير لـ {2}! استخدم {3} إذا كنت تريد استئجاره", "ADDED-31JAN2022": "DO NOT TRANSLATE. This string is just a comment to separate newly added translations.", - "LoginFailedInvalidPassword": "Invalid password! {1} attempts remaining", - "LoginFailedNoPassword": "You must enter a password! ! {1} attempts remaining", - "RegistrationFailedNoPassword": "You must enter a password!", - "RegistrationFailedNoPasswordConfirm": "You must confirm the password!", - "RegistrationFailedNoEmail": "You must enter an email!", - "AccountNameAlreadyRegistered": "Your name is already registered!", - "AlreadyLoggedIn": "You are already logged in!", - "RegistrationFailedInvalidEmail": "That email is invalid!", - "RegistrationFailedPasswordMismatch": "The passwords don't match!", - "RegistrationFailedCreateError": "Your account couldn't be created!", - "RegistrationSuccess": "Your account has been created!", - "RegistrationEmailVerifyReminder": "Don't forget to verify your email! A verification code has been sent to you.", - "RegistrationCreateCharReminder": "To play on the server, you will need to make a character.", - "NoCharactersGUIMessage": "You have no characters. Would you like to make one?", - "NoCharactersGUIWindowTitle": "No characters", - "NoCharactersChatMessage": "You have no characters. Use {1} to make one.", - "NeedEmailFor2FA": "You need to add your email to your account to use two-factor authentication.", - "NeedEmailVerifiedFor2FA": "You need to verify your email to use two-factor authentication.", - "SetEmailHelpTip": "Use {1} to set your email.", - "VerifyEmailHelpTip": "Use {1} to verify your email.", + "LoginFailedInvalidPassword": "رمز مرور خاطئ! عدد المحاولات المتبقية: {1}", + "LoginFailedNoPassword": "يجب عليك إدخال كلمة المرور! ! عدد المحاولات المتبقية: {1}", + "RegistrationFailedNoPassword": "يجب عليك إدخال كلمة المرور!", + "RegistrationFailedNoPasswordConfirm": "يجب عليك تأكيد كلمة المرور!", + "RegistrationFailedNoEmail": "يجب إدخال البريد الإلكتروني!", + "AccountNameAlreadyRegistered": "تم تسجيل اسمك بالفعل!", + "AlreadyLoggedIn": "انت بالفعل بداخل!", + "RegistrationFailedInvalidEmail": "هذا البريد الإلكتروني غير صالح!", + "RegistrationFailedPasswordMismatch": "كلمات المرور غير متطابقة!", + "RegistrationFailedCreateError": "تعذر إنشاء حسابك!", + "RegistrationSuccess": "لقد تم إنشاء حسابك!", + "RegistrationEmailVerifyReminder": "لا تنس التحقق من بريدك الإلكتروني! تم إرسال رمز التحقق لك.", + "RegistrationCreateCharReminder": "للعب على الخادم ، ستحتاج إلى تكوين شخصية.", + "NoCharactersGUIMessage": "ليس لديك أحرف. هل ترغب في صنع واحدة؟", + "NoCharactersGUIWindowTitle": "لا أحرف", + "NoCharactersChatMessage": "ليس لديك أحرف. استخدم {1} لإنشاء واحدة.", + "NeedEmailFor2FA": "تحتاج إلى إضافة بريدك الإلكتروني إلى حسابك لاستخدام المصادقة ذات العاملين.", + "NeedEmailVerifiedFor2FA": "تحتاج إلى التحقق من بريدك الإلكتروني لاستخدام المصادقة ذات العاملين.", + "SetEmailHelpTip": "استخدم {1} لتعيين بريدك الإلكتروني.", + "VerifyEmailHelpTip": "استخدم {1} للتحقق من بريدك الإلكتروني.", "ADDED-13FEB2022": "DO NOT TRANSLATE. This string is just a comment to separate newly added translations.", - "NearbyRadio": "Nearby radio", - "FromRadio": "From radio", - "ToRadio": "To radio", - "NeedToEnterPropertyCommand": "You need to enter the {1} first! Use {2} to enter and exit", - "NeedToEnterPropertyKeyPress": "You need to enter the {1} first! Press {2} to enter and exit", - "InventoryFullCantCarry": "You don't have any space to carry this (full inventory)!", - "NotEnoughCashNeedAmountMore": "You don't have enough money! You need {1} more!", - "AmountMustBeMoreThan": "The amount must be more than {1}!", - "WeaponBanned": "You are not allowed to buy or use weapons!", - "TimeNotNumber": "The time must be a number", - "HeaderDefaultBusinessItemTypes": "Business Item Templates", - "FixingStuck": "Fixing your position and virtual world ...", - "CantUseCommandYet": "You must wait before you can use this command again!", - "NotATester": "You are not a tester!", - "AccessDenied": "AccessDenied", - "InvalidSkin": "That skin is invalid!", - "HeaderInteriorTypes": "Interiors List", - "ViewInventoryKeyPressTip": "Press {1} to see your items", - "ViewInventoryCommandTip": "Use {1} to see your items", - "GUIAccountSettingToggle": "You have turned {1} GUI" + "NearbyRadio": "راديو قريب", + "FromRadio": "من الراديو", + "ToRadio": "في الراديو", + "NeedToEnterPropertyCommand": "تحتاج إلى إدخال {1} أولاً! استخدم {2} للدخول والخروج", + "NeedToEnterPropertyKeyPress": "تحتاج إلى إدخال {1} أولاً! اضغط على {2} للدخول والخروج", + "InventoryFullCantCarry": "ليس لديك أي مساحة لحمل هذا (جرد كامل)!", + "NotEnoughCashNeedAmountMore": "ليس لديك ما يكفي من المال! أنت بحاجة إلى {1} أكثر!", + "AmountMustBeMoreThan": "يجب أن يكون المبلغ أكثر من {1}!", + "WeaponBanned": "لا يسمح لك بشراء أو استخدام الأسلحة!", + "TimeNotNumber": "يجب أن يكون الوقت رقمًا", + "HeaderDefaultBusinessItemTypes": "قوالب عناصر الأعمال", + "FixingStuck": "إصلاح موقعك والعالم الافتراضي ...", + "CantUseCommandYet": "يجب أن تنتظر قبل أن تتمكن من استخدام هذا الأمر مرة أخرى!", + "NotATester": "أنت لست مختبرا!", + "AccessDenied": "تم الرفض", + "InvalidSkin": "هذا الجلد غير صالح!", + "HeaderInteriorTypes": "قائمة التصميمات الداخلية", + "ViewInventoryKeyPressTip": "اضغط على {1} لرؤية العناصر الخاصة بك", + "ViewInventoryCommandTip": "استخدم {1} لمشاهدة عناصرك", + "GUIAccountSettingToggle": "لقد قمت بتحويل {1} GUI" } From 5daf6fec2463a80cf077268f3dad7e5ba0a13f40 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sat, 19 Mar 2022 00:00:49 -0500 Subject: [PATCH 044/177] Remove old business scripts --- scripts/server/business/bakery.js | 8 ---- scripts/server/business/bar.js | 8 ---- scripts/server/business/burger.js | 8 ---- scripts/server/business/casino.js | 67 --------------------------- scripts/server/business/clothing.js | 8 ---- scripts/server/business/club.js | 8 ---- scripts/server/business/fuel.js | 8 ---- scripts/server/business/mechanic.js | 8 ---- scripts/server/business/pizza.js | 8 ---- scripts/server/business/restaurant.js | 8 ---- scripts/server/business/vehicle.js | 8 ---- scripts/server/business/weapon.js | 9 ---- 12 files changed, 156 deletions(-) delete mode 100644 scripts/server/business/bakery.js delete mode 100644 scripts/server/business/bar.js delete mode 100644 scripts/server/business/burger.js delete mode 100644 scripts/server/business/casino.js delete mode 100644 scripts/server/business/clothing.js delete mode 100644 scripts/server/business/club.js delete mode 100644 scripts/server/business/fuel.js delete mode 100644 scripts/server/business/mechanic.js delete mode 100644 scripts/server/business/pizza.js delete mode 100644 scripts/server/business/restaurant.js delete mode 100644 scripts/server/business/vehicle.js delete mode 100644 scripts/server/business/weapon.js diff --git a/scripts/server/business/bakery.js b/scripts/server/business/bakery.js deleted file mode 100644 index 5a0d1e81..00000000 --- a/scripts/server/business/bakery.js +++ /dev/null @@ -1,8 +0,0 @@ -// =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay -// =========================================================================== -// FILE: bakery.js -// DESC: Provides bakery business functions and usage -// TYPE: Business (JavaScript) -// =========================================================================== \ No newline at end of file diff --git a/scripts/server/business/bar.js b/scripts/server/business/bar.js deleted file mode 100644 index 24265882..00000000 --- a/scripts/server/business/bar.js +++ /dev/null @@ -1,8 +0,0 @@ -// =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay -// =========================================================================== -// FILE: bar.js -// DESC: Provides bar/pub business functions and usage -// TYPE: Business (JavaScript) -// =========================================================================== \ No newline at end of file diff --git a/scripts/server/business/burger.js b/scripts/server/business/burger.js deleted file mode 100644 index 4de61d2b..00000000 --- a/scripts/server/business/burger.js +++ /dev/null @@ -1,8 +0,0 @@ -// =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay -// =========================================================================== -// FILE: burger.js -// DESC: Provides burger joint (McDonalds?) business functions and usage -// TYPE: Business (JavaScript) -// =========================================================================== \ No newline at end of file diff --git a/scripts/server/business/casino.js b/scripts/server/business/casino.js deleted file mode 100644 index a9cd5d43..00000000 --- a/scripts/server/business/casino.js +++ /dev/null @@ -1,67 +0,0 @@ -// =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay -// =========================================================================== -// FILE: casino.js -// DESC: Provides casino business functions and usage -// TYPE: Business (JavaScript) -// =========================================================================== - -let deckCards = [ - DeckCardData("deckCardSpadeAce", VRR_DECKCARD_SUIT_SPADE, 1), - DeckCardData("deckCardSpade2", VRR_DECKCARD_SUIT_SPADE, 2), - DeckCardData("deckCardSpade3", VRR_DECKCARD_SUIT_SPADE, 3), - DeckCardData("deckCardSpade4", VRR_DECKCARD_SUIT_SPADE, 4), - DeckCardData("deckCardSpade5", VRR_DECKCARD_SUIT_SPADE, 5), - DeckCardData("deckCardSpade6", VRR_DECKCARD_SUIT_SPADE, 6), - DeckCardData("deckCardSpade7", VRR_DECKCARD_SUIT_SPADE, 7), - DeckCardData("deckCardSpade8", VRR_DECKCARD_SUIT_SPADE, 8), - DeckCardData("deckCardSpade9", VRR_DECKCARD_SUIT_SPADE, 9), - DeckCardData("deckCardSpade10", VRR_DECKCARD_SUIT_SPADE, 10), - DeckCardData("deckCardSpadeJack", VRR_DECKCARD_SUIT_SPADE, 11), - DeckCardData("deckCardSpadeQueen", VRR_DECKCARD_SUIT_SPADE, 12), - DeckCardData("deckCardSpadeKing", VRR_DECKCARD_SUIT_SPADE, 13), - DeckCardData("deckCardClubAce", VRR_DECKCARD_SUIT_CLUB, 1), - DeckCardData("deckCardClub2", VRR_DECKCARD_SUIT_CLUB, 2), - DeckCardData("deckCardClub3", VRR_DECKCARD_SUIT_CLUB, 3), - DeckCardData("deckCardClub4", VRR_DECKCARD_SUIT_CLUB, 4), - DeckCardData("deckCardClub5", VRR_DECKCARD_SUIT_CLUB, 5), - DeckCardData("deckCardClub6", VRR_DECKCARD_SUIT_CLUB, 6), - DeckCardData("deckCardClub7", VRR_DECKCARD_SUIT_CLUB, 7), - DeckCardData("deckCardClub8", VRR_DECKCARD_SUIT_CLUB, 8), - DeckCardData("deckCardClub9", VRR_DECKCARD_SUIT_CLUB, 9), - DeckCardData("deckCardClub10", VRR_DECKCARD_SUIT_CLUB, 10), - DeckCardData("deckCardClubJack", VRR_DECKCARD_SUIT_CLUB, 11), - DeckCardData("deckCardClubQueen", VRR_DECKCARD_SUIT_CLUB, 12), - DeckCardData("deckCardClubKing", VRR_DECKCARD_SUIT_CLUB, 13), - DeckCardData("deckCardHeartAce", VRR_DECKCARD_SUIT_HEART, 1), - DeckCardData("deckCardHeart2", VRR_DECKCARD_SUIT_HEART, 2), - DeckCardData("deckCardHeart3", VRR_DECKCARD_SUIT_HEART, 3), - DeckCardData("deckCardHeart4", VRR_DECKCARD_SUIT_HEART, 4), - DeckCardData("deckCardHeart5", VRR_DECKCARD_SUIT_HEART, 5), - DeckCardData("deckCardHeart6", VRR_DECKCARD_SUIT_HEART, 6), - DeckCardData("deckCardHeart7", VRR_DECKCARD_SUIT_HEART, 7), - DeckCardData("deckCardHeart8", VRR_DECKCARD_SUIT_HEART, 8), - DeckCardData("deckCardHeart9", VRR_DECKCARD_SUIT_HEART, 9), - DeckCardData("deckCardHeart10", VRR_DECKCARD_SUIT_HEART, 10), - DeckCardData("deckCardHeartJack", VRR_DECKCARD_SUIT_HEART, 11), - DeckCardData("deckCardHeartQueen", VRR_DECKCARD_SUIT_HEART, 12), - DeckCardData("deckCardHeartKing", VRR_DECKCARD_SUIT_HEART, 13), - DeckCardData("deckCardDiamondAce", VRR_DECKCARD_SUIT_DIAMOND, 1), - DeckCardData("deckCardDiamond2", VRR_DECKCARD_SUIT_DIAMOND, 2), - DeckCardData("deckCardDiamond3", VRR_DECKCARD_SUIT_DIAMOND, 3), - DeckCardData("deckCardDiamond4", VRR_DECKCARD_SUIT_DIAMOND, 4), - DeckCardData("deckCardDiamond5", VRR_DECKCARD_SUIT_DIAMOND, 5), - DeckCardData("deckCardDiamond6", VRR_DECKCARD_SUIT_DIAMOND, 6), - DeckCardData("deckCardDiamond7", VRR_DECKCARD_SUIT_DIAMOND, 7), - DeckCardData("deckCardDiamond8", VRR_DECKCARD_SUIT_DIAMOND, 8), - DeckCardData("deckCardDiamond9", VRR_DECKCARD_SUIT_DIAMOND, 9), - DeckCardData( "deckCardDiamond10", VRR_DECKCARD_SUIT_DIAMOND, 10), - DeckCardData("deckCardDiamondJack", VRR_DECKCARD_SUIT_DIAMOND, 11), - DeckCardData("deckCardDiamondQueen", VRR_DECKCARD_SUIT_DIAMOND, 12), - DeckCardData("deckCardDiamondKing", VRR_DECKCARD_SUIT_DIAMOND, 13), -]; - -let deckCardBacks = [ - -]; \ No newline at end of file diff --git a/scripts/server/business/clothing.js b/scripts/server/business/clothing.js deleted file mode 100644 index 1a38adad..00000000 --- a/scripts/server/business/clothing.js +++ /dev/null @@ -1,8 +0,0 @@ -// =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay -// =========================================================================== -// FILE: clothing.js -// DESC: Provides clothing (skin) business functions and usage -// TYPE: Business (JavaScript) -// =========================================================================== \ No newline at end of file diff --git a/scripts/server/business/club.js b/scripts/server/business/club.js deleted file mode 100644 index 80f083c4..00000000 --- a/scripts/server/business/club.js +++ /dev/null @@ -1,8 +0,0 @@ -// =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay -// =========================================================================== -// FILE: club.js -// DESC: Provides club/nightclub business functions and usage -// TYPE: Business (JavaScript) -// =========================================================================== \ No newline at end of file diff --git a/scripts/server/business/fuel.js b/scripts/server/business/fuel.js deleted file mode 100644 index 217d82a4..00000000 --- a/scripts/server/business/fuel.js +++ /dev/null @@ -1,8 +0,0 @@ -// =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay -// =========================================================================== -// FILE: fuel.js -// DESC: Provides fuel/petrol business functions and usage -// TYPE: Business (JavaScript) -// =========================================================================== \ No newline at end of file diff --git a/scripts/server/business/mechanic.js b/scripts/server/business/mechanic.js deleted file mode 100644 index 6eec8be0..00000000 --- a/scripts/server/business/mechanic.js +++ /dev/null @@ -1,8 +0,0 @@ -// =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay -// =========================================================================== -// FILE: mechanic.js -// DESC: Provides mechanic/vehicle repair business functions and usage -// TYPE: Business (JavaScript) -// =========================================================================== \ No newline at end of file diff --git a/scripts/server/business/pizza.js b/scripts/server/business/pizza.js deleted file mode 100644 index d14bb7a0..00000000 --- a/scripts/server/business/pizza.js +++ /dev/null @@ -1,8 +0,0 @@ -// =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay -// =========================================================================== -// FILE: pizza.js -// DESC: Provides pizza restaurant business functions and usage -// TYPE: Business (JavaScript) -// =========================================================================== \ No newline at end of file diff --git a/scripts/server/business/restaurant.js b/scripts/server/business/restaurant.js deleted file mode 100644 index 0491cfca..00000000 --- a/scripts/server/business/restaurant.js +++ /dev/null @@ -1,8 +0,0 @@ -// =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay -// =========================================================================== -// FILE: restaurant.js -// DESC: Provides generic restaurant business functions and usage -// TYPE: Business (JavaScript) -// =========================================================================== \ No newline at end of file diff --git a/scripts/server/business/vehicle.js b/scripts/server/business/vehicle.js deleted file mode 100644 index b7990e73..00000000 --- a/scripts/server/business/vehicle.js +++ /dev/null @@ -1,8 +0,0 @@ -// =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay -// =========================================================================== -// FILE: vehicle.js -// DESC: Provides vehicle dealership business functions and usage -// TYPE: Business (JavaScript) -// =========================================================================== \ No newline at end of file diff --git a/scripts/server/business/weapon.js b/scripts/server/business/weapon.js deleted file mode 100644 index e81fc514..00000000 --- a/scripts/server/business/weapon.js +++ /dev/null @@ -1,9 +0,0 @@ -// =========================================================================== -// Vortrex's Roleplay Resource -// https://github.com/VortrexFTW/gtac_roleplay -// =========================================================================== -// FILE: weapon.js -// DESC: Provides weapon (ammunations & illegal gunshops) business usage -// TYPE: Business (JavaScript) -// =========================================================================== - From 75b0e9a5826d8845b84200975dbbed0407309098 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sat, 19 Mar 2022 00:01:04 -0500 Subject: [PATCH 045/177] Resize logo in register GUI --- scripts/client/gui/register.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/client/gui/register.js b/scripts/client/gui/register.js index 1d1e0378..47aee279 100644 --- a/scripts/client/gui/register.js +++ b/scripts/client/gui/register.js @@ -40,7 +40,7 @@ function initRegisterGUI() { register.window.titleBarIconSize = toVector2(0,0); register.window.titleBarHeight = 0; - register.window.image(5, 20, 290, 80, mainLogoPath, { + register.window.image(5, 20, 290, 100, mainLogoPath, { focused: { borderColour: toColour(0, 0, 0, 0), }, From f24351af98e2553cdee5498b0accee211eb5a766 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sat, 19 Mar 2022 00:01:15 -0500 Subject: [PATCH 046/177] Fix button sizes in prompt GUI --- scripts/client/gui/yesno.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/client/gui/yesno.js b/scripts/client/gui/yesno.js index 4a6d4efe..60487747 100644 --- a/scripts/client/gui/yesno.js +++ b/scripts/client/gui/yesno.js @@ -48,7 +48,7 @@ function initYesNoDialogGUI() { }, }); - yesNoDialog.yesButton = yesNoDialog.window.button(5, 105, 190, 30, 'YES', { + yesNoDialog.yesButton = yesNoDialog.window.button(5, 105, 193, 30, 'YES', { main: { backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha), textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], 255), @@ -61,7 +61,7 @@ function initYesNoDialogGUI() { }, }, yesNoDialogAnswerYes); - yesNoDialog.noButton = yesNoDialog.window.button(200, 105, 190, 30, 'NO', { + yesNoDialog.noButton = yesNoDialog.window.button(203, 105, 192, 30, 'NO', { main: { backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha), textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], 255), From e71d41100734eb341cdca43334958a88b5733b9c Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sat, 19 Mar 2022 00:01:29 -0500 Subject: [PATCH 047/177] Remove unused classes for unfinished stuff --- scripts/server/class.js | 66 +---------------------------------------- 1 file changed, 1 insertion(+), 65 deletions(-) diff --git a/scripts/server/class.js b/scripts/server/class.js index 0e2bcba9..e90b2aba 100644 --- a/scripts/server/class.js +++ b/scripts/server/class.js @@ -1315,49 +1315,6 @@ class KeyBindData { } }; -class BlackListedGameScriptData { - constructor(dbAssoc = false) { - this.databaseId = 0; - this.enabled = false - this.serverId = 0; - this.scriptName = ""; - this.index = -1; - this.needsSaved = false; - - if(dbAssoc) { - this.databaseId = dbAssoc["ac_script_bl_id"]; - this.enabled = intToBool(dbAssoc["ac_script_bl_enabled"]); - this.serverId = dbAssoc["ac_script_bl_server"]; - this.scriptName = dbAssoc["ac_script_bl_name"]; - } - } -}; - -class WhiteListedGameScriptData { - constructor(dbAssoc = false) { - this.databaseId = 0; - this.enabled = false - this.serverId = 0; - this.scriptName = ""; - this.index = -1; - this.needsSaved = false; - - if(dbAssoc) { - this.databaseId = dbAssoc["ac_script_wl_id"]; - this.enabled = intToBool(dbAssoc["ac_script_wl_enabled"]); - this.serverId = dbAssoc["ac_script_wl_server"]; - this.scriptName = dbAssoc["ac_script_wl_name"]; - } - } -}; - -class InteriorTemplateData { - constructor(exitPosition, exitInterior) { - this.exitPosition = exitPosition; - this.exitInterior = exitInterior; - } -}; - class RadioStationData { constructor(dbAssoc = false) { this.databaseId = 0; @@ -1499,6 +1456,7 @@ class ItemTypeData { } } }; + class NPCData { constructor(dbAssoc = false) { this.databaseId = 0; @@ -1669,28 +1627,6 @@ class BanData { } } -class DeckCardData { - constructor(imageName, value) { - this.imageName = imageName, - this.value = value; - } -} - -class DeckCardGameData { - constructor() { - this.gameType = VRR_DECKCARD_GAME_NONE; - this.playedCards = []; - this.remainingCards = []; - } -} - -class DeckCardHandData { - constructor() { - this.cards = []; - this.total = 0; - } -} - class JobRouteData { constructor(dbAssoc = false) { this.databaseId = 0; From 775dcf317a6f252a9866caaac38a85312a0247af Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sun, 20 Mar 2022 13:53:15 -0500 Subject: [PATCH 048/177] Fix duplicate replace arg in locale files --- locale/chinese.json | 4 ++-- locale/english.json | 4 ++-- locale/polish.json | 4 ++-- locale/russian.json | 4 ++-- locale/spanish.json | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/locale/chinese.json b/locale/chinese.json index 2f7d82c4..8dbcaa21 100644 --- a/locale/chinese.json +++ b/locale/chinese.json @@ -1,7 +1,7 @@ { "TranslationProvidedBy": "Renzuka Ctone", "LocaleEnglishName": "Chinese", - + "LocaleNativeName": "Chinese", "LocaleOffer": "This server is available in English. Use {1} to use it.", "LocaleChanged1": "Your language is now set to {1}", @@ -264,7 +264,7 @@ "KeyBindHelp": [ "You can set your own key binds. Use {1} to see your binded keys.", "Use {1} to add a new keybind and {2} to remove one.", - "Default keys are: {1} for vehicle engine, {1} for lights, and {3} for lock/unlock", + "Default keys are: {1} for vehicle engine, {2} for lights, and {3} for lock/unlock", "Press {1} to see your items and {2} to equip an item or {3} to unequip all.", "Press {1} to use the item you're holding, press {2} to drop it, or press {3} to pickup an item from the ground." ], diff --git a/locale/english.json b/locale/english.json index 7046953c..ddc3c181 100644 --- a/locale/english.json +++ b/locale/english.json @@ -1,7 +1,7 @@ { "TranslationProvidedBy": "Vortrex", "LocaleEnglishName": "English", - + "LocaleNativeName": "English", "LocaleOffer": "This server is available in English. Use {1} to use it.", "LocaleChanged1": "Your language is now set to {1}", @@ -264,7 +264,7 @@ "KeyBindHelp": [ "You can set your own key binds. Use {1} to see your binded keys.", "Use {1} to add a new keybind and {2} to remove one.", - "Default keys are: {1} for vehicle engine, {1} for lights, and {3} for lock/unlock", + "Default keys are: {1} for vehicle engine, {2} for lights, and {3} for lock/unlock", "Press {1} to see your items and {2} to equip an item or {3} to unequip all.", "Press {1} to use the item you're holding, press {2} to drop it, or press {3} to pickup an item from the ground." ], diff --git a/locale/polish.json b/locale/polish.json index 714cf328..4548e03e 100644 --- a/locale/polish.json +++ b/locale/polish.json @@ -1,7 +1,7 @@ { "TranslationProvidedBy": "Suprise444", "LocaleEnglishName": "Polish", - + "LocaleNativeName": "Polski", "LocaleOffer": "Ten serwer jest dostępny w języku Polskim. Użyj {1} aby go użyć.", "LocaleChanged1": "Twój język jest ustawiony na {1}", @@ -264,7 +264,7 @@ "KeyBindHelp": [ "Możesz zmienić przypisania klawiszy. Użyj {1} aby zobaczyć twoje przypisane klawisze.", "Użyj {1} aby dodać nowe przypisanie i {2} aby je usunąć.", - "Domyślnymi przyciskami są: {1} aby uruchomić pojazd, {1} aby użyć świateł, and {3} aby otworzyć/zamknąć pojazd", + "Domyślnymi przyciskami są: {1} aby uruchomić pojazd, {2} aby użyć świateł, and {3} aby otworzyć/zamknąć pojazd", "Naciśnij {1} aby zobaczyć swoje itemy i {2} aby wyposażyć się w jakiś przedmiot lub {3} aby go schować.", "Naciśnij {1} aby użyć przedmiot, który trzymasz, naciśnij {2} aby go upuścić lub naciśnij {3} aby podnieść jakiś przedmiot z ziemi." ], diff --git a/locale/russian.json b/locale/russian.json index bb26e69e..908b21a7 100644 --- a/locale/russian.json +++ b/locale/russian.json @@ -1,7 +1,7 @@ { "TranslationProvidedBy": "VNDTTS", "LocaleEnglishName": "Russian", - + "LocaleNativeName": "Русский", "LocaleOffer": "Этот сервер доступен на русском. Используйте {1} чтобы его использовать.", "LocaleChanged1": "Ваш язык был установлен на {1}", @@ -264,7 +264,7 @@ "KeyBindHelp": [ "Вы можете сами создавать ваши привязки на кнопки. Используйте {1} чтобы просмотреть ваши привязки.", "Используйте {1} чтобы добавить новую приязку или {2} чтобы убрать ее.", - "Стандартные привязки: {1} для мотора, {1} для фар, и {3} для открытия/закрытия", + "Стандартные привязки: {1} для мотора, {2} для фар, и {3} для открытия/закрытия", "Используйте {1} чтобы просмотреть ваши предметы {2} чтобы экипировать предмет или {3} чтобы убрать.", "Используйте {1} чтобы использвать предмет который вы держите в руках, используйте {2} чтобы его выбростить, или используйте {3} чтобы подобрать предмет." ], diff --git a/locale/spanish.json b/locale/spanish.json index d87a0eb5..b685b5c6 100644 --- a/locale/spanish.json +++ b/locale/spanish.json @@ -1,7 +1,7 @@ { "TranslationProvidedBy": "PerikiyoXD", "LocaleEnglishName": "Spanish", - + "LocaleNativeName": "Español", "LocaleOffer": "Este servidor se encuentra disponible en Español. Utilice {1} para usarlo", "LocaleChanged1": "El idioma se ha configurado a {1}", @@ -270,7 +270,7 @@ "KeyBindHelp": [ "Puedes establecer tus propias combinaciones de teclas. Utilice {1} para ver sus teclas vinculadas", "Utilice {1} para añadir una nueva combinación de teclas y {2} para eliminar una", - "Las teclas por defecto son: {1} para el motor del vehículo, {1} para las luces y {3} para el bloqueo/desbloqueo", + "Las teclas por defecto son: {1} para el motor del vehículo, {2} para las luces y {3} para el bloqueo/desbloqueo", "Pulsa {1} para ver tus objetos y {2} para equipar un objeto o {3} para desequipar todos", "Pulsa {1} para usar el objeto que tienes en la mano, pulsa {2} para dejarlo caer o pulsa {3} para recoger un objeto del suelo" ], From 76673a42e84be4a9743f5e3baa500fd716070dea Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sun, 20 Mar 2022 13:53:45 -0500 Subject: [PATCH 049/177] Ask server to handle GUI response for pass reset --- scripts/client/gui/login.js | 7 ++++--- scripts/server/account.js | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/client/gui/login.js b/scripts/client/gui/login.js index 0e27789d..39c443c7 100644 --- a/scripts/client/gui/login.js +++ b/scripts/client/gui/login.js @@ -186,9 +186,10 @@ function loginSuccess() { // =========================================================================== function switchToPasswordResetGUI() { - closeAllWindows(); - logToConsole(LOG_DEBUG, `[VRR.GUI] Showing password reset dialog window`); - showResetPasswordGUI(); + //closeAllWindows(); + //logToConsole(LOG_DEBUG, `[VRR.GUI] Showing password reset dialog window`); + //showResetPasswordGUI(); + sendNetworkEventToServer("vrr.checkResetPassword", ""); return false; } diff --git a/scripts/server/account.js b/scripts/server/account.js index c4316633..c128ea23 100644 --- a/scripts/server/account.js +++ b/scripts/server/account.js @@ -980,6 +980,10 @@ function checkRegistration(client, password, confirmPassword = "", emailAddress // =========================================================================== function checkAccountResetPasswordRequest(client, inputText) { + if(!checkForSMTPModule() || !getEmailConfig().enabled) { + return false; + } + if(getPlayerData(client).passwordResetState == VRR_RESETPASS_STATE_NONE) { if(toLowerCase(getPlayerData(client).accountData.emailAddress) != toLowerCase(inputText)) { logToConsole(LOG_DEBUG|LOG_WARN, `${getPlayerDisplayForConsole(client)} failed to reset their password (email not correct)`); From 2f320af519fb31f9fdaba4ae524805c57c7e0707 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sun, 20 Mar 2022 13:54:05 -0500 Subject: [PATCH 050/177] Remove server settings flag keys --- scripts/server/bitflag.js | 38 ++------------------------------------ 1 file changed, 2 insertions(+), 36 deletions(-) diff --git a/scripts/server/bitflag.js b/scripts/server/bitflag.js index cf97f612..212899c9 100644 --- a/scripts/server/bitflag.js +++ b/scripts/server/bitflag.js @@ -21,7 +21,6 @@ let serverBitFlags = { npcTriggerTypeFlags: {}, npcTriggerConditionTypesFlags: {}, npcTriggerResponseTypeFlags: {}, - serverSettings: {} }; // =========================================================================== @@ -119,6 +118,8 @@ let serverBitFlagKeys = { "NoRandomTips", "NoActionTips", ], + + // Not going to be used. Use trigger, condition, and response stuff in trigger.js npcTriggerTypeKeys: [ "None", "FarProximity", // Comes within a far distance of NPC @@ -219,26 +220,6 @@ let serverBitFlagKeys = { "ShowItemsAfterPurchase", "BuyCommandAfterEnterBusiness", ], - serverSettingsKeys: [ - "None", - "GUI", - "ServerLogo", - "FallingSnow", - "GroundSnow", - "Anticheat", - "CheckGameScripts", - "GameScriptBlackList", - "GameScriptWhiteList", - "JobBlips", - "JobPickups", - "BusinessBlips", - "BusinessPickups", - "HouseBlips", - "HousePickups", - "DiscordBot", - "RealTime", - "Testing", - ], }; // =========================================================================== @@ -255,7 +236,6 @@ function initBitFlagScript() { serverBitFlags.npcTriggerTypes = createBitFlagTable(serverBitFlagKeys.npcTriggerTypeKeys); serverBitFlags.npcTriggerConditionTypes = createBitFlagTable(serverBitFlagKeys.npcTriggerConditionTypeKeys); serverBitFlags.npcTriggerResponseTypes = createBitFlagTable(serverBitFlagKeys.npcTriggerResponseTypeKeys); - serverBitFlags.serverSettings = createBitFlagTable(serverBitFlagKeys.serverSettingsKeys); logToConsole(LOG_INFO, "[VRR.BitFlag]: Bit flag script initialized successfully!"); return true; } @@ -410,20 +390,6 @@ function getModerationFlagValue(flagName) { // =========================================================================== -function getServerSettingsFlagValue(flagName) { - if(flagName == "All") { - return -1; - } - - if(typeof serverBitFlags.serverSettings[flagName] == "undefined") { - return false; - } - - return serverBitFlags.serverSettings[flagName]; -} - -// =========================================================================== - function givePlayerStaffFlag(client, flagName) { if(!getStaffFlagValue(flagName)) { return false; From b97e8142c98a83bf0f0440a3215c59088f0d96a7 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sun, 20 Mar 2022 13:54:21 -0500 Subject: [PATCH 051/177] Replace remaining help texts with locale --- scripts/server/help.js | 56 +++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/scripts/server/help.js b/scripts/server/help.js index 089f1507..ffee1c05 100644 --- a/scripts/server/help.js +++ b/scripts/server/help.js @@ -194,51 +194,51 @@ function showMainHelpMessage(client) { function showAccountHelpMessage(client) { messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderAccountHelp"))); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Do not share your password with anybody else.`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Use {ALTCOLOUR}/changepass{MAINCOLOUR} to change your password.`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Some settings you can use: {ALTCOLOUR}/gui, /logo, /iplogin, /autolastchar, /2fa, /loginalert`); + + messagePlayerHelpContent(client, getGroupedLocaleString(client, "AccountHelp", 0)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "AccountHelp", 1, `{ALTCOLOUR}/changepass{MAINCOLOUR}`)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "AccountHelp", 2, `{ALTCOLOUR}/gui, /logo, /iplogin, /autolastchar, /2fa, /loginalert{MAINCOLOUR}`)); } // =========================================================================== function showVehicleHelpMessage(client) { messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderVehicleHelp"))); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Visit dealerships to buy new vehicles (Use {ALTCOLOUR}/help dealership {MAINCOLOUR}for more info.)`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Some commands: {ALTCOLOUR}/lock, /engine, /lights, /trunk, /rentveh, /buyveh, /rentprice, /buyprice`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Your personal vehicles will save wherever you or somebody else leaves them!`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Visit a mechanic garage to repair, colour, and tune up your car! {ALTCOLOUR}/help mechanic {MAINCOLOUR} for info`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Don't forget to register and insure your vehicle! Use {ALTCOLOUR}/gps {MAINCOLOUR}to find a DMV for this.`); + + messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleHelp", 0, `{ALTCOLOUR}/help dealership{MAINCOLOUR}`)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleHelp", 1, `{ALTCOLOUR}/lock, /engine, /lights, /trunk, /rentveh, /buyveh, /rentprice, /buyprice{MAINCOLOUR}`)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleHelp", 2)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleHelp", 3, `{ALTCOLOUR}/help mechanic{MAINCOLOUR}`)); } // =========================================================================== function showVehicleDealershipHelpMessage(client) { messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderVehicleDealershipHelp"))); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Visit a vehicle dealer to buy new vehicles. Use {ALTCOLOUR}/gps {MAINCOLOUR}to find one.`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}At the dealer, simply enter a car you want to buy, and the price will be shown to you`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}If you want to buy the vehicle and have enough money, use {ALTCOLOUR}/buyveh {MAINCOLOUR}and you will be given keys`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}A new car for sale will appear when you drive away from the dealer.`); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleDealershipHelp", 0, `{ALTCOLOUR}/gps{MAINCOLOUR}`)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleDealershipHelp", 1)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleDealershipHelp", 1, `{ALTCOLOUR}/buyveh{MAINCOLOUR}`)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "VehicleDealershipHelp", 2)); } // =========================================================================== function showJobHelpMessage(client) { messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderJobHelp"))); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Visit job locations get a job and earn money. Look for yellow spots on the map`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}At a job location, use {ALTCOLOUR}/takejob {MAINCOLOUR}to get the job. Use {ALTCOLOUR}/quitjob {MAINCOLOUR}to quit your job`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Use {ALTCOLOUR}/startwork {MAINCOLOUR}to begin working. You can also get a job {ALTCOLOUR}/uniform and {ALTCOLOUR}/equipment`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Most job vehicles are locked. Use {ALTCOLOUR}/lock {MAINCOLOUR}near one to enter it.`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}When entering a job vehicle, information on how to do the job will be shown to you.`); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "JobHelp", 0)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "JobHelp", 1, `{ALTCOLOUR}/takejob{MAINCOLOUR}`, `{ALTCOLOUR}/quitjob{MAINCOLOUR}`)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "JobHelp", 2, `{ALTCOLOUR}/lock{MAINCOLOUR}`)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "JobHelp", 3)); } // =========================================================================== function showChatHelpMessage(client) { messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderChatHelp"))); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}There are two main types of chat: out-of-character (OOC) and in-character (IC)`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Mixing these two types is not proper roleplay. See {ALTCOLOUR}/rules {MAINCOLOUR}for info.`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Some chat commands: {ALTCOLOUR}/dm /whisper /talk /shout /me.`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Some have shorter names available ({ALTCOLOUR}/t {MAINCOLOUR}for talk, {ALTCOLOUR}/s {MAINCOLOUR}for shout, etc)`); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "ChatHelp", 0, `{ALTCOLOUR}/buy {MAINCOLOUR}`)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "ChatHelp", 1, `{ALTCOLOUR}/rules{MAINCOLOUR}`)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "ChatHelp", 2, `{ALTCOLOUR}/dm /whisper /talk /shout /me{MAINCOLOUR}`)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "ChatHelp", 3, `{ALTCOLOUR}/t{MAINCOLOUR}`, `{ALTCOLOUR}/s{MAINCOLOUR}`)); } // =========================================================================== @@ -290,9 +290,9 @@ function showBindKeysHelpMessage(client) { messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderBindableKeysHelp"))); messagePlayerHelpContent(client, getGroupedLocaleString(client, "KeyBindHelp", 0, `{ALTCOLOUR}/keybinds {MAINCOLOUR}`)); messagePlayerHelpContent(client, getGroupedLocaleString(client, "KeyBindHelp", 1, `{ALTCOLOUR}/bindkey {MAINCOLOUR}`, `{ALTCOLOUR}/unbindkey {MAINCOLOUR}`)); - messagePlayerHelpContent(client, getGroupedLocaleString(client, "KeyBindHelp", 2, `{ALTCOLOUR}K {MAINCOLOUR}`, `{ALTCOLOUR}L {MAINCOLOUR}`, `{ALTCOLOUR}J {MAINCOLOUR}`)); - messagePlayerHelpContent(client, getGroupedLocaleString(client, "KeyBindHelp", 3, `{ALTCOLOUR}I {MAINCOLOUR}`, `{ALTCOLOUR}1-9 {MAINCOLOUR}`, `{ALTCOLOUR}0 {MAINCOLOUR}`)); - messagePlayerHelpContent(client, getGroupedLocaleString(client, "KeyBindHelp", 4, `{ALTCOLOUR}U {MAINCOLOUR}`, `{ALTCOLOUR}O {MAINCOLOUR}`, `{ALTCOLOUR}P {MAINCOLOUR}`)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "KeyBindHelp", 2, `{ALTCOLOUR}K{MAINCOLOUR}`, `{ALTCOLOUR}L{MAINCOLOUR}`, `{ALTCOLOUR}J{MAINCOLOUR}`)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "KeyBindHelp", 3, `{ALTCOLOUR}I{MAINCOLOUR}`, `{ALTCOLOUR}1-9{MAINCOLOUR}`, `{ALTCOLOUR}0{MAINCOLOUR}`)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "KeyBindHelp", 4, `{ALTCOLOUR}U{MAINCOLOUR}`, `{ALTCOLOUR}O{MAINCOLOUR}`, `{ALTCOLOUR}P{MAINCOLOUR}`)); } // =========================================================================== @@ -328,10 +328,10 @@ function showRadioHelpMessage(client) { function showWealthAndTaxHelpMessage(client) { messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderWealthandTaxHelp"))); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Your taxes on payday are ${100*getGlobalConfig().economy.incomeTaxRate}% of your calculated wealth.`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Your calculated wealth is a total sum based on how many vehicles, houses, and businesses you have.`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Each vehicle is {ALTCOLOUR}${getGlobalConfig().economy.upKeepCosts.upKeepPerVehicle}, {MAINCOLOUR}each house is {ALTCOLOUR}${getGlobalConfig().economy.upKeepCosts.upKeepPerHouse}, {MAINCOLOUR}and each business is {ALTCOLOUR}${getGlobalConfig().economy.upKeepCosts.upKeepPerBusiness}`); - messagePlayerNormal(client, `{clanOrange}• {MAINCOLOUR}Use {ALTCOLOUR}/wealth {MAINCOLOUR}to see your current wealth, and {ALTCOLOUR}/tax {MAINCOLOUR}to see how much you'll pay in tax each payday`); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "WealthAndTaxHelp", 0, `{ALTCOLOUR}${100*getGlobalConfig().economy.incomeTaxRate}%{MAINCOLOUR}`)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "WealthAndTaxHelp", 1)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "WealthAndTaxHelp", 2, `{ALTCOLOUR}${getGlobalConfig().economy.upKeepCosts.upKeepPerVehicle}{MAINCOLOUR}`, `{ALTCOLOUR}${getGlobalConfig().economy.upKeepCosts.upKeepPerHouse}{MAINCOLOUR}`, `{ALTCOLOUR}${getGlobalConfig().economy.upKeepCosts.upKeepPerBusiness}{MAINCOLOUR}`)); + messagePlayerHelpContent(client, getGroupedLocaleString(client, "WealthAndTaxHelp", 3, `{ALTCOLOUR}/wealth{MAINCOLOUR}`, `{ALTCOLOUR}/tax{MAINCOLOUR}`)); } // =========================================================================== From eb844368be6a74c61cbb80a47e020951659536c5 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sun, 20 Mar 2022 13:54:36 -0500 Subject: [PATCH 052/177] Fix native name not being replaced in lang cmd --- scripts/server/locale.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/server/locale.js b/scripts/server/locale.js index 0d9b61f7..2911ca3a 100644 --- a/scripts/server/locale.js +++ b/scripts/server/locale.js @@ -147,7 +147,7 @@ function setLocaleCommand(command, params, client) { getPlayerData(client).accountData.locale = localeId; getPlayerData(client).locale = localeId; - messagePlayerSuccess(client, getLocaleString(client, "LocaleChanged1"), getLocaleString(client, "LocaleNativeName")); + messagePlayerSuccess(client, getLocaleString(client, "LocaleChanged1", getLocaleString(client, "LocaleNativeName"))); } // =========================================================================== From 495906d7f4a601657aa1c190da5bc3a6f9955877 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sun, 20 Mar 2022 13:57:56 -0500 Subject: [PATCH 053/177] Fix duplicate replace arg in arabic file --- locale/arabic.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/arabic.json b/locale/arabic.json index 74944a52..1b88a807 100644 --- a/locale/arabic.json +++ b/locale/arabic.json @@ -1,7 +1,7 @@ { "TranslationProvidedBy": "Kasir", "LocaleEnglishName": "Arabic", - + "LocaleNativeName": "عربى", "LocaleOffer": ".الخادم متاح باللغة الإنجليزية.استخدم {1} لاستخدامه", "LocaleChanged1": "لغتك الآن على {1}", @@ -264,7 +264,7 @@ "KeyBindHelp": [ "يمكنك تعيين روابط المفاتيح الخاصة بك. استخدم {1} لرؤية المفاتيح التي تم ربطها.", "استخدم {1} لإضافة رابط مفتاح جديد و {2} لإزالة واحد.", - "المفاتيح الافتراضية هي: {1} لمحرك السيارة و {1} للأضواء و {3} للقفل / فتح القفل", + "المفاتيح الافتراضية هي: {1} لمحرك السيارة و {2} للأضواء و {3} للقفل / فتح القفل", "اضغط على {1} لمشاهدة عناصرك و {2} لتجهيز عنصر أو {3} لإلغاء تجهيز الكل.", "اضغط على {1} لاستخدام العنصر الذي تمسكه ، أو اضغط على {2} لإسقاطه ، أو اضغط على {3} لالتقاط عنصر من الأرض." ], From 03bad1c341e05f0f0ad3d1bed88d77226a72e65a Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sun, 20 Mar 2022 13:59:15 -0500 Subject: [PATCH 054/177] Remove extra period (JSON format error) --- locale/arabic.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locale/arabic.json b/locale/arabic.json index 1b88a807..2d65b93c 100644 --- a/locale/arabic.json +++ b/locale/arabic.json @@ -253,7 +253,7 @@ "WeaponHelp": [ "قم بزيارة متجر أسلحة لشراء أسلحة. استخدم {1} للعثور على واحد.", "شراء سلاح يتطلب رخصة سلاح.", - "يتم إدارة تراخيص الأسلحة من قبل قسم الشرطة. قدم طلبًا للحصول على واحدة "., + "يتم إدارة تراخيص الأسلحة من قبل قسم الشرطة. قدم طلبًا للحصول على واحدة ", "يمكن أيضًا شراء الأسلحة بشكل غير قانوني من بعض الشركات وتجار الأسلحة والعصابات." ], "SkinHelp": [ From 8e96b01cebb4bd937181db4b0caf392b05452d70 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Mon, 21 Mar 2022 10:31:03 -0500 Subject: [PATCH 055/177] Comments and organization --- scripts/client/gui.js | 15 --------------- scripts/client/job.js | 1 + scripts/shared/const.js | 2 +- scripts/shared/gamedata.js | 9 +++++++++ scripts/shared/utilities.js | 19 ++++++++++++++++++- 5 files changed, 29 insertions(+), 17 deletions(-) diff --git a/scripts/client/gui.js b/scripts/client/gui.js index 676fde38..52b88f8b 100644 --- a/scripts/client/gui.js +++ b/scripts/client/gui.js @@ -37,21 +37,6 @@ let guiDownKey = false; // =========================================================================== -let placesOfOrigin = [ - "Liberty City", - "Vice City", - "Los Santos", - "San Fierro", - "Las Venturas", - "San Andreas", - "Blaine County", - "Red County", - "Bone County", - "Other", -]; - -// =========================================================================== - let characterData = []; let currentCharacter = 0; diff --git a/scripts/client/job.js b/scripts/client/job.js index ce5575da..f9b057ca 100644 --- a/scripts/client/job.js +++ b/scripts/client/job.js @@ -53,6 +53,7 @@ function showJobRouteLocation(position, colour) { logToConsole(LOG_DEBUG, `[VRR.Job] Showing job route location`); if(getMultiplayerMod() == VRR_MPMOD_GTAC) { if(game.game == VRR_GAME_GTA_SA) { + // Server-side spheres don't show in GTA SA for some reason. jobRouteLocationSphere = game.createPickup(1318, position, 1); } else { jobRouteLocationSphere = game.createSphere(position, 3); diff --git a/scripts/shared/const.js b/scripts/shared/const.js index 0c4c18ce..3f0f0fc5 100644 --- a/scripts/shared/const.js +++ b/scripts/shared/const.js @@ -3,7 +3,7 @@ // https://github.com/VortrexFTW/gtac_roleplay // =========================================================================== // FILE: const.js -// DESC: Provides constants +// DESC: Provides shared constants // TYPE: Shared (JavaScript) // =========================================================================== diff --git a/scripts/shared/gamedata.js b/scripts/shared/gamedata.js index 54038dcd..39c746de 100644 --- a/scripts/shared/gamedata.js +++ b/scripts/shared/gamedata.js @@ -1,6 +1,14 @@ // =========================================================================== +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/gtac_roleplay +// =========================================================================== +// FILE: gamedata.js +// DESC: Provides arrays of game data +// TYPE: Shared (JavaScript) +// =========================================================================== let supportedFeatures = { + // Invalid, GTAIII, GTAVC, GTASA, Invalid, GTAIV, Invalid, Invalid, Invalid, M1, M2, M3, M1DE time: [null, true, true, true, false, true, true, null, null, null, false, false, false, false], weather: [null, true, true, true, false, true, true, null, null, null, false, false, false, false], serverElements: [null, true, true, true, false, false, false, null, null, null, true, true, true, true], @@ -18,6 +26,7 @@ let supportedFeatures = { // =========================================================================== +// Connected MP mods only let extraContentResource = [ "", "connectedrp-gta3", diff --git a/scripts/shared/utilities.js b/scripts/shared/utilities.js index cfce224a..fae48e45 100644 --- a/scripts/shared/utilities.js +++ b/scripts/shared/utilities.js @@ -2,7 +2,7 @@ // Vortrex's Roleplay Resource // https://github.com/VortrexFTW/gtac_roleplay // =========================================================================== -// FILE: v.js +// FILE: utilities.js // DESC: Provides shared utilities // TYPE: Shared (JavaScript) // =========================================================================== @@ -267,6 +267,8 @@ let serverColours = { }, }; +// =========================================================================== + let serverEmoji = [ [":hash:", "#"], [":zero:", "0"], @@ -1125,6 +1127,21 @@ let serverEmoji = [ // =========================================================================== +let placesOfOrigin = [ + "Liberty City", + "Vice City", + "Los Santos", + "San Fierro", + "Las Venturas", + "San Andreas", + "Blaine County", + "Red County", + "Bone County", + "Other", +]; + +// =========================================================================== + function getGameConfig() { return gameData; } From 8a32b1697948c3aa8e916f6be564c1b0adb608cd Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Mon, 21 Mar 2022 10:33:59 -0500 Subject: [PATCH 056/177] Wrong spelling in function name --- scripts/server/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/server/config.js b/scripts/server/config.js index 14544fae..65c45e28 100644 --- a/scripts/server/config.js +++ b/scripts/server/config.js @@ -782,7 +782,7 @@ function doesServerHaveJobPickupsEnabled() { // =========================================================================== -function doesServerHaveBusinesBlipsEnabled() { +function doesServerHaveBusinessBlipsEnabled() { return getServerConfig().createBusinessBlips; } From cb348d83d03b6bbec783c05af881e37d30fe4754 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Mon, 21 Mar 2022 23:21:09 -0500 Subject: [PATCH 057/177] Disable mousecam on VC for now (crashes with 2+ players) --- scripts/server/misc.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/server/misc.js b/scripts/server/misc.js index cb25eebf..245758e5 100644 --- a/scripts/server/misc.js +++ b/scripts/server/misc.js @@ -35,7 +35,9 @@ function toggleMouseCursorCommand(command, params, client) { // =========================================================================== function toggleMouseCameraCommand(command, params, client) { - sendPlayerMouseCameraToggle(client); + if(getGame() != VRR_GAME_GTA_VC) { + sendPlayerMouseCameraToggle(client); + } return true; } From 48acaae1056999efc075a66b06a4d04966922cf4 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Mon, 21 Mar 2022 23:21:31 -0500 Subject: [PATCH 058/177] Fix for a few staff cmds using wrong arg --- scripts/server/staff.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/server/staff.js b/scripts/server/staff.js index 9cef4a76..e25cd017 100644 --- a/scripts/server/staff.js +++ b/scripts/server/staff.js @@ -1033,7 +1033,7 @@ function setPlayerHealthCommand(command, params, client) { //} let splitParams = params.split(" "); - let targetClient = getParam(params, " ", 1); + let targetClient = getPlayerFromParams(getParam(params, " ", 1)); let health = getParam(params, " ", 2); if(!targetClient) { @@ -1054,7 +1054,7 @@ function setPlayerArmourCommand(command, params, client) { return false; } - let targetClient = getParam(params, " ", 1); + let targetClient = getPlayerFromParams(getParam(params, " ", 1)); let armour = getParam(params, " ", 2); if(!targetClient) { @@ -1075,7 +1075,7 @@ function setPlayerInfiniteRunCommand(command, params, client) { return false; } - let targetClient = getParam(params, " ", 1); + let targetClient = getPlayerFromParams(getParam(params, " ", 1)); let state = getParam(params, " ", 2) || 0; if(!targetClient) { From 2412e4a542b01d784bee57532f4a123e648b41c3 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Mon, 21 Mar 2022 23:41:25 -0500 Subject: [PATCH 059/177] Re-enable chat history + organize client netevents --- scripts/client/server.js | 141 +++++++++++++++++++++--------------- scripts/client/utilities.js | 9 --- scripts/server/client.js | 3 +- scripts/server/messaging.js | 14 ++-- 4 files changed, 92 insertions(+), 75 deletions(-) diff --git a/scripts/client/server.js b/scripts/client/server.js index 197a46c8..ad85c825 100644 --- a/scripts/client/server.js +++ b/scripts/client/server.js @@ -18,66 +18,102 @@ function initServerScript() { function addAllNetworkHandlers() { logToConsole(LOG_DEBUG, "[VRR.Server]: Adding network handlers ..."); + // Chat history + addNetworkEventHandler("m", receiveChatBoxMessageFromServer); // Not prefixed with VRR to make it as small as possible + addNetworkEventHandler("vrr.chatScrollLines", setChatScrollLines); + + // Messaging (like textdraws and stuff) addNetworkEventHandler("vrr.smallGameMessage", showSmallGameMessage); + + // Job + addNetworkEventHandler("vrr.job", receiveJobFromServer); addNetworkEventHandler("vrr.working", setLocalPlayerWorkingState); addNetworkEventHandler("vrr.jobType", setLocalPlayerJobType); - addNetworkEventHandler("vrr.passenger", enterVehicleAsPassenger); + addNetworkEventHandler("vrr.showJobRouteLocation", showJobRouteLocation); + addNetworkEventHandler("vrr.hideJobRouteLocation", hideJobRouteLocation); + + // Local player states and values + addNetworkEventHandler("vrr.restoreCamera", restoreLocalCamera); + addNetworkEventHandler("vrr.cameraLookAt", setLocalCameraLookAt); addNetworkEventHandler("vrr.freeze", setLocalPlayerFrozenState); addNetworkEventHandler("vrr.control", setLocalPlayerControlState); addNetworkEventHandler("vrr.fadeCamera", fadeLocalCamera); addNetworkEventHandler("vrr.removeFromVehicle", removeLocalPlayerFromVehicle); - addNetworkEventHandler("vrr.clearPeds", clearLocalPlayerOwnedPeds); - addNetworkEventHandler("vrr.restoreCamera", restoreLocalCamera); - addNetworkEventHandler("vrr.cameraLookAt", setLocalCameraLookAt); - addNetworkEventHandler("vrr.logo", setServerLogoRenderState); - addNetworkEventHandler("vrr.ambience", setCityAmbienceState); - addNetworkEventHandler("vrr.runCode", runClientCode); addNetworkEventHandler("vrr.clearWeapons", clearLocalPlayerWeapons); addNetworkEventHandler("vrr.giveWeapon", giveLocalPlayerWeapon); addNetworkEventHandler("vrr.position", setLocalPlayerPosition); addNetworkEventHandler("vrr.heading", setLocalPlayerHeading); addNetworkEventHandler("vrr.interior", setLocalPlayerInterior); - addNetworkEventHandler("vrr.minuteDuration", setMinuteDuration); - addNetworkEventHandler("vrr.showJobRouteLocation", showJobRouteLocation); - addNetworkEventHandler("vrr.hideJobRouteLocation", hideJobRouteLocation); - addNetworkEventHandler("vrr.snow", setSnowState); - addNetworkEventHandler("vrr.health", setLocalPlayerHealth); - addNetworkEventHandler("vrr.enterPropertyKey", setEnterPropertyKey); - addNetworkEventHandler("vrr.skinSelect", toggleSkinSelect); - addNetworkEventHandler("vrr.hotbar", updatePlayerHotBar); - addNetworkEventHandler("vrr.pedSpeech", playPedSpeech); - addNetworkEventHandler("vrr.clearPedState", clearLocalPedState); - addNetworkEventHandler("vrr.drunkEffect", setLocalPlayerDrunkEffect); - addNetworkEventHandler("vrr.showItemActionDelay", showItemActionDelay); - addNetworkEventHandler("vrr.set2DRendering", setPlayer2DRendering); - addNetworkEventHandler("vrr.mouseCursor", toggleMouseCursor); - addNetworkEventHandler("vrr.mouseCamera", toggleMouseCamera); - addNetworkEventHandler("vrr.mouseCameraForce", setMouseCameraState); - addNetworkEventHandler("vrr.weaponDamageEnabled", setPlayerWeaponDamageEnabled); - addNetworkEventHandler("vrr.weaponDamageEvent", setPlayerWeaponDamageEvent); - addNetworkEventHandler("vrr.spawned", onServerSpawnedPlayer); + addNetworkEventHandler("vrr.spawned", onServerSpawnedLocalPlayer); addNetworkEventHandler("vrr.money", setLocalPlayerCash); addNetworkEventHandler("vrr.armour", setLocalPlayerArmour); - addNetworkEventHandler("vrr.wantedLevel", forceLocalPlayerWantedLevel); - addNetworkEventHandler("vrr.delKeyBind", unBindAccountKey); - addNetworkEventHandler("vrr.addKeyBind", bindAccountKey); - addNetworkEventHandler("vrr.clearKeyBinds", clearKeyBinds); - addNetworkEventHandler("vrr.nametag", updatePlayerNameTag); - addNetworkEventHandler("vrr.ping", updatePlayerPing); - addNetworkEventHandler("vrr.m", receiveChatBoxMessageFromServer); - addNetworkEventHandler("vrr.chatScrollLines", setChatScrollLines); + addNetworkEventHandler("vrr.localPlayerSkin", setLocalPlayerSkin); + addNetworkEventHandler("vrr.pedSpeak", makeLocalPlayerPedSpeak); + addNetworkEventHandler("vrr.infiniteRun", setLocalPlayerInfiniteRun); + addNetworkEventHandler("vrr.playerCop", setLocalPlayerAsCopState); + addNetworkEventHandler("vrr.health", setLocalPlayerHealth); + addNetworkEventHandler("vrr.wantedLevel", setLocalPlayerWantedLevel); + addNetworkEventHandler("vrr.playerPedId", sendLocalPlayerNetworkIdToServer); + addNetworkEventHandler("vrr.ped", setLocalPlayerPedPartsAndProps); + addNetworkEventHandler("vrr.spawn", serverRequestedLocalPlayerSpawn); + addNetworkEventHandler("vrr.clearPedState", clearLocalPedState); + addNetworkEventHandler("vrr.drunkEffect", setLocalPlayerDrunkEffect); + + // Vehicle + addNetworkEventHandler("vrr.vehicle", receiveVehicleFromServer); + addNetworkEventHandler("vrr.veh.lights", setVehicleLights); + addNetworkEventHandler("vrr.veh.engine", setVehicleEngine); + addNetworkEventHandler("vrr.veh.repair", repairVehicle); + + // Radio addNetworkEventHandler("vrr.radioStream", playStreamingRadio); addNetworkEventHandler("vrr.audioFileStream", playAudioFile); addNetworkEventHandler("vrr.stopRadioStream", stopStreamingRadio); addNetworkEventHandler("vrr.radioVolume", setStreamingRadioVolume); - addNetworkEventHandler("vrr.veh.lights", setVehicleLights); - addNetworkEventHandler("vrr.veh.engine", setVehicleEngine); - addNetworkEventHandler("vrr.veh.repair", repairVehicle); + + // Key Bindings + addNetworkEventHandler("vrr.delKeyBind", unBindAccountKey); + addNetworkEventHandler("vrr.addKeyBind", bindAccountKey); + addNetworkEventHandler("vrr.clearKeyBinds", clearKeyBinds); + + // Weapon Damage + addNetworkEventHandler("vrr.weaponDamageEnabled", setPlayerWeaponDamageEnabled); + addNetworkEventHandler("vrr.weaponDamageEvent", setPlayerWeaponDamageEvent); + + // GUI + addNetworkEventHandler("vrr.showRegistration", showRegistrationGUI); + addNetworkEventHandler("vrr.showNewCharacter", showNewCharacterGUI); + addNetworkEventHandler("vrr.showLogin", showLoginGUI); + + // Business + addNetworkEventHandler("vrr.business", receiveBusinessFromServer); + + // House + addNetworkEventHandler("vrr.house", receiveHouseFromServer); + + // Misc + addNetworkEventHandler("vrr.mouseCursor", toggleMouseCursor); + addNetworkEventHandler("vrr.mouseCamera", toggleMouseCamera); + addNetworkEventHandler("vrr.clearPeds", clearLocalPlayerOwnedPeds); + addNetworkEventHandler("vrr.passenger", enterVehicleAsPassenger); + addNetworkEventHandler("vrr.logo", setServerLogoRenderState); + addNetworkEventHandler("vrr.ambience", setCityAmbienceState); + addNetworkEventHandler("vrr.runCode", runClientCode); + addNetworkEventHandler("vrr.minuteDuration", setMinuteDuration); + addNetworkEventHandler("vrr.snow", setSnowState); + addNetworkEventHandler("vrr.enterPropertyKey", setEnterPropertyKey); + addNetworkEventHandler("vrr.skinSelect", toggleSkinSelect); + addNetworkEventHandler("vrr.hotbar", updatePlayerHotBar); + addNetworkEventHandler("vrr.showItemActionDelay", showItemActionDelay); + addNetworkEventHandler("vrr.set2DRendering", set2DRendering); + addNetworkEventHandler("vrr.mouseCameraForce", setMouseCameraState); + addNetworkEventHandler("vrr.logLevel", setLogLevel); + addNetworkEventHandler("vrr.hideAllGUI", hideAllGUI); + addNetworkEventHandler("vrr.nametag", updatePlayerNameTag); + addNetworkEventHandler("vrr.ping", updatePlayerPing); addNetworkEventHandler("vrr.pedAnim", makePedPlayAnimation); addNetworkEventHandler("vrr.pedStopAnim", makePedStopAnimation); - addNetworkEventHandler("vrr.localPlayerSkin", setLocalPlayerSkin); addNetworkEventHandler("vrr.forcePedAnim", forcePedAnimation); - addNetworkEventHandler("vrr.hideAllGUI", hideAllGUI); addNetworkEventHandler("vrr.clientInfo", serverRequestedClientInfo); addNetworkEventHandler("vrr.interiorLights", updateInteriorLightsState); addNetworkEventHandler("vrr.cutsceneInterior", setCutsceneInterior); @@ -85,21 +121,7 @@ function addAllNetworkHandlers() { addNetworkEventHandler("vrr.elementPosition", setElementPosition); addNetworkEventHandler("vrr.elementCollisions", setElementCollisionsEnabled); addNetworkEventHandler("vrr.vehBuyState", setVehiclePurchaseState); - addNetworkEventHandler("vrr.showRegistration", showRegistrationGUI); - addNetworkEventHandler("vrr.showNewCharacter", showNewCharacterGUI); - addNetworkEventHandler("vrr.showLogin", showLoginGUI); - addNetworkEventHandler("vrr.logLevel", setLogLevel); - addNetworkEventHandler("vrr.infiniteRun", setLocalPlayerInfiniteRun); - addNetworkEventHandler("vrr.business", receiveBusinessFromServer); - addNetworkEventHandler("vrr.house", receiveHouseFromServer); - addNetworkEventHandler("vrr.job", receiveJobFromServer); - addNetworkEventHandler("vrr.vehicle", receiveVehicleFromServer); addNetworkEventHandler("vrr.holdObject", makePedHoldObject); - addNetworkEventHandler("vrr.playerPedId", sendLocalPlayerNetworkIdToServer); - addNetworkEventHandler("vrr.ped", setLocalPlayerPedPartsAndProps); - addNetworkEventHandler("vrr.pedSpeak", makePlayerPedSpeak); - addNetworkEventHandler("vrr.playerCop", setPlayerAsCopState); - addNetworkEventHandler("vrr.spawn", serverRequestedLocalPlayerSpawn); } // =========================================================================== @@ -124,7 +146,7 @@ function sendResourceStoppedSignalToServer() { // =========================================================================== -function setPlayer2DRendering(hudState, labelState, smallGameMessageState, scoreboardState, hotBarState, itemActionDelayState) { +function set2DRendering(hudState, labelState, smallGameMessageState, scoreboardState, hotBarState, itemActionDelayState) { logToConsole(LOG_DEBUG, `[VRR.Main] Updating render states (HUD: ${hudState}, Labels: ${labelState}, Bottom Text: ${smallGameMessageState}, Scoreboard: ${scoreboardState}, HotBar: ${hotBarState}, Item Action Delay: ${itemActionDelayState})`); renderHUD = hudState; @@ -149,7 +171,7 @@ function setPlayer2DRendering(hudState, labelState, smallGameMessageState, score // =========================================================================== -function onServerSpawnedPlayer(state) { +function onServerSpawnedLocalPlayer(state) { logToConsole(LOG_DEBUG, `[VRR.Main] Setting spawned state to ${state}`); isSpawned = state; if(state) { @@ -262,7 +284,7 @@ function setLocalPlayerArmour(armour) { // =========================================================================== -function forceLocalPlayerWantedLevel(wantedLevel) { +function setLocalPlayerWantedLevel(wantedLevel) { forceWantedLevel = toInteger(wantedLevel); } @@ -330,7 +352,7 @@ function setCutsceneInterior(cutsceneName) { // =========================================================================== -function makePlayerPedSpeak(speechName) { +function makeLocalPlayerPedSpeak(speechName) { if(getGame() == VRR_GAME_GTA_IV) { // if player is in vehicle, allow megaphone (if last arg is "1", it will cancel megaphone echo) // Only speeches with _MEGAPHONE will have the bullhorn effect @@ -340,12 +362,15 @@ function makePlayerPedSpeak(speechName) { } else { natives.sayAmbientSpeech(localPlayer, speechName, true, false, 1); } + } else if(getGame() == VRR_GAME_GTA_III || getGame() == VRR_GAME_GTA_VC) { + // Don't have a way to get the ped ref ID and can't use ped in arg + //game.SET_CHAR_SAY(game.GET_PLAYER_ID(), int); } } // =========================================================================== -function setPlayerAsCopState(state) { +function setLocalPlayerAsCopState(state) { if(getGame() == VRR_GAME_GTA_IV) { natives.setPlayerAsCop(natives.getPlayerId(), state); natives.setPoliceIgnorePlayer(natives.getPlayerId(), state); diff --git a/scripts/client/utilities.js b/scripts/client/utilities.js index a17297d0..9c11a1fb 100644 --- a/scripts/client/utilities.js +++ b/scripts/client/utilities.js @@ -400,15 +400,6 @@ function isSnowEnabled() { // =========================================================================== -function playPedSpeech(pedName, speechId) { - logToConsole(LOG_DEBUG, `[VRR.Utilities] Making ${pedName}'s ped talk (${speechId})`); - if(getMultiplayerMod() == VRR_MPMOD_GTAC) { - game.SET_CHAR_SAY(int, int); - } -} - -// =========================================================================== - function clearLocalPedState() { logToConsole(LOG_DEBUG, `[VRR.Utilities] Clearing local ped state`); localPlayer.clearObjective(); diff --git a/scripts/server/client.js b/scripts/server/client.js index c4717cbe..59d47601 100644 --- a/scripts/server/client.js +++ b/scripts/server/client.js @@ -522,7 +522,8 @@ function sendPlayerRemoveFromVehicle(client) { // =========================================================================== function sendChatBoxMessageToPlayer(client, messageText, colour) { - messageClient(messageText, client, colour); + //messageClient(messageText, client, colour); + sendNetworkEventToPlayer("m", client, messageText, colour); } // =========================================================================== diff --git a/scripts/server/messaging.js b/scripts/server/messaging.js index fae5f859..e05b4ff8 100644 --- a/scripts/server/messaging.js +++ b/scripts/server/messaging.js @@ -37,15 +37,15 @@ function messagePlayerNormal(client, messageText, colour = COLOUR_WHITE) { // logToConsole(LOG_INFO, `${removeColoursInMessage(messageText)}`); //} - messageText = replaceColoursInMessage(messageText); + //messageText = replaceColoursInMessage(messageText); - if(client == null) { - message(messageText, colour); - } else { - messageClient(messageText, client, colour); - } + //if(client == null) { + // message(messageText, colour); + //} else { + // messageClient(messageText, client, colour); + //} - //sendChatBoxMessageToPlayer(client, messageText, colour); + sendChatBoxMessageToPlayer(client, messageText, colour); return true; } From ba50a90e200d189012289e56efa0865468ac4a08 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Mon, 21 Mar 2022 23:55:35 -0500 Subject: [PATCH 060/177] Allow mouse wheel for chat history scroll --- scripts/client/chatbox.js | 15 +++++++++++++++ scripts/client/event.js | 20 ++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/scripts/client/chatbox.js b/scripts/client/chatbox.js index 28408a28..46813eee 100644 --- a/scripts/client/chatbox.js +++ b/scripts/client/chatbox.js @@ -107,4 +107,19 @@ function updateChatBox() { } } +// =========================================================================== + +function processMouseWheelForChatBox(up) { + // There isn't a way to detect whether chat input is active, but mouse cursor is forced shown when typing so ¯\_(ツ)_/¯ + if(!gui.cursorEnabled) { + return false; + } + + if(up) { + chatBoxScrollUp(); + } else { + chatBoxScrollDown() + } +} + // =========================================================================== \ No newline at end of file diff --git a/scripts/client/event.js b/scripts/client/event.js index 91d1e502..760d08b8 100644 --- a/scripts/client/event.js +++ b/scripts/client/event.js @@ -51,6 +51,8 @@ function addAllEventHandlers() { addEventHandler("OnFocus", onFocus); addEventHandler("OnCameraProcess", onCameraProcess); + + addEventHandler("OnMouseWheel", onMouseWheel); } // =========================================================================== @@ -231,4 +233,22 @@ function onChatOutput(event, messageText, colour) { //receiveChatBoxMessageFromServer(messageText, colour); } +// =========================================================================== + +function onMouseWheel(event, mouseId, deltaCoordinates, flipped) { + if(!flipped) { + if(deltaCoordinates.y > 0) { + processMouseWheelForChatBox(true); + } else { + processMouseWheelForChatBox(false); + } + } else { + if(deltaCoordinates.y > 0) { + processMouseWheelForChatBox(false); + } else { + processMouseWheelForChatBox(true); + } + } +} + // =========================================================================== \ No newline at end of file From 1f095a5ed05d02a780ad94c9f6cd722c38e88154 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Tue, 22 Mar 2022 00:14:58 -0500 Subject: [PATCH 061/177] Chat box auto-hide (for next GTAC update) --- scripts/client/chatbox.js | 35 ++++++++++++++++++++++++++++++++++- scripts/client/server.js | 1 + scripts/server/account.js | 21 +++++++++++++++++++++ scripts/server/class.js | 2 ++ scripts/server/client.js | 6 ++++++ scripts/server/command.js | 3 ++- 6 files changed, 66 insertions(+), 2 deletions(-) diff --git a/scripts/client/chatbox.js b/scripts/client/chatbox.js index 46813eee..b14dd176 100644 --- a/scripts/client/chatbox.js +++ b/scripts/client/chatbox.js @@ -16,6 +16,9 @@ let maxChatBoxHistory = 500; let scrollAmount = 1; let maxChatBoxLines = 6; +let chatAutoHideDelay = 0; +let chatLastUse = 0; + let scrollUpKey = false; let scrollDownKey = false; @@ -47,6 +50,10 @@ function unBindChatBoxKeys() { function receiveChatBoxMessageFromServer(messageString, colour) { logToConsole(LOG_DEBUG, `[VRR.ChatBox]: Received chatbox message from server: ${messageString}`); + + // Just in case it's hidden by auto hide + setChatWindowEnabled(true); + let colouredString = replaceColoursInMessage(messageString); if(bottomMessageIndex >= chatBoxHistory.length-1) { @@ -54,6 +61,7 @@ function receiveChatBoxMessageFromServer(messageString, colour) { bottomMessageIndex = chatBoxHistory.length-1; } addToChatBoxHistory(colouredString, colour); + chatLastUse = getCurrentUnixTimestamp(); } // =========================================================================== @@ -64,6 +72,12 @@ function setChatScrollLines(amount) { // =========================================================================== +function setChatAutoHideDelay(delay) { + chatAutoHideDelay = delay*1000; +} + +// =========================================================================== + function addToChatBoxHistory(messageString, colour) { chatBoxHistory.push([messageString, colour]); } @@ -105,6 +119,7 @@ function updateChatBox() { message("", COLOUR_WHITE); } } + chatLastUse = getCurrentUnixTimestamp(); } // =========================================================================== @@ -118,7 +133,25 @@ function processMouseWheelForChatBox(up) { if(up) { chatBoxScrollUp(); } else { - chatBoxScrollDown() + chatBoxScrollDown(); + } +} + +// =========================================================================== + +function checkChatAutoHide() { + // Make sure chat input isn't active + if(gui.cursorEnabled) { + return false; + } + + // Don't process auto-hide if it's disabled + if(chatAutoHideDelay == 0) { + return false; + } + + if(getCurrentUnixTimestamp()-chatLastUse >= chatAutoHideDelay) { + setChatWindowEnabled(false); } } diff --git a/scripts/client/server.js b/scripts/client/server.js index ad85c825..c53e058c 100644 --- a/scripts/client/server.js +++ b/scripts/client/server.js @@ -21,6 +21,7 @@ function addAllNetworkHandlers() { // Chat history addNetworkEventHandler("m", receiveChatBoxMessageFromServer); // Not prefixed with VRR to make it as small as possible addNetworkEventHandler("vrr.chatScrollLines", setChatScrollLines); + addNetworkEventHandler("vrr.chatAutoHideDelay", setChatAutoHideDelay); // Messaging (like textdraws and stuff) addNetworkEventHandler("vrr.smallGameMessage", showSmallGameMessage); diff --git a/scripts/server/account.js b/scripts/server/account.js index c128ea23..dd94a97f 100644 --- a/scripts/server/account.js +++ b/scripts/server/account.js @@ -271,6 +271,26 @@ function setAccountChatScrollLinesCommand(command, params, client) { // =========================================================================== +function setAccountChatAutoHideDelayCommand(command, params, client) { + if(areParamsEmpty(params)) { + messagePlayerSyntax(client, getCommandSyntaxText(command)); + return false; + } + + if(isNaN(params)) { + messagePlayerError(client, `The delay time must be a number!`); + return false; + } + + let delay = Math.ceil(toInteger(params)); + + getPlayerData(client).accountData.chatAutoHideDelay = delay; + sendPlayerChatAutoHideDelay(client, delay); + messagePlayerSuccess(client, `Your chatbox will now automatically hide after ${toInteger(delay)} seconds!`); +} + +// =========================================================================== + function setAccountEmailCommand(command, params, client) { if(areParamsEmpty(params)) { messagePlayerSyntax(client, getCommandSyntaxText(command)); @@ -637,6 +657,7 @@ function saveAccountToDatabase(accountData) { ["acct_svr_staff_flags", accountData.flags.admin], ["acct_svr_mod_flags", accountData.flags.moderation], ["acct_svr_chat_scroll_lines", accountData.chatScrollLines], + ["acct_svr_chat_auto_hide_delay", accountData.chatAutoHideDelay], ]; let queryString1 = createDatabaseUpdateQuery("acct_main", data, `acct_id=${accountData.databaseId}`); diff --git a/scripts/server/class.js b/scripts/server/class.js index e90b2aba..eab66010 100644 --- a/scripts/server/class.js +++ b/scripts/server/class.js @@ -275,6 +275,7 @@ class AccountData { this.twoFactorAuthVerificationCode = ""; this.chatScrollLines = 1; + this.chatAutoHideDelay = 0; this.streamingRadioVolume = 20; this.locale = 0; @@ -304,6 +305,7 @@ class AccountData { this.emailVerificationCode = dbAssoc["acct_code_verifyemail"]; this.twoFactorAuthVerificationCode = dbAssoc["acct_code_2fa"]; this.chatScrollLines = toInteger(dbAssoc["acct_svr_chat_scroll_lines"]); + this.chatAutoHideDelay = toInteger(dbAssoc["acct_svr_chat_auto_hide_delay"]); this.streamingRadioVolume = toInteger(dbAssoc["acct_streaming_radio_volume"]); this.locale = toInteger(dbAssoc["acct_locale"]); } diff --git a/scripts/server/client.js b/scripts/server/client.js index 59d47601..93c85b31 100644 --- a/scripts/server/client.js +++ b/scripts/server/client.js @@ -938,6 +938,12 @@ function sendPlayerChatScrollLines(client, amount) { // =========================================================================== +function sendPlayerChatAutoHideDelay(client, delay) { + sendNetworkEventToPlayer("vrr.chatAutoHideDelay", client, delay); +} + +// =========================================================================== + function playRadioStreamForPlayer(client, streamURL, loop = true, volume = 0, element = false) { logToConsole(LOG_DEBUG, `[VRR.Client] Forcing ${getPlayerDisplayForConsole(client)} to stream ${streamURL}`); sendNetworkEventToPlayer("vrr.radioStream", client, streamURL, loop, volume, element); diff --git a/scripts/server/command.js b/scripts/server/command.js index d9e87bdc..0b5058f5 100644 --- a/scripts/server/command.js +++ b/scripts/server/command.js @@ -55,7 +55,8 @@ function loadCommands() { //commandData("setdiscord", setAccountDiscordCommand, "", getStaffFlagValue("None"), true, false, "Set up the integration for discord. Allows you to see info and use in-game commands on discord."), commandData("notips", toggleNoRandomTipsCommand, "", getStaffFlagValue("None"), true, false, "Turn on and off random tips"), commandData("loginalert", toggleAccountLoginAttemptNotificationsCommand, "", getStaffFlagValue("None"), true, false, "Turn on and off email notifications for attempts to login to your account"), - commandData("scrolllines", setAccountChatScrollLinesCommand, "", getStaffFlagValue("None"), true, false, "Sets how many chatbox lines to scroll at a time when using pageup/pagedown"), + commandData("scrolllines", setAccountChatScrollLinesCommand, "", getStaffFlagValue("None"), true, false, "Sets how many chatbox lines to scroll at a time when using pageup/pagedown"), + commandData("chatautohide", setAccountChatAutoHideDelayCommand, "