13 Commits

Author SHA1 Message Date
Andy
7fe7901a13 Update fxmanifest.lua 2023-12-22 22:53:15 +01:00
Andy
ca8f4369f6 Update README.md 2023-12-22 22:51:52 +01:00
Andy
e1d4b2fcff Update README.md 2023-12-22 22:51:09 +01:00
Andyyy7666
8b0f2b010d fix: lock inconsistency on player spawned vehicles 2023-12-22 18:25:00 +01:00
Andy
24e8874050 Merge pull request #46 from realCallMeJ/discord-info-fix
fix: not getting discord info on player connecting
2023-12-20 13:03:28 +01:00
Andy
289d040b5c Update main.lua 2023-12-20 13:02:13 +01:00
CallMeJ
3f0c47c2d0 add next as a local 2023-12-19 17:22:43 -10:00
CallMeJ
543b23a644 fix: not getting discord info till restart 2023-12-19 17:03:49 -10:00
Andyyy7666
4b106d3688 fix: PlayersInfo not being set 2023-12-16 19:46:35 +01:00
Andy
db5c54f2d8 Merge pull request #44 from Blizzard098/main
Escape SQL `groups` column value and LONGTEXT defaults.
2023-12-14 00:54:12 +01:00
Michael G
a1150bb821 Make LONGTEXT default values compatible with MySQL8 2023-12-13 18:27:00 -05:00
Michael G
8f7c52130a Make default values for LONGTEXT compatible with MySQL8 2023-12-13 18:26:36 -05:00
Michael G
6e71142970 Escape the groups column 2023-12-13 18:22:01 -05:00
7 changed files with 32 additions and 21 deletions

View File

@@ -16,9 +16,13 @@
* [oxmysql](https://github.com/overextended/oxmysql/releases) * [oxmysql](https://github.com/overextended/oxmysql/releases)
* [ox_lib](https://github.com/overextended/ox_lib/releases) * [ox_lib](https://github.com/overextended/ox_lib/releases)
## v2 Addons ## Addons
* [Character selection](https://github.com/ND-Framework/ND_Characters/tree/wip-v2) * [Character selection](https://github.com/ND-Framework/ND_Characters/releases)
* [Banking](https://github.com/ND-Framework/ND_Banking/tree/wip-v2) * [Banking](https://github.com/ND-Framework/ND_Banking/releases)
* [Appearance shops](https://github.com/ND-Framework/ND_AppearanceShops/tree/wip-v2) * [Appearance shops](https://github.com/ND-Framework/ND_AppearanceShops/releases)
* [Dealership](https://github.com/ND-Framework/ND_Dealership/tree/v2) * [Dealership](https://github.com/ND-Framework/ND_Dealership/releases)
* [Inventory](https://github.com/overextended/ox_inventory/pull/1403) * [Inventory](https://github.com/overextended/ox_inventory/releases)
* [Ambulance job](https://github.com/ND-Framework/ND_Ambulance/releases)
* [Casino](https://github.com/ND-Framework/ND_Casino/releases)
* [Blackjack](https://github.com/ND-Framework/ND_Blackjack/releases)
* [Nitro](https://github.com/ND-Framework/ND_Nitro/releases)

View File

@@ -8,8 +8,8 @@ CREATE TABLE IF NOT EXISTS `nd_characters` (
`gender` VARCHAR(50) DEFAULT NULL, `gender` VARCHAR(50) DEFAULT NULL,
`cash` INT(10) DEFAULT '0', `cash` INT(10) DEFAULT '0',
`bank` INT(10) DEFAULT '0', `bank` INT(10) DEFAULT '0',
`groups` LONGTEXT DEFAULT '[]', `groups` LONGTEXT DEFAULT ('[]'),
`metadata` LONGTEXT DEFAULT '[]', `metadata` LONGTEXT DEFAULT ('[]'),
`inventory` LONGTEXT DEFAULT '[]', `inventory` LONGTEXT DEFAULT ('[]'),
PRIMARY KEY (`charid`) USING BTREE PRIMARY KEY (`charid`) USING BTREE
); );

View File

@@ -2,13 +2,13 @@ CREATE TABLE IF NOT EXISTS `nd_vehicles` (
`id` INT(11) NOT NULL AUTO_INCREMENT, `id` INT(11) NOT NULL AUTO_INCREMENT,
`owner` INT(11) DEFAULT NULL, `owner` INT(11) DEFAULT NULL,
`plate` VARCHAR(255) DEFAULT NULL, `plate` VARCHAR(255) DEFAULT NULL,
`glovebox` LONGTEXT DEFAULT '[]', `glovebox` LONGTEXT DEFAULT ('[]'),
`trunk` LONGTEXT DEFAULT '[]', `trunk` LONGTEXT DEFAULT ('[]'),
`properties` LONGTEXT DEFAULT '[]', `properties` LONGTEXT DEFAULT ('[]'),
`stored` INT(11) DEFAULT '1', `stored` INT(11) DEFAULT '1',
`impounded` INT(11) DEFAULT '0', `impounded` INT(11) DEFAULT '0',
`stolen` INT(11) DEFAULT '0', `stolen` INT(11) DEFAULT '0',
`metadata` LONGTEXT DEFAULT '[]', `metadata` LONGTEXT DEFAULT ('[]'),
PRIMARY KEY (`id`) USING BTREE, PRIMARY KEY (`id`) USING BTREE,
INDEX `owner` (`owner`) USING BTREE, INDEX `owner` (`owner`) USING BTREE,
CONSTRAINT `vehowner` FOREIGN KEY (`owner`) REFERENCES `nd_characters` (`charid`) ON UPDATE CASCADE ON DELETE CASCADE CONSTRAINT `vehowner` FOREIGN KEY (`owner`) REFERENCES `nd_characters` (`charid`) ON UPDATE CASCADE ON DELETE CASCADE

View File

@@ -2,7 +2,7 @@
author "Andyyy#7666" author "Andyyy#7666"
description "ND Framework Core" description "ND Framework Core"
version "2.0.0" version "2.0.1"
fx_version "cerulean" fx_version "cerulean"
game "gta5" game "gta5"
@@ -38,5 +38,7 @@ files {
} }
dependency "oxmysql" dependency "oxmysql"
-- below were used with backwards compatibility but could interfere with resources checking if the resources are started.
-- provide "es_extended" -- provide "es_extended"
-- provide "qb-Core" -- provide "qb-Core"

View File

@@ -46,8 +46,9 @@ end
AddEventHandler("playerJoining", function(oldId) AddEventHandler("playerJoining", function(oldId)
local src = source local src = source
PlayersInfo[src] = tempPlayersInfo[oldId] local oldTempId = tonumber(oldId)
tempPlayersInfo[oldId] = nil PlayersInfo[src] = tempPlayersInfo[oldTempId]
tempPlayersInfo[oldTempId] = nil
if Config.multiCharacter then return end if Config.multiCharacter then return end
Wait(3000) Wait(3000)
@@ -93,12 +94,12 @@ AddEventHandler("playerConnecting", function(name, setKickReason, deferrals)
local tempSrc = source local tempSrc = source
local identifiers = getIdentifierList(tempSrc) local identifiers = getIdentifierList(tempSrc)
local mainIdentifier = identifiers[Config.characterIdentifier] local mainIdentifier = identifiers[Config.characterIdentifier]
local discordInfo = {} local discordInfo = nil
deferrals.defer() deferrals.defer()
Wait(0) Wait(0)
if mainIdentifier and Config.discordBotToken ~= "false" and Config.discordGuildId ~= "false" and not discordInfo then if mainIdentifier and Config.discordBotToken ~= "false" and Config.discordGuildId ~= "false" then
discordInfo = checkDiscordIdentifier(identifiers) discordInfo = checkDiscordIdentifier(identifiers)
if not discordInfo then if not discordInfo then
deferrals.done(("Your discord was not found, join our discord here: %s."):format(Config.discordInvite)) deferrals.done(("Your discord was not found, join our discord here: %s."):format(Config.discordInvite))

View File

@@ -165,7 +165,7 @@ local function createCharacterTable(info)
-- Save character information to database -- Save character information to database
function self.save() function self.save()
local affectedRows = MySQL.update.await("UPDATE nd_characters SET name = ?, firstname = ?, lastname = ?, dob = ?, gender = ?, cash = ?, bank = ?, groups = ?, metadata = ? WHERE charid = ?", { local affectedRows = MySQL.update.await("UPDATE nd_characters SET name = ?, firstname = ?, lastname = ?, dob = ?, gender = ?, cash = ?, bank = ?, `groups` = ?, metadata = ? WHERE charid = ?", {
self.name, self.name,
self.firstname, self.firstname,
self.lastname, self.lastname,
@@ -398,7 +398,7 @@ function NDCore.newCharacter(src, info)
inventory = info.inventory or {}, inventory = info.inventory or {},
} }
charInfo.id = MySQL.insert.await("INSERT INTO nd_characters (identifier, name, firstname, lastname, dob, gender, cash, bank, groups, metadata) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", { charInfo.id = MySQL.insert.await("INSERT INTO nd_characters (identifier, name, firstname, lastname, dob, gender, cash, bank, `groups`, metadata) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", {
identifier, identifier,
charInfo.name, charInfo.name,
charInfo.firstname, charInfo.firstname,

View File

@@ -567,8 +567,12 @@ RegisterNetEvent("ND_Vehicles:toggleVehicleLock", function(netId)
end) end)
-- locking of npc vehicles, if the players spawns inside a vehicle it won't be locked. -- locking of npc vehicles, if the players spawns inside a vehicle it won't be locked.
RegisterNetEvent("entityCreated", function(entity) AddEventHandler("entityCreated", function(entity)
local time = os.time()
while not DoesEntityExist(entity) and os.time()-time < 5 do Wait(50) end
if not DoesEntityExist(entity) or GetEntityType(entity) ~= 2 then return end if not DoesEntityExist(entity) or GetEntityType(entity) ~= 2 then return end
local state = Entity(entity).state local state = Entity(entity).state
if state.owner or state.locked ~= nil then return end if state.owner or state.locked ~= nil then return end