-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.lua
More file actions
140 lines (126 loc) · 3.99 KB
/
script.lua
File metadata and controls
140 lines (126 loc) · 3.99 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
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
require("util.url")
-- IMPORTANT: Replace this value with your actual API key
key = urlencode("server")
require("base")
require("tracking.player_tracking")
require("tracking.vehicle_tracking")
require("management.vehicles")
require("management.vehicle_labels")
require("management.antisteal")
require("management.antilag")
require("management.vehicle_limits")
--require("management.dmz")
require("management.jail")
require("util.help")
require("management.autoauth")
require("management.moderation")
require("management.radiation_clean")
require("management.antiflare")
require("management.daemon")
require("util.commands")
-- Module order defines execution order. Put dependancies first.
-- Module key must match playlist xml name in playlist_xml folder (if zones or vehicles are needed for the module)
-- example: "playlist_xml/jail.xml"
-- It must also match for vehicle files in vehicle_xml folder
-- example: "vehicle_xml/jail_1.xml"
modules={
{help=Help},
{vehicle_tracking=VehicleTracking},
{player_tracking=PlayerTracking},
{vehicle_labels=VehicleLabels},
{vehicle_management=VehicleManagement},
{antisteal=AntiSteal},
{vehicle_limits=VehicleLimits},
{antilag=AntiLag},
{dmz=DMZ},
{jail=Jail},
{autoauth=AutoAuth},
{moderation=Moderation},
{radiation_clean=RadiationClean},
{antiflare=AntiFlare},
{daemon=Daemon},
{commands=Commands}
}
function onCreate(is_world_create)
for _, mod in ipairs(modules) do
for _, f in pairs(mod) do
f()
end
end
if hook_funcs[hooks.onCreate] then
for _, f in ipairs(hook_funcs[hooks.onCreate]) do
f(is_world_create)
end
end
end
function onTick(game_ticks)
if hook_funcs[hooks.onTick] then
for _, f in ipairs(hook_funcs[hooks.onTick]) do
f(game_ticks)
end
end
end
function onChatMessage(user_peer_id, sender_name, message)
if hook_funcs[hooks.onChatMessage] then
for _, f in ipairs(hook_funcs[hooks.onChatMessage]) do
f(user_peer_id, sender_name, message)
end
end
end
function onPlayerJoin(steam_id, name, peer_id, is_admin, is_auth)
if hook_funcs[hooks.onPlayerJoin] then
for _, f in ipairs(hook_funcs[hooks.onPlayerJoin]) do
f(steam_id, name, peer_id, is_admin, is_auth)
end
end
end
function onPlayerLeave(steam_id, name, peer_id, is_admin, is_auth)
if hook_funcs[hooks.onPlayerLeave] then
for _, f in ipairs(hook_funcs[hooks.onPlayerLeave]) do
f(steam_id, name, peer_id, is_admin, is_auth)
end
end
end
function onVehicleSpawn(vehicle_id, peer_id, x, y, z, group_cost, group_id)
if hook_funcs[hooks.onVehicleSpawn] then
for _, f in ipairs(hook_funcs[hooks.onVehicleSpawn]) do
f(vehicle_id, peer_id, x, y, z, group_cost, group_id)
end
end
end
function onGroupSpawn(group_id, peer_id, x, y, z, group_cost)
if hook_funcs[hooks.onGroupSpawn] then
for _, f in ipairs(hook_funcs[hooks.onGroupSpawn]) do
f(group_id, peer_id, x, y, z, group_cost)
end
end
end
function onVehicleLoad(vehicle_id)
if hook_funcs[hooks.onVehicleLoad] then
for _, f in ipairs(hook_funcs[hooks.onVehicleLoad]) do
f(vehicle_id)
end
end
end
function onVehicleDespawn(vehicle_id, peer_id)
if hook_funcs[hooks.onVehicleDespawn] then
for _, f in ipairs(hook_funcs[hooks.onVehicleDespawn]) do
f(vehicle_id, peer_id)
end
end
end
function onCustomCommand(full_message, user_peer_id, is_admin, is_auth, command, ...)
local args = {...}
if hook_funcs[hooks.onCustomCommand] then
for _, f in ipairs(hook_funcs[hooks.onCustomCommand]) do
f(full_message, user_peer_id, is_admin, is_auth, command, args)
end
end
end
function httpReply(port, request, reply)
if hook_funcs[hooks.httpReply] then
for _, f in ipairs(hook_funcs[hooks.httpReply]) do
f(port, request, reply)
end
end
end