This repository has been archived by the owner on Oct 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
server.lua
94 lines (83 loc) · 2.99 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
ESX = nil
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
RegisterServerEvent('weed:check')
AddEventHandler('weed:check', function(_)
local player = ESX.GetPlayerFromId(source)
if not player.job.name or player.job.name ~= Config.JobId then
TriggerClientEvent('weed:enter', source)
else
TriggerClientEvent('jobfail:notify', source)
end
end)
RegisterServerEvent('counterfeit:check')
AddEventHandler('counterfeit:check', function(_)
local player = ESX.GetPlayerFromId(source)
if not player.job.name or player.job.name ~= Config.JobId then
TriggerClientEvent('counterfeit:enter', source)
else
TriggerClientEvent('jobfail:notify', source)
end
end)
RegisterServerEvent('documents:check')
AddEventHandler('documents:check', function(_)
local player = ESX.GetPlayerFromId(source)
if not player.job.name or player.job.name ~= Config.JobId then
TriggerClientEvent('documents:enter', source)
else
TriggerClientEvent('jobfail:notify', source)
end
end)
RegisterServerEvent('meth:check')
AddEventHandler('meth:check', function(_)
local player = ESX.GetPlayerFromId(source)
if not player.job.name or player.job.name ~= Config.JobId then
TriggerClientEvent('meth:enter', source)
else
TriggerClientEvent('jobfail:notify', source)
end
end)
RegisterServerEvent('coke:check')
AddEventHandler('coke:check', function(_)
local player = ESX.GetPlayerFromId(source)
if not player.job.name or player.job.name ~= Config.JobId then
TriggerClientEvent('coke:enter', source)
else
TriggerClientEvent('jobfail:notify', source)
end
end)
RegisterServerEvent('bike:check')
AddEventHandler('bike:check', function(_)
local player = ESX.GetPlayerFromId(source)
if not player.job.name or player.job.name ~= Config.JobId then
TriggerClientEvent('bike:enter', source)
else
TriggerClientEvent('jobfail:notify', source)
end
end)
RegisterServerEvent('bike2:check')
AddEventHandler('bike2:check', function(_)
local player = ESX.GetPlayerFromId(source)
if not player.job.name or player.job.name ~= Config.JobId then
TriggerClientEvent('bike2:enter', source)
else
TriggerClientEvent('jobfail:notify', source)
end
end)
RegisterServerEvent('bunker:check')
AddEventHandler('bunker:check', function(_)
local player = ESX.GetPlayerFromId(source)
if not player.job.name or player.job.name ~= Config.JobId then
TriggerClientEvent('bunker:enter', source)
else
TriggerClientEvent('jobfail:notify', source)
end
end)
RegisterServerEvent('doomsday:check')
AddEventHandler('doomsday:check', function(_)
local player = ESX.GetPlayerFromId(source)
if not player.job.name or player.job.name ~= Config.JobId then
TriggerClientEvent('doomsday:enter', source)
else
TriggerClientEvent('jobfail:notify', source)
end
end)