ed
This commit is contained in:
parent
600d79af31
commit
5d11084641
136 changed files with 12007 additions and 584 deletions
23
resources/[freizeit]/[gym]/mz-skills/server/main.lua
Normal file
23
resources/[freizeit]/[gym]/mz-skills/server/main.lua
Normal file
|
@ -0,0 +1,23 @@
|
|||
local QBCore = exports['qb-core']:GetCoreObject()
|
||||
|
||||
QBCore.Functions.CreateCallback('skillsystem:fetchStatus', function(source, cb)
|
||||
local Player = QBCore.Functions.GetPlayer(source)
|
||||
if Player then
|
||||
local status = MySQL.scalar.await('SELECT skills FROM players WHERE citizenid = ?', {Player.PlayerData.citizenid})
|
||||
if status ~= nil then
|
||||
cb(json.decode(status))
|
||||
else
|
||||
cb(nil)
|
||||
end
|
||||
else
|
||||
cb()
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterServerEvent('skillsystem:update', function (data)
|
||||
local Player = QBCore.Functions.GetPlayer(source)
|
||||
MySQL.query('UPDATE players SET skills = @skills WHERE citizenid = @citizenid', {
|
||||
['@skills'] = data,
|
||||
['@citizenid'] = Player.PlayerData.citizenid
|
||||
})
|
||||
end)
|
Loading…
Add table
Add a link
Reference in a new issue