AMXX-BG.INFO zombieplaguenew1.3.inc Raw include

zombieplaguenew1.3.inc

Original include source with line numbers.

Back Download .inc
1 /*================================================================================
2
3 -------------------------------------------------------
4 -*- Zombie Plague 4.3 + New Modes 1.3 Includes File -*-
5 -------------------------------------------------------
6
7 -------------------------------------------------------
8 -*- Dont use this include file for your plugins -*-
9 -*- This file is for backwards compatibility only. -*-
10 -*- Use the zombie_plague_advance.inc file insteead -*-
11 -------------------------------------------------------
12
13 =================================================================================*/
14
15 #if defined _zombieplague_included
16 #endinput
17 #endif
18 #define _zombieplague_included
19
20 /* Teams for zp_register_extra_item() */
21 #define ZP_TEAM_ZOMBIE (1<<0)
22 #define ZP_TEAM_HUMAN (1<<1)
23 #define ZP_TEAM_NEMESIS (1<<2)
24 #define ZP_TEAM_SURVIVOR (1<<3)
25 #define ZP_TEAM_SNIPER (1<<4)
26 #define ZP_TEAM_ASSASSIN (1<<5)
27
28 /* Game modes for zp_round_started() */
29 enum
30 {
31 MODE_INFECTION = 1,
32 MODE_NEMESIS,
33 MODE_SURVIVOR,
34 MODE_SWARM,
35 MODE_MULTI,
36 MODE_PLAGUE,
37 MODE_SNIPER,
38 MODE_ASSASSIN,
39 MODE_LNJ
40 }
41
42 /* Winner teams for zp_round_ended() */
43 enum
44 {
45 WIN_NO_ONE = 0,
46 WIN_ZOMBIES,
47 WIN_HUMANS
48 }
49
50 /* Custom forward return values */
51 #define ZP_PLUGIN_HANDLED 97
52
53 /**
54 * Returns whether a player is a zombie.
55 *
56 * @param id Player index.
57 * @return True if it is, false otherwise.
58 */
59 native zp_get_user_zombie(id)
60
61 /**
62 * Returns whether a player is a nemesis.
63 *
64 * @param id Player index.
65 * @return True if it is, false otherwise.
66 */
67 native zp_get_user_nemesis(id)
68
69 /**
70 * Returns whether a player is a survivor.
71 *
72 * @param id Player index.
73 * @return True if it is, false otherwise.
74 */
75 native zp_get_user_survivor(id)
76
77 /**
78 * Returns whether a player is the first zombie.
79 *
80 * @param id Player index.
81 * @return True if it is, false otherwise.
82 */
83 native zp_get_user_first_zombie(id)
84
85 /**
86 * Returns whether a player is the last zombie.
87 *
88 * @param id Player index.
89 * @return True if it is, false otherwise.
90 */
91 native zp_get_user_last_zombie(id)
92
93 /**
94 * Returns whether a player is the last human.
95 *
96 * @param id Player index.
97 * @return True if it is, false otherwise.
98 */
99 native zp_get_user_last_human(id)
100
101 /**
102 * Returns a player's current zombie class ID.
103 *
104 * @param id Player index.
105 * @return Internal zombie class ID, or -1 if not yet chosen.
106 */
107 native zp_get_user_zombie_class(id)
108
109 /**
110 * Returns a player's next zombie class ID (for the next infection).
111 *
112 * @param id Player index.
113 * @return Internal zombie class ID, or -1 if not yet chosen.
114 */
115 native zp_get_user_next_class(id)
116
117 /**
118 * Sets a player's next zombie class ID (for the next infection).
119 *
120 * @param id Player index.
121 * @param classid A valid zombie class ID.
122 * @return True on success, false otherwise.
123 */
124 native zp_set_user_zombie_class(id, classid)
125
126 /**
127 * Returns a player's ammo pack count.
128 *
129 * @param id Player index.
130 * @return Number of ammo packs owned.
131 */
132 native zp_get_user_ammo_packs(id)
133
134 /**
135 * Sets a player's ammo pack count.
136 *
137 * @param id Player index.
138 * @param amount New quantity of ammo packs owned.
139 */
140 native zp_set_user_ammo_packs(id, amount)
141
142 /**
143 * Returns the default maximum health of a zombie.
144 *
145 * Note: Takes into account first zombie's HP multiplier.
146 *
147 * @param id Player index.
148 * @return Maximum amount of health points, or -1 if not a normal zombie.
149 */
150 native zp_get_zombie_maxhealth(id)
151
152 /**
153 * Returns a player's custom flashlight batteries charge.
154 *
155 * @param id Player index.
156 * @return Charge percent (0 to 100).
157 */
158 native zp_get_user_batteries(id)
159
160 /**
161 * Sets a player's custom flashlight batteries charge.
162 *
163 * @param id Player index.
164 * @param value New charge percent (0 to 100).
165 */
166 native zp_set_user_batteries(id, charge)
167
168 /**
169 * Returns whether a player has night vision.
170 *
171 * @param id Player index.
172 * @return True if it has, false otherwise.
173 */
174 native zp_get_user_nightvision(id)
175
176 /**
177 * Sets whether a player has night vision.
178 *
179 * @param id Player index.
180 * @param set True to give, false for removing it.
181 */
182 native zp_set_user_nightvision(id, set)
183
184 /**
185 * Forces a player to become a zombie.
186 *
187 * Note: Unavailable for last human/survivor/sniper.
188 *
189 * @param id Player index to be infected.
190 * @param infector Player index who infected him (optional).
191 * @param silent If set, there will be no HUD messages or infection sounds.
192 * @param rewards Whether to show DeathMsg and reward frags, hp, and ammo packs to infector.
193 * @return True on success, false otherwise.
194 */
195 native zp_infect_user(id, infector = 0, silent = 0, rewards = 0)
196
197 /**
198 * Forces a player to become a human.
199 *
200 * Note: Unavailable for last zombie/nemesis.
201 *
202 * @param id Player index to be cured.
203 * @param silent If set, there will be no HUD messages or antidote sounds.
204 * @return True on success, false otherwise.
205 */
206 native zp_disinfect_user(id, silent = 0)
207
208 /**
209 * Forces a player to become a nemesis.
210 *
211 * Note: Unavailable for last human/survivor/sniper.
212 *
213 * @param id Player index to turn into nemesis.
214 * @return True on success, false otherwise.
215 */
216 native zp_make_user_nemesis(id)
217
218 /**
219 * Forces a player to become a survivor.
220 *
221 * Note: Unavailable for last zombie/nemesis.
222 *
223 * @param id Player index to turn into survivor.
224 * @return True on success, false otherwise.
225 */
226 native zp_make_user_survivor(id)
227
228 /**
229 * Respawns a player into a specific team.
230 *
231 * @param id Player index to be respawned.
232 * @param team Team to respawn the player into (ZP_TEAM_ZOMBIE or ZP_TEAM_HUMAN).
233 * @return True on success, false otherwise.
234 */
235 native zp_respawn_user(id, team)
236
237 /**
238 * Forces a player to buy an extra item.
239 *
240 * @param id Player index.
241 * @param itemid A valid extra item ID.
242 * @param ignorecost If set, item's cost won't be deduced from player.
243 * @return True on success, false otherwise.
244 */
245 native zp_force_buy_extra_item(id, itemid, ignorecost = 0)
246
247 /**
248 * Returns whether a player is a sniper.
249 *
250 * @param id Player index.
251 * @return True if it is, false otherwise.
252 */
253 native zp_get_user_sniper(id)
254
255 /**
256 * Forces a player to become a sniper.
257 *
258 * Note: Unavailable for last zombie/nemesis/assassin.
259 *
260 * @param id Player index to turn into sniper.
261 * @return True on success, false otherwise.
262 */
263 native zp_make_user_sniper(id)
264
265 /**
266 * Returns whether a player is an assassin.
267 *
268 * @param id Player index.
269 * @return True if it is, false otherwise.
270 */
271 native zp_get_user_assassin(id)
272
273 /**
274 * Forces a player to become a assassin.
275 *
276 * Note: Unavailable for last human/survivor/sniper.
277 *
278 * @param id Player index to turn into assassin.
279 * @return True on success, false otherwise.
280 */
281 native zp_make_user_assassin(id)
282
283 /**
284 * Returns whether the ZP round has started, i.e. first zombie
285 * has been chosen or a game mode has begun.
286 *
287 * @return 0 - Round not started
288 * 1 - Round started
289 * 2 - Round starting
290 */
291 native zp_has_round_started()
292
293 /**
294 * Returns whether the current round is a nemesis round.
295 *
296 * @return True if it is, false otherwise.
297 */
298 native zp_is_nemesis_round()
299
300 /**
301 * Returns whether the current round is a survivor round.
302 *
303 * @return True if it is, false otherwise.
304 */
305 native zp_is_survivor_round()
306
307 /**
308 * Returns whether the current round is a swarm round.
309 *
310 * @return True if it is, false otherwise.
311 */
312 native zp_is_swarm_round()
313
314 /**
315 * Returns whether the current round is a plague round.
316 *
317 * @return True if it is, false otherwise.
318 */
319 native zp_is_plague_round()
320
321 /**
322 * Returns whether the current round is a Armageddon round.
323 *
324 * @return True if it is, false otherwise.
325 */
326 native zp_is_lnj_round()
327
328 /**
329 * Returns number of alive zombies.
330 *
331 * @return Zombie count.
332 */
333 native zp_get_zombie_count()
334
335 /**
336 * Returns number of alive humans.
337 *
338 * @return Human count.
339 */
340 native zp_get_human_count()
341
342 /**
343 * Returns number of alive nemesis.
344 *
345 * @return Nemesis count.
346 */
347 native zp_get_nemesis_count()
348
349 /**
350 * Returns number of alive survivors.
351 *
352 * @return Survivor count.
353 */
354 native zp_get_survivor_count()
355
356 /**
357 * Returns whether the current round is a sniper round.
358 *
359 * @return True if it is, false otherwise.
360 */
361 native zp_is_sniper_round()
362
363 /**
364 * Returns whether the current round is a assassin round.
365 *
366 * @return True if it is, false otherwise.
367 */
368 native zp_is_assassin_round()
369
370 /**
371 * Returns number of alive snipers.
372 *
373 * @return Sniper count.
374 */
375 native zp_get_sniper_count()
376
377 /**
378 * Returns number of alive assassins.
379 *
380 * @return Assassin count.
381 */
382 native zp_get_assassin_count()
383
384
385 /**
386 * Registers a custom item which will be added to the extra items menu of ZP.
387 *
388 * Note: The returned extra item ID can be later used to catch item
389 * purchase events for the zp_extra_item_selected() forward.
390 *
391 * Note: ZP_TEAM_NEMESIS, ZP_TEAM_SURVIVOR, ZP_TEAM_ASSASSIN and ZP_TEAM_SNIPER
392 * can be used to make an item available to Nemesis,
393 * Survivors, Assassins and Snipers.
394 *
395 * @param name Caption to display on the menu.
396 * @param cost Ammo packs to be deducted on purchase.
397 * @param teams Bitsum of teams it should be available for.
398 * @return An internal extra item ID, or -1 on failure.
399 */
400 native zp_register_extra_item(const name[], cost, teams)
401
402 /**
403 * Registers a custom class which will be added to the zombie classes menu of ZP.
404 *
405 * Note: The returned zombie class ID can be later used to identify
406 * the class when calling the zp_get_user_zombie_class() natives.
407 *
408 * @param name Caption to display on the menu.
409 * @param info Brief description of the class.
410 * @param model Player model to be used.
411 * @param clawmodel Claws model to be used.
412 * @param hp Initial health points.
413 * @param speed Maximum speed.
414 * @param gravity Gravity multiplier.
415 * @param knockback Knockback multiplier.
416 * @return An internal zombie class ID, or -1 on failure.
417 */
418 native zp_register_zombie_class(const name[], const info[], const model[], const clawmodel[], hp, speed, Float:gravity, Float:knockback)
419
420 /**
421 * Returns an extra item's ID.
422 *
423 * @param name Item name to look for.
424 * @return Internal extra item ID, or -1 if not found.
425 */
426 native zp_get_extra_item_id(const name[])
427
428 /**
429 * Returns a zombie class' ID.
430 *
431 * @param name Class name to look for.
432 * @return Internal zombie class ID, or -1 if not found.
433 */
434 native zp_get_zombie_class_id(const name[])
435
436 /**
437 * Called when the ZP round starts, i.e. first zombie
438 * is chosen or a game mode begins.
439 *
440 * @param gamemode Mode which has started.
441 * @param id Affected player's index (if applicable).
442 */
443 forward zp_round_started(gamemode, id)
444
445 /**
446 * Called when the round ends.
447 *
448 * @param winteam Team which has won the round.
449 */
450 forward zp_round_ended(winteam)
451
452 /**
453 * Called when a player gets infected.
454 *
455 * @param id Player index who was infected.
456 * @param infector Player index who infected him (if applicable).
457 * @param nemesis Whether the player was turned into a nemesis.
458 */
459 forward zp_user_infected_pre(id, infector, nemesis)
460 forward zp_user_infected_post(id, infector, nemesis)
461
462 /**
463 * Called when a player turns back to human.
464 *
465 * @param id Player index who was cured.
466 * @param survivor Whether the player was turned into a survivor.
467 */
468 forward zp_user_humanized_pre(id, survivor)
469 forward zp_user_humanized_post(id, survivor)
470 forward zp_user_humanized_pre(id, sniper)
471 forward zp_user_humanized_post(id, sniper)
472
473 /**
474 * Called on a player infect/cure attempt. You can use this to block
475 * an infection/humanization by returning ZP_PLUGIN_HANDLED in your plugin.
476 *
477 * Note: Right now this is only available after the ZP round starts, since some
478 * situations (like blocking a first zombie's infection) are not yet handled.
479 */
480 forward zp_user_infect_attempt(id, infector, nemesis)
481 forward zp_user_humanize_attempt(id, survivor)
482 forward zp_user_humanize_attempt(id, sniper)
483
484 /**
485 * Called when a player buys an extra item from the ZP menu.
486 *
487 * Note: You can now return ZP_PLUGIN_HANDLED in your plugin to block
488 * the purchase and the player will be automatically refunded.
489 *
490 * @param id Player index of purchaser.
491 * @param itemid Internal extra item ID.
492 */
493 forward zp_extra_item_selected(id, itemid)
494
495 /**
496 * Called when a player gets unfrozen (frostnades).
497 *
498 * @param id Player index.
499 */
500 forward zp_user_unfrozen(id)
501
502 /**
503 * Called when a player becomes the last zombie.
504 *
505 * Note: This is called for the first zombie too.
506 *
507 * @param id Player index.
508 */
509 forward zp_user_last_zombie(id)
510
511 /**
512 * Called when a player becomes the last human.
513 *
514 * @param id Player index.
515 */
516 forward zp_user_last_human(id)
517
518
519 /**
520 * @deprecated - Do not use!
521 * For backwards compatibility only.
522 */
523 #define ZP_TEAM_ANY 0
524