mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-08-17 05:56:01 +01:00
Merge pull request #28 from Hakkodevelopment/main
Fixed export issues & updated database validation :D
This commit is contained in:
@@ -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)"}
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.")
|
||||
TriggerEvent("chat:addSuggestion", "/" .. config.changeCharacterCommand, "Switch your framework character.")
|
||||
|
||||
@@ -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;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user