ESX-Heikki / esx_ambulancejob

This file is for Fivem ambulancejob fixed positions
GNU General Public License v3.0
0 stars 0 forks source link

How to get ReviveReward to Society #1

Open SliderKP opened 5 years ago

SliderKP commented 5 years ago

what changes should I make to this code so that the reward money to revive goes to the ambulance society.

RegisterServerEvent('esx_ambulancejob:revive') AddEventHandler('esx_ambulancejob:revive', function(target) local xPlayer = ESX.GetPlayerFromId(source)

if xPlayer.job.name == 'ambulance' then
    xPlayer.addMoney(Config.ReviveReward)
    TriggerClientEvent('esx_ambulancejob:revive', target)
else
    print(('esx_ambulancejob: %s attempted to revive!'):format(xPlayer.identifier))
end

end)

Thankyou

dosammy commented 3 years ago
if xPlayer.job.name == 'ambulance' then
        xPlayer.addMoney(Config.ReviveReward)
        TriggerClientEvent('des_ambulancejob:revive', target)
        TriggerEvent('des_addonaccount:getSharedAccount', 'society_ambulance', function(account)
            account.addMoney(Config.ReviveReward)
        end)
    else
        print(('esx_ambulancejob: %s attempted to revive!'):format(xPlayer.identifier))
    end