-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathclient.lua
More file actions
54 lines (48 loc) · 1.34 KB
/
Copy pathclient.lua
File metadata and controls
54 lines (48 loc) · 1.34 KB
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
local DeletePed = DeletePed
station = nil
player = {}
player.nearStation = false
local stations = {}
for index, station in pairs(Config.PoliceStations) do
local cfg = station
-- Creating blip
if cfg.blip.enable then
utils.createBlip(cfg.blip)
end
-- Zones
stations[#stations + 1] = lib.zones.box({
name = 'police',
coords = cfg.zone.pos,
size = cfg.zone.size,
clothes = Config.ClothingScript and cfg.clothes,
rotation = 0.0,
onEnter = function(self)
station = station
if self.clothes then
initClothes(self.clothes, station.jobs)
end
cfg.armory.jobs = station.jobs
initArmory(cfg.armory)
initGarage(cfg.garage, station.jobs)
player.nearStation = true
end,
onExit = function(self)
for k, v in pairs(peds) do
if DoesEntityExist(v) then
DeletePed(v)
end
end
player.nearStation = false
end
})
end
AddEventHandler('onResourceStop', function(resourceName)
if GetCurrentResourceName() ~= resourceName then
return
end
for k, v in pairs(peds) do
if DoesEntityExist(v) then
DeletePed(v)
end
end
end)