Merge pull request #28 from Hakkodevelopment/main

Fixed export issues & updated database validation :D
This commit is contained in:
Niko
2022-08-13 17:23:21 -04:00
committed by GitHub
4 changed files with 14 additions and 14 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -100,7 +100,7 @@ $(function() {
}
if (item.type === "aop") {
$("#aop").text(item.aop);
$("#aop").text(`AOP: ${item.aop}`);
}
if (item.type === "refresh") {

View File

@@ -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)