mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-01 18:58:54 +00:00
Add NPC jobs
This commit is contained in:
@@ -233,6 +233,27 @@ AddEventHandler('esx_mecanojob:stopCraft3', function()
|
||||
PlayersCrafting3[_source] = false
|
||||
end)
|
||||
|
||||
---------------------------- NPC Job Earnings ------------------------------------------------------
|
||||
|
||||
RegisterServerEvent('esx_mecanojob:onNPCJobMissionCompleted')
|
||||
AddEventHandler('esx_mecanojob:onNPCJobMissionCompleted', function()
|
||||
|
||||
local _source = source
|
||||
local xPlayer = ESX.GetPlayerFromId(_source)
|
||||
local total = math.random(Config.NPCJobEarnings.min, Config.NPCJobEarnings.max);
|
||||
|
||||
if xPlayer.job.grade >= 3 then
|
||||
total = total * 2
|
||||
end
|
||||
|
||||
TriggerEvent('esx_addonaccount:getSharedAccount', 'society_mecano', function(account)
|
||||
account.addMoney(total)
|
||||
end)
|
||||
|
||||
TriggerClientEvent("esx:showNotification", _source, "Votre société a ~g~gagné~s~ ~g~$".. total)
|
||||
|
||||
end)
|
||||
|
||||
---------------------------- register usable item --------------------------------------------------
|
||||
ESX.RegisterUsableItem('blowpipe', function(source)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user