forked from Simnation/Main
ed
This commit is contained in:
parent
600d79af31
commit
5d11084641
136 changed files with 12007 additions and 584 deletions
28
resources/[freizeit]/[gym]/mz-skills/client/main.lua
Normal file
28
resources/[freizeit]/[gym]/mz-skills/client/main.lua
Normal file
|
@ -0,0 +1,28 @@
|
|||
local QBCore = exports['qb-core']:GetCoreObject()
|
||||
|
||||
RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function()
|
||||
Citizen.CreateThread(function()
|
||||
FetchSkills()
|
||||
while true do
|
||||
local seconds = Config.UpdateFrequency * 1000
|
||||
Citizen.Wait(seconds)
|
||||
for skill, value in pairs(Config.Skills) do
|
||||
UpdateSkill(skill, value["RemoveAmount"])
|
||||
end
|
||||
TriggerServerEvent("skillsystem:update", json.encode(Config.Skills))
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterNetEvent('QBCore:Client:OnPlayerUnload', function()
|
||||
for skill, value in pairs(Config.Skills) do
|
||||
Config.Skills[skill]["Current"] = 0
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
AddEventHandler('onResourceStart', function(resource)
|
||||
if resource == GetCurrentResourceName() then
|
||||
Wait(100)
|
||||
FetchSkills()
|
||||
end
|
||||
end)
|
Loading…
Add table
Add a link
Reference in a new issue