Skip to content

Commit

Permalink
Update v1.4
Browse files Browse the repository at this point in the history
* Added Society Money after Revive
  • Loading branch information
Musiker15 committed Mar 19, 2024
1 parent 36f7ed1 commit 38cbb87
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3
1.4
7 changes: 7 additions & 0 deletions config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,20 @@ Config.ReviveChance = {
tryagain = false, -- Set to true if the NPC should try it again if he failed
howOften = 3, -- If NPC failed to revive the player then he tries up to 3 times more
}

-- You will need esx_addonaccount for that!
Config.Society = {
enable = true, -- Set false if you don't want that the Config.RevivePrice will be added to a society account
account = 'society_ambulance'
}
----------------------------------------------------------------
Config.VisnAre = GetResourceState("visn_are") ~= "missing"
----------------------------------------------------------------
Config.Jobs = {
amount = 0,
jobs = {
'ambulance',
'fire_department',
}
}
----------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ games { 'gta5' }
author 'Musiker15 - MSK Scripts'
name 'msk_aimedic'
description 'AI Medic NPC'
version '1.3'
version '1.4'

lua54 'yes'

Expand Down
8 changes: 8 additions & 0 deletions server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ AddEventHandler('msk_aimedic:removeMoney', function()

if cash < Config.RevivePrice then account = 'bank' end
xPlayer.removeAccountMoney(account, Config.RevivePrice)

if Config.Society.enable then
TriggerEvent('esx_addonaccount:getSharedAccount', Config.Society.account, function(account)
if not account then return print(('^1Society %s not found on Event ^2 msk_aimedic:removeMoney ^0'):format(Config.Society.account)) end
account.addMoney(Config.RevivePrice)
end)
end

sendDiscordLog(xPlayer)
end)

Expand Down

0 comments on commit 38cbb87

Please sign in to comment.