-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathmyjailbreak.inc
More file actions
345 lines (268 loc) · 10.5 KB
/
Copy pathmyjailbreak.inc
File metadata and controls
345 lines (268 loc) · 10.5 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
/*
* MyJailbreak - Include File.
* by: shanapu
* https://github.com/shanapu/MyJailbreak/
*
* This file is part of the MyJailbreak SourceMod Plugin.
*
* Copyright (C) 2016-2017 Thomas Schmidt (shanapu)
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
/******************************************************************************
STARTUP
******************************************************************************/
// Defines
#define MYJB_VERSION "Beta 14.0-<COMMIT>"
#define MYJB_URL_LINK "https://github.com/shanapu/MyJailbreak"
#if defined _myjailbreak_included_
#endinput
#endif
#define _myjailbreak_included_
public SharedPlugin __pl_myjailbreak =
{
name = "myjailbreak",
file = "myjailbreak.smx",
#if defined REQUIRE_PLUGIN
required = 1,
#else
required = 0,
#endif
};
#if !defined REQUIRE_PLUGIN
public void __pl_myjailbreak_SetNTVOptional()
{
MarkNativeAsOptional("MyJailbreak_AddEventDay");
MarkNativeAsOptional("MyJailbreak_RemoveEventDay");
MarkNativeAsOptional("MyJailbreak_GetEventDays");
MarkNativeAsOptional("MyJailbreak_SetEventDayName");
MarkNativeAsOptional("MyJailbreak_GetEventDayName");
MarkNativeAsOptional("MyJailbreak_SetEventDayRunning");
MarkNativeAsOptional("MyJailbreak_IsEventDayRunning");
MarkNativeAsOptional("MyJailbreak_SetEventDayPlanned");
MarkNativeAsOptional("MyJailbreak_IsEventDayPlanned");
MarkNativeAsOptional("MyJailbreak_ResetEventDay");
MarkNativeAsOptional("MyJailbreak_SetLastGuardRule");
MarkNativeAsOptional("MyJailbreak_IsLastGuardRule");
MarkNativeAsOptional("MyJailbreak_ActiveLogging");
MarkNativeAsOptional("MyJailbreak_FogOn");
MarkNativeAsOptional("MyJailbreak_FogOff");
MarkNativeAsOptional("MyJailbreak_BeaconOn");
MarkNativeAsOptional("MyJailbreak_BeaconOff");
}
#endif
/*****************************************************************************
FORWARDS
******************************************************************************/
/*********************************************************
* Called when a client trys to join the Guards(CT) or GuardQueue
*
* @param status Client ID
* @return Return Plugin_Handled to block & Plugin_Continue to pass the client.
*********************************************************/
forward Action MyJailbreak_OnJoinGuardQueue(int client);
/*********************************************************
* Called when a the Last Guard Rule is active
*
* @NoReturn
*********************************************************/
forward void MyJailbreak_OnLastGuardRuleStart();
/*********************************************************
* Called when a eventday has started
*
* @param EventDayName The name of the event day
* @NoReturn
*********************************************************/
forward void MyJailbreak_OnEventDayStart(char[] EventDayName);
/*********************************************************
* Called when a eventday has ended
*
* @param EventDayName The name of the event day
* @param winner The winner team of this eventday. 0/1 = no winner
* @NoReturn
*********************************************************/
forward void MyJailbreak_OnEventDayEnd(char[] EventDayName, int winner);
/*********************************************************
* Called when a admin reset/end any planned or running EventDay
*
*
* @NoReturn
*********************************************************/
forward void MyJailbreak_ResetEventDay();
/*********************************************************
* Called before the menu is built, so new item start with 1.
* This is where you can add custom item on menu beginn. See MyJailShop_MenuHandler
*
* @param client client Player's index.
* @param menu Menu being displayed to the client.
* @NoReturn
*********************************************************/
forward void MyJailbreak_MenuStart(int client, Menu menu);
/*********************************************************
* Called after the role specific item are built & before admin item will build.
* This is where you can add custom item on menu end. See MyJailShop_MenuHandler
*
* @param client client Player's index.
* @param menu Menu being displayed to the client.
* @NoReturn
*********************************************************/
forward void MyJailbreak_MenuEnd(int client, Menu menu);
/*********************************************************
* Called once a shop menu item has been selected
* @param menu Menu displayed
* @param action Menu Action
* @param client client index
* @param itemNum selected item number
* @NoReturn
*********************************************************/
forward void MyJailbreak_MenuHandler(Menu menu, MenuAction action, int client, int itemNum);
/*********************************************************
* Called on native MyJailbreak_CheckVIPFlags ONLY when
* CheckCommandAccess return false.
* Feature name refers to plugin VIP Convar.
*
* @param client client index
* @param feature vip feature to check
* @Return true for VIP / false for no VIP
*********************************************************/
forward bool MyJailbreak_OnCheckVIP(int client, char[] feature);
/******************************************************************************
NATIVES
******************************************************************************/
/*********************************************************
* Add a Event Day to myjailbreak core
*
* @param name name of the Event Day
* @NoReturn
*********************************************************/
native int MyJailbreak_AddEventDay(char [] name);
/*********************************************************
* Remove a Event Day to myjailbreak core
*
* @param name name of the Event Day
* @NoReturn
*********************************************************/
native int MyJailbreak_RemoveEventDay(char [] name);
/*********************************************************
* Get a array with all installed Event Days
*
* @param eventdays ArrayList with Event Day names
* @NoReturn
*********************************************************/
native void MyJailbreak_GetEventDays(ArrayList eventdays);
/*********************************************************
* Set the name of the planned/running Event Day
*
* @param name The name of the Event Day
* @NoReturn
*********************************************************/
native void MyJailbreak_SetEventDayName(const char[] name);
/*********************************************************
* Get the name of the planned/running Event Day
*
*
* @Return The name of the Event Day
*********************************************************/
native void MyJailbreak_GetEventDayName(char[] name);
/*********************************************************
* Set Boolean Event Day is running
*
* @param status Boolean is running (true = running)
* @param winner Winning team when event day ends
* @NoReturn
*********************************************************/
native void MyJailbreak_SetEventDayRunning(bool status, int winner);
/*********************************************************
* Check bool Event Day is running
*
*
* @Return true on running, false if not
*********************************************************/
native bool MyJailbreak_IsEventDayRunning();
/*********************************************************
* Set Boolean Event Day is planned
*
* @param status Boolean is planned (true = running)
* @NoReturn
*********************************************************/
native void MyJailbreak_SetEventDayPlanned(bool status);
/*********************************************************
* Check bool Event Day is planned
*
*
* @Return true on planned, false if not
*********************************************************/
native bool MyJailbreak_IsEventDayPlanned();
/*********************************************************
* Set Boolean Last Guard Rule is active
*
* @param status Boolean is active (true = active)
* @NoReturn
*********************************************************/
native void MyJailbreak_SetLastGuardRule(bool status);
/*********************************************************
* Check bool Last Guard Rule is active
*
*
* @Return true on active, false if not
*********************************************************/
native bool MyJailbreak_IsLastGuardRule();
/*********************************************************
* Check bool is logging active
*
*
* @Return true on active, false if not
*********************************************************/
native bool MyJailbreak_ActiveLogging();
/*********************************************************
* Set map fog
*
*
* @noreturn
*********************************************************/
native void MyJailbreak_FogOn();
/*********************************************************
* Remove a map fog
*
*
* @noreturn
*********************************************************/
native void MyJailbreak_FogOff();
/*********************************************************
* Set client Beacon
*
*
* @noreturn
*********************************************************/
native void MyJailbreak_BeaconOn(int client, float interval);
/*********************************************************
* Remove client Beacon (auto remove on mapend/playerdeath/roundend)
*
*
* @noreturn
*********************************************************/
native void MyJailbreak_BeaconOff(int client);
/*********************************************************
* Check bool if player is VIP -> this native calls the
* forward MyJailbreak_CheckVIP
*
* @param client client index to check
* @param command overwrite command name
* @param flags flag string if the command or
* override is not found.
* @param feature feature name to check with
* MyJailbreak_OnCheckVIPFlags when
* CheckCommandAccess return false
* @Return true on allow, false if not
*********************************************************/
native bool MyJailbreak_CheckVIPFlags(int client, const char[] command, ConVar flags, char[] feature);