mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-08-17 05:56:01 +01:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7fe7901a13 | ||
|
|
ca8f4369f6 | ||
|
|
e1d4b2fcff | ||
|
|
8b0f2b010d | ||
|
|
24e8874050 | ||
|
|
289d040b5c | ||
|
|
3f0c47c2d0 | ||
|
|
543b23a644 | ||
|
|
4b106d3688 | ||
|
|
db5c54f2d8 | ||
|
|
a1150bb821 | ||
|
|
8f7c52130a | ||
|
|
6e71142970 |
16
README.md
16
README.md
@@ -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)
|
||||||
|
|||||||
@@ -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
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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))
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user