mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-08-17 05:56:01 +01:00
Added updating clothes
This commit is contained in:
@@ -34,14 +34,13 @@ 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', `phone_number` VARCHAR(20) DEFAULT NULL, PRIMARY KEY (`character_id`) USING BTREE);")
|
||||
print("^4ND_Core ^0Database structure validated!")
|
||||
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);")
|
||||
print('^4ND_Core ^0Database structure validated!')
|
||||
end)
|
||||
|
||||
-- Getting all the characters the player has and returning them to the client.
|
||||
RegisterNetEvent("ND:GetCharacters", function()
|
||||
local player = source
|
||||
Wait(100)
|
||||
TriggerClientEvent("ND:returnCharacters", player, NDCore.Functions.GetPlayerCharacters(player))
|
||||
end)
|
||||
|
||||
@@ -80,3 +79,9 @@ AddEventHandler("playerDropped", function()
|
||||
local player = source
|
||||
NDCore.Players[player] = nil
|
||||
end)
|
||||
|
||||
-- Update the characters clothes.
|
||||
RegisterNetEvent("ND:updateClothes", function(clothing)
|
||||
local player = source
|
||||
NDCore.Functions.UpdateClothes(NDCore.Players[player].id, clothing)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user