diff --git a/ND_CharacterSelection/config.lua b/ND_CharacterSelection/config.lua index 1a33c16..a64b1bb 100644 --- a/ND_CharacterSelection/config.lua +++ b/ND_CharacterSelection/config.lua @@ -2,12 +2,9 @@ config = { changeCharacterCommand = "changecharacter", -- this is the command to open the ui again and change your character. - enableAppearance = false, -- you need to install fivem-appearance - characterSelectionAopDisplay = false, - aop = function () - return "AOP: " .. exports["SimpleHUD"]:getAOP() -- exports["ModernHUD"]:getAOP() - end, - + enableAppearance = true, -- you need to install fivem-appearance + characterSelectionAopDisplay = true, + aopResourceName = "SimpleHUD", -- ModernHUD, SimpleHUD. If you're using a custom AOP system, put the resource name here and make sure it has the export getAOP -- set your backgrounds, if you have more than 1 then it will randomly change everytime you open the ui. backgrounds = { "https://i.imgur.com/E51ckFx.png", -- Credits: Fuzzman270#0270 @@ -53,4 +50,4 @@ config = { {x = 1194.71, y = -1474.14, z = 33.86, name = "Fire Station No7 (Los Santos)"} }, } -} \ No newline at end of file +} diff --git a/ND_CharacterSelection/source/client.lua b/ND_CharacterSelection/source/client.lua index 0196c6b..01a4c16 100644 --- a/ND_CharacterSelection/source/client.lua +++ b/ND_CharacterSelection/source/client.lua @@ -73,9 +73,11 @@ function SetDisplay(bool, typeName, bg, characters) }) Wait(500) if config.characterSelectionAopDisplay then + local AreaOfPlay = exports[config.aopResourceName]:getAOP() + --print(AreaOfPlay) SendNUIMessage({ type = "aop", - aop = config.aop() + aop = AreaOfPlay }) end end @@ -93,9 +95,10 @@ function start(switch) SetEntityVisible(ped, false, 0) end if config.characterSelectionAopDisplay then + local AreaOfPlay = exports[config.aopResourceName]:getAOP() SendNUIMessage({ type = "aop", - aop = config.aop() + aop = AreaOfPlay }) end end @@ -239,4 +242,4 @@ RegisterCommand(config.changeCharacterCommand, function() end, false) -- chat suggestions -TriggerEvent("chat:addSuggestion", "/" .. config.changeCharacterCommand, "Switch your framework character.") \ No newline at end of file +TriggerEvent("chat:addSuggestion", "/" .. config.changeCharacterCommand, "Switch your framework character.") diff --git a/ND_CharacterSelection/source/ui/script.js b/ND_CharacterSelection/source/ui/script.js index bd7250a..dfc0de3 100644 --- a/ND_CharacterSelection/source/ui/script.js +++ b/ND_CharacterSelection/source/ui/script.js @@ -100,7 +100,7 @@ $(function() { } if (item.type === "aop") { - $("#aop").text(item.aop); + $("#aop").text(`AOP: ${item.aop}`); } if (item.type === "refresh") { @@ -225,4 +225,4 @@ $(function() { $.post(`https://${GetParentResourceName()}/exitGame`); return; }); -}); \ No newline at end of file +}); diff --git a/ND_Core/server/events.lua b/ND_Core/server/events.lua index ba55fce..11c74ca 100644 --- a/ND_Core/server/events.lua +++ b/ND_Core/server/events.lua @@ -34,7 +34,7 @@ AddEventHandler("onResourceStart", function(resourceName) if (GetCurrentResourceName() ~= resourceName) then return end - MySQL.query("CREATE TABLE IF NOT EXISTS characters ( `character_id` INT(10) NOT NULL AUTO_INCREMENT, `license` VARCHAR(200) NOT NULL DEFAULT '0', `first_name` VARCHAR(50) NULL DEFAULT NULL, `last_name` VARCHAR(50) NULL DEFAULT NULL, `dob` VARCHAR(50) NULL DEFAULT NULL, `gender` VARCHAR(50) NULL DEFAULT NULL, `twt` VARCHAR(50) NULL DEFAULT NULL, `job` VARCHAR(50) NULL DEFAULT NULL, `cash` INT(10) NULL DEFAULT '0', `bank` INT(10) NULL DEFAULT '0', PRIMARY KEY (`character_id`) USING BTREE);") + MySQL.query("CREATE TABLE IF NOT EXISTS characters ( `character_id` INT(10) NOT NULL AUTO_INCREMENT, `license` VARCHAR(200) NOT NULL DEFAULT '0', `first_name` VARCHAR(50) NULL DEFAULT NULL, `last_name` VARCHAR(50) NULL DEFAULT NULL, `dob` VARCHAR(50) NULL DEFAULT NULL, `gender` VARCHAR(50) NULL DEFAULT NULL,`twt` VARCHAR(50) NULL DEFAULT NULL, `job` VARCHAR(50) NULL DEFAULT NULL, `cash` INT(10) NULL DEFAULT '0', `bank` INT(10) NULL DEFAULT '0', `phone_number` VARCHAR(20) NULL DEFAULT NULL, `groups` LONGTEXT NULL DEFAULT '[]', `last_location` LONGTEXT NULL DEFAULT '[]', `clothing` LONGTEXT NULL DEFAULT '[]', PRIMARY KEY (`character_id`) USING BTREE);") print('^4ND_Core ^0Database structure validated!') end) @@ -88,4 +88,4 @@ end) RegisterNetEvent("ND:updateClothes", function(clothing) local player = source NDCore.Functions.UpdateClothes(NDCore.Players[player].id, clothing) -end) \ No newline at end of file +end)