-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.lua
More file actions
26 lines (23 loc) · 804 Bytes
/
server.lua
File metadata and controls
26 lines (23 loc) · 804 Bytes
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
CreateThread(function()
while true do
local xPlayers = ESX.GetPlayers()
for i = 1, #xPlayers, 1 do
local xPlayer = ESX.GetPlayerFromId(xPlayers[i])
if not xPlayer or not xPlayer.job or not xPlayer.job.name then goto next end
local configJob = Config.Jobs[xPlayer.job.name]
if not configJob then goto next end
local allowed = true
if configJob.distMin then
local coords = xPlayer.getCoords()
if #(vector3(coords.x, coords.y, coords.z) - configJob.pos) > configJob.dist then
xPlayer.showNotification(Config.Language.NotReceived)
goto next
end
end
xPlayer.addAccountMoney("bank", xPlayer.job.grade_salary)
xPlayer.showNotification(Config.Language.Received)
::next::
end
Wait(60 * 1000 * Config.Interval)
end
end)