---ESX---
ESX = nil
Citizen.CreateThread(function()
while ESX == nil do
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
Citizen.Wait(31)
end
end)
---M3----
M3 = nil
Citizen.CreateThread(function()
while M3 == nil do
TriggerEvent('M3:getSharedObject', function(obj) M3 = obj end)
Citizen.Wait(31)
end
end)
---ESX---
RegisterNetEvent('esx:playerLoaded')
AddEventHandler('esx:playerLoaded',
---M3---
RegisterNetEvent('M3:playerLoaded')
AddEventHandler('M3:playerLoaded',
---ESX---
RegisterNetEvent('esx:setJob')
AddEventHandler('esx:setJob',
---M3---
RegisterNetEvent('M3:setJob')
AddEventHandler('M3:setJob',
---ESX---
ESX.UI.Menu.Open
ESX.UI.Menu.CloseAll()
---M3---
M3.UI.Menu.Open
M3.UI.Menu.CloseAll()
---ESX---
ESX.GetPlayerFromId(src)
---M3---
M3.GetPlayerFromId(src)
---ESX---
ESX.Game.SpawnVehicle()
ESX.Game.GetVehicleProperties()
ESX.Game.GetClosestVehicle()
---M3---
M3.Game.SpawnVehicle()
M3.Game.GetVehicleProperties()
M3.Game.GetClosestVehicle()
---ESX---
ESX.GetPlayerData()
---M3---
M3.GetPlayerData()
---ESX---
ESX.RegisterUsableItem()
---M3---
M3.RegisterUsableItem()
---ESX---
ESX.RegisterServerCallback()
ESX.TriggerServerCallback()
---M3---
M3.RegisterServerCallback()
M3.TriggerServerCallback()
---ESX---
ESX.RegisterServerCallback("gamz-skillsystem:fetchStatus", function(source, cb)
local src = source
local user = ESX.GetPlayerFromId(src)
local fetch = [[
SELECT
skills
FROM
users
WHERE
identifier = @identifier
]]
MySQL.Async.fetchScalar(fetch, {
["@identifier"] = user.identifier
}, function(status)
if status ~= nil then
cb(json.decode(status))
else
cb(nil)
end
end)
end)
---M3---
M3.RegisterServerCallback("gamz-skillsystem:fetchStatus", function(source, cb)
local src = source
local user = M3.GetPlayerFromId(src)
local fetch = [[
SELECT
skills
FROM
users
WHERE
identifier = @identifier
]]
MySQL.Async.fetchScalar(fetch, {
["@identifier"] = user.identifier
}, function(status)
if status ~= nil then
cb(json.decode(status))
else
cb(nil)
end
end)
end)
---ESX---
ESX.ExecuteSql() --(ghmattimysql)
MySQL.Async.execute()
---M3---
M3.ExecuteSql() --(ghmattimysql)
MySQL.Async.execute()