Skip to content

Commit

Permalink
Update Main.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
TinusNL committed Jan 5, 2021
1 parent 622efb9 commit 7e0df0c
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions esx_technician/Server/Main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,15 @@ ESX = nil
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)

RegisterServerEvent('esx_technician:PayMoney')
AddEventHandler('esx_technician:PayMoney', function(CurrentJob)
AddEventHandler('esx_technician:PayMoney', function()
xPlayer = ESX.GetPlayerFromId(source)
PlayerCoords = xPlayer.getCoords(true)
JobCoords = vector3(CurrentJob.X, CurrentJob.Y, CurrentJob.Z)
PlayerJob = xPlayer.getJob()


if Vdist2(PlayerCoords, JobCoords) <= 1.5 then
if PlayerJob.name == "technician" then
if Config.MoneyType == true then
xPlayer.addMoney(Config.MoneyAmount)
else
xPlayer.addAccountMoney('bank', Config.MoneyAmount)
end
if PlayerJob.name == "technician" then
if Config.MoneyType == true then
xPlayer.addMoney(Config.MoneyAmount)
else
xPlayer.addAccountMoney('bank', Config.MoneyAmount)
end
end
end)
end)

0 comments on commit 7e0df0c

Please sign in to comment.