-
Notifications
You must be signed in to change notification settings - Fork 11
/
server.lua
41 lines (30 loc) · 1.28 KB
/
server.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
if Config.framework == 'esx' then
ESX = nil
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
RegisterServerEvent('Roda-Electricista:PayJob')
AddEventHandler('Roda-Electricista:PayJob', function(money, can)
local src = source
if can == 'sdafghjrehrw2345dfe' then
local xPlayer = ESX.GetPlayerFromId(src)
xPlayer.addAccountMoney(Config.Account, money)
else
DropPlayer(src, 'Bye, Bye Cheater')
end
end)
elseif Config.framework == 'qbcore' then
local QBCore = exports['qb-core']:GetCoreObject()
RegisterServerEvent('Roda-Electricista:PayJob')
AddEventHandler('Roda-Electricista:PayJob', function(money, can)
local src = source
if Config.framework == 'qbcore' then
if can == 'sdafghjrehrw2345dfe' then
local xPlayer = QBCore.Functions.GetPlayer(src)
xPlayer.Functions.AddMoney('cash', money, 'Pay Job')
else
DropPlayer(src, 'Bye, Bye Cheater')
end
end
end)
end
-----------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------