zombie_plague_special.inc

Original include source with line numbers.

Back Download .inc
1 #if defined _zombie_special_new_included
2 #endinput
3 #endif
4 #define _zombie_special_new_included
5
6 #define ZPS_INC_VERSION 40 // Include Version
7
8 /* Teams for zp_register_extra_item() */
9 #define ZP_TEAM_ZOMBIE (1<<0)
10 #define ZP_TEAM_HUMAN (1<<1)
11 #define ZP_TEAM_NEMESIS (1<<2)
12 #define ZP_TEAM_SURVIVOR (1<<3)
13 #define ZP_TEAM_SNIPER (1<<4)
14 #define ZP_TEAM_ASSASSIN (1<<5)
15 #define ZP_TEAM_BERSERKER (1<<6)
16 #define ZP_TEAM_PREDATOR (1<<7)
17 #define ZP_TEAM_WESKER = (1<<8)
18 #define ZP_TEAM_BOMBARDIER = (1<<9)
19 #define ZP_TEAM_SPY = (1<<10)
20 #define ZP_TEAM_DRAGON = (1<<11)
21
22 /* Death Match modes for zp_register_game_mode */
23 enum
24 {
25 ZP_DM_NONE = 0, // Disable death match during the custom mode round
26 ZP_DM_HUMAN, // Respawn as human only
27 ZP_DM_ZOMBIE, // Respawn as zombie only
28 ZP_DM_RANDOM, // Respawn randomly as humans or zombies
29 ZP_DM_BALANCE // Respawn as humans or zombies to keep both team balanced
30 }
31
32 enum
33 {
34 EXTRA_NVISION = 0,
35 EXTRA_ANTIDOTE,
36 EXTRA_MADNESS,
37 EXTRA_INFBOMB,
38 EXTRA_WEAPONS_STARTID
39 }
40
41 enum {
42 ZOMBIE = 0,
43 NEMESIS,
44 ASSASSIN,
45 PREDATOR,
46 BOMBARDIER,
47 DRAGON
48 }
49 enum {
50 HUMAN = 0,
51 SURVIVOR,
52 SNIPER,
53 BERSERKER,
54 WESKER,
55 SPY
56 }
57
58 /* Game modes for zp_round_started() */
59 enum
60 {
61 MODE_NONE = 0,
62 MODE_INFECTION,
63 MODE_NEMESIS,
64 MODE_ASSASSIN,
65 MODE_PREDATOR,
66 MODE_BOMBARDIER,
67 MODE_DRAGON,
68 MODE_SURVIVOR,
69 MODE_SNIPER,
70 MODE_BERSERKER,
71 MODE_WESKER,
72 MODE_SPY,
73 MODE_SWARM,
74 MODE_MULTI,
75 MODE_PLAGUE,
76 MODE_LNJ
77 }
78
79 /* Winner teams for zp_round_ended() */
80 enum
81 {
82 WIN_NO_ONE = 0,
83 WIN_ZOMBIES,
84 WIN_HUMANS
85 }
86
87 /* Use For zp_set_user_frozen and zp_set_user_burn natives */
88 enum {
89 UNSET = 0,
90 SET,
91 SET_WITHOUT_IMMUNIT
92 }
93
94 /* Use For zp_get_special_count and zp_make_user_special native*/
95 enum {
96 GET_HUMAN = 0,
97 GET_ZOMBIE
98 }
99
100 /* Custom forward return values */
101 #define ZP_PLUGIN_HANDLED 97
102 #define ZP_PLUGIN_SUPERCEDE 98
103
104 /**
105 * Returns whether a player is a zombie.
106 *
107 * @param id Player index.
108 * @return True if it is, false otherwise.
109 */
110 native zp_get_user_zombie(id)
111
112 /**
113 * Returns whether a player is a nemesis.
114 *
115 * @param id Player index.
116 * @return True if it is, false otherwise.
117 */
118 native zp_get_user_nemesis(id)
119
120 /**
121 * Returns whether a player is a survivor.
122 *
123 * @param id Player index.
124 * @return True if it is, false otherwise.
125 */
126 native zp_get_user_survivor(id)
127
128 /**
129 * Returns whether a player is the first zombie.
130 *
131 * @param id Player index.
132 * @return True if it is, false otherwise.
133 */
134 native zp_get_user_first_zombie(id)
135
136 /**
137 * Returns whether a player is the last zombie.
138 *
139 * @param id Player index.
140 * @return True if it is, false otherwise.
141 */
142 native zp_get_user_last_zombie(id)
143
144 /**
145 * Returns whether a player is the last human.
146 *
147 * @param id Player index.
148 * @return True if it is, false otherwise.
149 */
150 native zp_get_user_last_human(id)
151
152 /**
153 * Returns a player's current zombie class ID.
154 *
155 * @param id Player index.
156 * @return Internal zombie class ID, or -1 if not yet chosen.
157 */
158 native zp_get_user_zombie_class(id)
159
160 /**
161 * Returns a player's next zombie class ID (for the next infection).
162 *
163 * @param id Player index.
164 * @return Internal zombie class ID, or -1 if not yet chosen.
165 */
166 native zp_get_user_next_class(id)
167
168 /**
169 * Sets a player's next zombie class ID (for the next infection).
170 *
171 * @param id Player index.
172 * @param classid A valid zombie class ID.
173 * @return True on success, false otherwise.
174 */
175 native zp_set_user_zombie_class(id, classid)
176
177 /**
178 * Returns a player's ammo pack count.
179 *
180 * @param id Player index.
181 * @return Number of ammo packs owned.
182 */
183 native zp_get_user_ammo_packs(id)
184
185 /**
186 * Sets a player's ammo pack count.
187 *
188 * @param id Player index.
189 * @param amount New quantity of ammo packs owned.
190 */
191 native zp_set_user_ammo_packs(id, amount)
192
193 /**
194 * Returns the default maximum health of a zombie.
195 *
196 * Note: Takes into account first zombie's HP multiplier.
197 *
198 * @param id Player index.
199 * @return Maximum amount of health points, or -1 if not a normal zombie.
200 */
201 native zp_get_zombie_maxhealth(id)
202
203 /**
204 * Returns a player's custom flashlight batteries charge.
205 *
206 * @param id Player index.
207 * @return Charge percent (0 to 100).
208 */
209 native zp_get_user_batteries(id)
210
211 /**
212 * Sets a player's custom flashlight batteries charge.
213 *
214 * @param id Player index.
215 * @param value New charge percent (0 to 100).
216 */
217 native zp_set_user_batteries(id, charge)
218
219 /**
220 * Returns whether a player has night vision.
221 *
222 * @param id Player index.
223 * @return True if it has, false otherwise.
224 */
225 native zp_get_user_nightvision(id)
226
227 /**
228 * Sets whether a player has night vision.
229 *
230 * @param id Player index.
231 * @param set True to give, false for removing it.
232 */
233 native zp_set_user_nightvision(id, set)
234
235 /**
236 * Forces a player to become a zombie.
237 *
238 * Note: Unavailable for last human/survivor/sniper/berserker.
239 *
240 * @param id Player index to be infected.
241 * @param infector Player index who infected him (optional).
242 * @param silent If set, there will be no HUD messages or infection sounds.
243 * @param rewards Whether to show DeathMsg and reward frags, hp, and ammo packs to infector.
244 * @return True on success, false otherwise.
245 */
246 native zp_infect_user(id, infector = 0, silent = 0, rewards = 0)
247
248 /**
249 * Forces a player to become a human.
250 *
251 * Note: Unavailable for last zombie/nemesis.
252 *
253 * @param id Player index to be cured.
254 * @param silent If set, there will be no HUD messages or antidote sounds.
255 * @return True on success, false otherwise.
256 */
257 native zp_disinfect_user(id, silent = 0)
258
259 /**
260 * Forces a player to become a nemesis.
261 *
262 * Note: Unavailable for last human/survivor/sniper/berserker.
263 *
264 * @param id Player index to turn into nemesis.
265 * @return True on success, false otherwise.
266 */
267 native zp_make_user_nemesis(id)
268
269 /**
270 * Forces a player to become a survivor.
271 *
272 * Note: Unavailable for last zombie/nemesis.
273 *
274 * @param id Player index to turn into survivor.
275 * @return True on success, false otherwise.
276 */
277 native zp_make_user_survivor(id)
278
279 /**
280 * Respawns a player into a specific team.
281 *
282 * @param id Player index to be respawned.
283 * @param team Team to respawn the player into (ZP_TEAM_ZOMBIE or ZP_TEAM_HUMAN).
284 * @return True on success, false otherwise.
285 */
286 native zp_respawn_user(id, team)
287
288 /**
289 * Forces a player to buy an extra item.
290 *
291 * @param id Player index.
292 * @param itemid A valid extra item ID.
293 * @param ignorecost If set, item's cost won't be deduced from player.
294 * @return True on success, false otherwise.
295 */
296 native zp_force_buy_extra_item(id, itemid, ignorecost = 0)
297
298 /**
299 * Returns whether a player is a sniper.
300 *
301 * @param id Player index.
302 * @return True if it is, false otherwise.
303 */
304 native zp_get_user_sniper(id)
305
306 /**
307 * Forces a player to become a sniper.
308 *
309 * Note: Unavailable for last zombie/nemesis/assassin.
310 *
311 * @param id Player index to turn into sniper.
312 * @return True on success, false otherwise.
313 */
314 native zp_make_user_sniper(id)
315
316 /**
317 * Returns whether a player is an assassin.
318 *
319 * @param id Player index.
320 * @return True if it is, false otherwise.
321 */
322 native zp_get_user_assassin(id)
323
324
325 /**
326 * Returns whether a player is an predator.
327 *
328 * @param id Player index.
329 * @return True if it is, false otherwise.
330 */
331 native zp_get_user_predator(id)
332
333 /**
334 * Returns whether a player is an bombardier.
335 *
336 * @param id Player index.
337 * @return True if it is, false otherwise.
338 */
339 native zp_get_user_bombardier(id)
340
341 /**
342 * Returns whether a player is an dragon.
343 *
344 * @param id Player index.
345 * @return True if it is, false otherwise.
346 */
347 native zp_get_user_dragon(id)
348
349 /**
350 * Forces a player to become a assassin.
351 *
352 * Note: Unavailable for last human/survivor/sniper.
353 *
354 * @param id Player index to turn into assassin.
355 * @return True on success, false otherwise.
356 */
357 native zp_make_user_assassin(id)
358
359 /**
360 * Forces a player to become a predator.
361 *
362 * Note: Unavailable for last human/survivor/sniper.
363 *
364 * @param id Player index to turn into predator.
365 * @return True on success, false otherwise.
366 */
367 native zp_make_user_predator(id)
368
369 /**
370 * Forces a player to become a bombardier.
371 *
372 * Note: Unavailable for last human/survivor/sniper.
373 *
374 * @param id Player index to turn into bombardier.
375 * @return True on success, false otherwise.
376 */
377 native zp_make_user_bombardier(id)
378
379 /**
380 * Forces a player to become a dragon.
381 *
382 * Note: Unavailable for last human/survivor/sniper.
383 *
384 * @param id Player index to turn into dragon.
385 * @return True on success, false otherwise.
386 */
387 native zp_make_user_dragon(id)
388
389 /**
390 * Returns whether a player is a sniper.
391 *
392 * @param id Player index.
393 * @return True if it is, false otherwise.
394 */
395 native zp_get_user_berserker(id)
396
397 /**
398 * Forces a player to become a berserker.
399 *
400 * Note: Unavailable for last zombie/nemesis/assassin.
401 *
402 * @param id Player index to turn into berserker.
403 * @return True on success, false otherwise.
404 */
405 native zp_make_user_berserker(id)
406
407 /**
408 * Returns whether a player is a sniper.
409 *
410 * @param id Player index.
411 * @return True if it is, false otherwise.
412 */
413 native zp_get_user_wesker(id)
414
415 /**
416 * Forces a player to become a wesker.
417 *
418 * Note: Unavailable for last zombie/nemesis/assassin.
419 *
420 * @param id Player index to turn into wesker.
421 * @return True on success, false otherwise.
422 */
423 native zp_make_user_wesker(id)
424
425 /**
426 * Returns whether a player is a spy
427 *
428 * @param id Player index.
429 * @return True if it is, false otherwise.
430 */
431 native zp_get_user_spy(id)
432
433 /**
434 * Forces a player to become a spy.
435 *
436 * Note: Unavailable for last zombie/nemesis/assassin.
437 *
438 * @param id Player index to turn into spy.
439 * @return True on success, false otherwise.
440 */
441 native zp_make_user_spy(id)
442
443 /**
444 * Returns whether the ZP round has started, i.e. first zombie
445 * has been chosen or a game mode has begun.
446 *
447 * @return 0 - Round not started
448 * 1 - Round started
449 * 2 - Round starting
450 */
451 native zp_has_round_started()
452
453 /**
454 * Returns whether the current round is a nemesis round.
455 *
456 * @return True if it is, false otherwise.
457 */
458 native zp_is_nemesis_round()
459
460 /**
461 * Returns whether the current round is a survivor round.
462 *
463 * @return True if it is, false otherwise.
464 */
465 native zp_is_survivor_round()
466
467 /**
468 * Returns whether the current round is a swarm round.
469 *
470 * @return True if it is, false otherwise.
471 */
472 native zp_is_swarm_round()
473
474 /**
475 * Returns whether the current round is a plague round.
476 *
477 * @return True if it is, false otherwise.
478 */
479 native zp_is_plague_round()
480
481 /**
482 * Returns whether the current round is a Armageddon round.
483 *
484 * @return True if it is, false otherwise.
485 */
486 native zp_is_lnj_round()
487
488 /**
489 * Returns number of alive zombies.
490 *
491 * @return Zombie count.
492 */
493 native zp_get_zombie_count()
494
495 /**
496 * Returns number of alive humans.
497 *
498 * @return Human count.
499 */
500 native zp_get_human_count()
501
502 /**
503 * Returns number of alive nemesis.
504 *
505 * @return Nemesis count.
506 */
507 native zp_get_nemesis_count()
508
509 /**
510 * Returns number of alive survivors.
511 *
512 * @return Survivor count.
513 */
514 native zp_get_survivor_count()
515
516 /**
517 * Returns whether the current round is a sniper round.
518 *
519 * @return True if it is, false otherwise.
520 */
521 native zp_is_sniper_round()
522
523 /**
524 * Returns whether the current round is a assassin round.
525 *
526 * @return True if it is, false otherwise.
527 */
528 native zp_is_assassin_round()
529
530 /**
531 * Returns whether the current round is a predator round.
532 *
533 * @return True if it is, false otherwise.
534 */
535 native zp_is_predator_round()
536
537 /**
538 * Returns whether the current round is a bombardier round.
539 *
540 * @return True if it is, false otherwise.
541 */
542 native zp_is_bombardier_round()
543
544 /**
545 * Returns whether the current round is a dragon round.
546 *
547 * @return True if it is, false otherwise.
548 */
549 native zp_is_dragon_round()
550
551 /**
552 * Returns whether the current round is a berserker round.
553 *
554 * @return True if it is, false otherwise.
555 */
556 native zp_is_berserker_round()
557
558 /**
559 * Returns whether the current round is a wesker round.
560 *
561 * @return True if it is, false otherwise.
562 */
563 native zp_is_wesker_round()
564
565 /**
566 * Returns whether the current round is a spy round.
567 *
568 * @return True if it is, false otherwise.
569 */
570 native zp_is_spy_round()
571
572 /**
573 * Returns number of alive snipers.
574 *
575 * @return Sniper count.
576 */
577 native zp_get_sniper_count()
578
579 /**
580 * Returns number of alive assassins.
581 *
582 * @return Assassin count.
583 */
584 native zp_get_assassin_count()
585
586 /**
587 * Returns number of alive predators.
588 *
589 * @return predator count.
590 */
591 native zp_get_predator_count()
592
593 /**
594 * Returns number of alive bombardiers.
595 *
596 * @return bombardier count.
597 */
598 native zp_get_bombardier_count()
599
600 /**
601 * Returns number of alive dragons.
602 *
603 * @return dragon count.
604 */
605 native zp_get_dragon_count()
606
607
608 /**
609 * Returns number of alive berserkers.
610 *
611 * @return Berserker count.
612 */
613 native zp_get_berserker_count()
614
615 /**
616 * Returns number of alive weskers.
617 *
618 * @return wesker count.
619 */
620 native zp_get_wesker_count()
621
622 /**
623 * Returns number of alive spys.
624 *
625 * @return spy count.
626 */
627 native zp_get_spy_count()
628
629
630 /**
631 * Returns the current game mode ID
632 *
633 * Note: For default game modes you can use, for eg. MODE_SWARM,
634 * to check if the current round is swarm mode.
635 *
636 * Note: For custom game modes you must have the custom game
637 * mode ID to detect it
638 *
639 * @return Current game mode ID
640 */
641 native zp_get_current_mode()
642
643 native zp_get_last_mode() // Ver o ultimo mod jogado
644
645 /**
646 * Returns an extra item's ID.
647 *
648 * @param name Item name to look for.
649 * @return Internal extra item ID, or -1 if not found.
650 */
651 native zp_get_extra_item_id(const name[])
652
653 /**
654 * Returns a zombie class' ID.
655 *
656 * @param name Class name to look for.
657 * @return Internal zombie class ID, or -1 if not found.
658 */
659 native zp_get_zombie_class_id(const name[])
660
661 /**
662 * Registers a custom game mode which will be added to the admin menu of ZP
663 *
664 * Note: The returned game mode ID can later be used to detect the game mode
665 * which is called in zp_round_started_pre. There you can start the game mode
666 * externally by using this game mode ID.
667 *
668 * @param name The game modes name which will also be used by other plugins
669 * to identify this game mode
670 * @param flags Access flags required by the admins to start this game
671 * mode via the admin menu.
672 * @param chance Chance level of this game mode. (1 in X) The higher the value
673 * the lesser the chance that this game mode will be called
674 * @param allow Whether to permit infection or not after a zombie's attack
675 * @param dm_mode Death match mode during this game. Use ZP_DM_NONE to disable
676 * respawning during this game mode
677 * @return An internal game mode ID or -1 on failure
678 */
679 native zp_register_game_mode( const name[], flags, chance, allow, dm_mode)
680
681 /**
682 * Registers a custom item which will be added to the extra items menu of ZP.
683 *
684 * Note: The returned extra item ID can be later used to catch item
685 * purchase events for the zp_extra_item_selected() forward.
686 *
687 * Note: ZP_TEAM_NEMESIS, ZP_TEAM_SURVIVOR, ZP_TEAM_ASSASSIN, ZP_TEAM_SNIPER and ZP_TEAM_BERSERKER
688 * can be used to make an item available to Nemesis,
689 * Survivors, Assassins, Snipers and Berserkers.
690 *
691 * @param name Caption to display on the menu.
692 * @param cost Ammo packs to be deducted on purchase.
693 * @param teams Bitsum of teams it should be available for.
694 * @return An internal extra item ID, or -1 on failure.
695 */
696 native zp_register_extra_item(const name[], cost, teams)
697
698 // New Natives
699 native zp_extra_item_textadd(const text[]) // Add Text On Extra Item (Like ZP 5.0)
700 native zp_zombie_class_textadd(const text[]) // Add Text On Zombie Class (Like ZP 5.0)
701 native zp_get_user_infectnade(id) // Get User Infect bomb
702 native zp_set_user_infectnade(id, set) // Give/Remove User Infect bomb
703 native zp_get_user_frozen(id) // Get User Frozen
704 native zp_set_user_frozen(id, set) // Set User Burning
705 native zp_get_user_burn(id) // Get User Burning
706 native zp_set_user_burn(id, set) // Set User Burning
707 native zp_get_user_madness(id) // Get user Madness
708 native zp_set_user_madness(id, set) // Set user Madness
709 native zp_get_human_special_class(id) // Get User Survivor/Sniper/Berserker/Etc
710 native zp_get_zombie_special_class(id) // Get User Nemesis/Assassin/Predator/Etc.
711 native zp_set_user_rendering(id, fx, r, g, b, render, amount) // Set User Render with handle models on separate ent compat
712 native zp_reset_user_rendering(id) // Reset User Render
713 native zp_get_extra_item_cost(itemid) // Get Item Cost
714 native zp_get_extra_item_name(itemid, itemname[], len) // Get Item Name
715 native zp_set_user_maxspeed(id, Float:Speed) // Change user Current maxspeed
716 native Float:zp_get_user_maxspeed(id) // Get user Maxspeed
717 native zp_reset_user_maxspeed(id) // Reset user Maxspeed
718 native zp_set_extra_damage(victim, attacker, damage, weaponDescription[]) // Set User Extra Damage (Like Superhero Mod)
719 native zp_get_zombie_class_info(class, info[], len) // Get Class Info
720 native zp_get_zombie_class_name(class, name[], len) // Get Class Name
721 native zp_set_extra_item_cost(itemid, cost) // Change Extra Item Cost
722 native zp_set_extra_item_name(itemid, const newname[]) // Change Extra Item Name
723 native zp_set_extra_item_team(itemid, team) // Change Extra Item Team
724 native zp_get_extra_item_realname(itemid, realname[], len)
725 native zp_has_round_ended() // Get Round Ended
726 native zp_get_current_mode_name(name[], len) // Get Current mode Name
727 native zp_override_user_model(id, const newmodel[], modelindex = 0)
728
729 // New Natives (3.0 Version or higher Available)
730 native zp_register_zombie_special(const name[], const model[], const knifemodel[], const pain_sound[], hp, speed, Float:gravity, flags, Float:knockback, aura_radius, glow, r, g, b) // Register Human Special
731 native zp_make_user_special(id, spid, zombie) // Make user a Special Class
732 native zp_set_custom_game_mod(gameid) // Forces Start Custom Mod
733 native zp_get_special_count(zombie, specialid) // Get Special id Cound
734 native zp_register_human_special(const name[], const model[], hp, speed, Float:gravity, flags, clip_type, aura_radius, glow, r, g, b) // Register Human Special
735 native zp_reset_player_model(id) // Reset Player Model
736
737 // New Natives (3.1 Version or higher Available)
738 native zp_special_class_name(id, name[], len) // Get user Special Class Real Name
739
740 // New Natives (3.2 Version or higher Available)
741 native zp_get_zombie_class_realname(id, realname[], len) // Get user Zombie Class Real Name
742 native zp_get_special_class_id(is_zombie, name[]) // Get Special Class ID
743
744 // New Natives (3.4 Version or Higher Available)
745 native zp_get_custom_special_count(is_zombie) // Get Registred Custom Special Class Count
746 native zp_get_gamemodes_count() // Get Registred Custom Game modes count
747 native zp_get_zclass_count() // Get Registred Zombie Class Count
748 native zp_get_extra_item_count() // Get Registred Extra Item Count
749 native zp_get_gamemode_id(name[]) // Get Game mode index by name
750
751 // New Natives (3.5 Version or Higher Available)
752 native zp_is_escape_map() // Get Current Map is Escape Map
753 native zp_do_random_spawn(id) // Teleport User to Spawn
754
755 /**
756 * Registers a custom class which will be added to the zombie classes menu of ZP.
757 *
758 * Note: The returned zombie class ID can be later used to identify
759 * the class when calling the zp_get_user_zombie_class() natives.
760 *
761 * @param name Caption to display on the menu.
762 * @param info Brief description of the class.
763 * @param model Player model to be used.
764 * @param clawmodel Claws model to be used.
765 * @param hp Initial health points.
766 * @param speed Maximum speed.
767 * @param gravity Gravity multiplier.
768 * @param knockback Knockback multiplier.
769 * @return An internal zombie class ID, or -1 on failure.
770 */
771 native zp_register_zombie_class(const name[], const info[], const model[], const clawmodel[], hp, speed, Float:gravity, Float:knockback)
772
773 /**
774 * Called when the ZP round starts, i.e. first zombie
775 * is chosen or a game mode begins.
776 *
777 * @param gamemode Mode which has started.
778 * @param id Affected player's index (if applicable).
779 */
780 forward zp_round_started(gamemode, id)
781
782 /**
783 * Called before the ZP round starts. This is only
784 * called for custom game modes.
785 *
786 * Note: The custom game mode id can be used to start
787 * the game mode externally
788 *
789 * Note: returning ZP_PLUGIN_HANDLED will cause the
790 * game mode to be blocked and other game modes will
791 * be given a chance.
792 *
793 * @param gameid Custom mode id which is called
794 */
795 forward zp_round_started_pre(gameid)
796
797 /**
798 * Called when the round ends.
799 *
800 * @param winteam Team which has won the round.
801 */
802 forward zp_round_ended(winteam)
803
804 /**
805 * Called when a player gets infected.
806 *
807 * @param id Player index who was infected.
808 * @param infector Player index who infected him (if applicable).
809 * @param nemesis Whether the player was turned into a nemesis.
810 */
811 forward zp_user_infected_pre(id, infector, classid)
812 forward zp_user_infected_post(id, infector, classid)
813
814 /**
815 * Called when a player turns back to human.
816 *
817 * @param id Player index who was cured.
818 * @param survivor Whether the player was turned into a survivor.
819 */
820 forward zp_user_humanized_pre(id, classid)
821 forward zp_user_humanized_post(id, classid)
822
823 /**
824 * Called on a player infect/cure attempt. You can use this to block
825 * an infection/humanization by returning ZP_PLUGIN_HANDLED in your plugin.
826 *
827 * Note: Right now this is only available after the ZP round starts, since some
828 * situations (like blocking a first zombie's infection) are not yet handled.
829 */
830 forward zp_user_infect_attempt(id, infector, classid)
831 forward zp_user_humanize_attempt(id, classid)
832
833 /**
834 * Called when an admin selects a custom game mode from the ZP admin menu.
835 *
836 * Note: You should trigger the custom game mode here with out any checks
837 *
838 * @param gameid Internal custom game mode ID
839 * @param id Player index who selected the game mode
840 */
841 forward zp_game_mode_selected(gameid, id)
842
843 /**
844 * Called when a player spawns. This is also called for CZ bots
845 * which are spawning
846 *
847 * Note: You should use this, instead of other spawn forwards,
848 * when you want to change some one's class after spawning.
849 *
850 * Note: If you have used this forward then you must return
851 * ZP_PLUGIN_HANDLED to inform the main plugin that you have used
852 * this forward
853 *
854 * @param id Player index who has spawned
855 * @param resp_zombie This is passed by the main plugin as 1 if
856 * the player needs to be spawned as a zombie
857 * otherwise it is passed as zero
858 */
859 forward zp_player_spawn_post(id, resp_zombie)
860
861 /**
862 * Called when a player buys an extra item from the ZP menu.
863 *
864 * Note: You can now return ZP_PLUGIN_HANDLED in your plugin to block
865 * the purchase and the player will be automatically refunded.
866 *
867 * @param id Player index of purchaser.
868 * @param itemid Internal extra item ID.
869 */
870 forward zp_extra_item_selected(id, itemid)
871
872 // New Forwards
873 // Exec When Open the Extra Itens menu
874 // Use the ZP_PLUGIN_HANDLED for block option (Like ZP 5.0)
875 // Use the ZP_PLUGIN_SUPERCEDE for block showing item in menu
876 forward zp_extra_item_selected_pre(id, itemid)
877
878 // Use the ZP_PLUGIN_HANDLED for block user frozing
879 forward zp_user_frozen_pre(id)
880
881 forward zp_user_frozen_post(id)
882
883 // Use the ZP_PLUGIN_HANDLED for block user burning
884 forward zp_user_burn_pre(id)
885
886 forward zp_user_burn_post(id)
887
888 /**
889 * Called when a player gets unfrozen (frostnades).
890 *
891 * @param id Player index.
892 */
893 forward zp_user_unfrozen(id)
894
895 /**
896 * Called when a player becomes the last zombie.
897 *
898 * Note: This is called for the first zombie too.
899 *
900 * @param id Player index.
901 */
902 forward zp_user_last_zombie(id)
903
904 /**
905 * Called when a player becomes the last human.
906 *
907 * @param id Player index.
908 */
909 forward zp_user_last_human(id)
910
911 // Exec when open Zombie Classes Choose menu
912 // Use the ZP_PLUGIN_HANDLED for block option (Like ZP 5.0)
913 // Use the ZP_PLUGIN_SUPERCEDE for block showing class in menu
914 forward zp_zombie_class_choosed_pre(id, classid)
915
916 // Exec when the user choose the class
917 forward zp_zombie_class_choosed_post(id, classid)
918
919 // New Forwards (4.0 or Higher)
920 /*
921 Execute when player reset render
922 Use ZP_PLUGIN_SUPERCEDE for block it
923 */
924 forward zp_user_rendering_reset_pre(id)
925
926 // Execute after player reset glow
927 forward zp_user_rendering_reset_post(id)
928
929 /*
930 Execute when player change the model
931 Use ZP_PLUGIN_SUPERCEDE for block it
932 */
933 forward zp_user_model_change_pre(id, model[])
934
935 // Execute after player change model
936 forward zp_user_model_change_post(id, model[])
937
938 /*
939 Execute before admin make a player to special class
940 Use ZP_PLUGIN_HANDLED for block it
941 */
942 forward zp_human_special_choosed_pre(id, specialid)
943 forward zp_zombie_special_choosed_pre(id, specialid)
944
945 // Execute after admin make a player to special class
946 forward zp_human_special_choosed_post(id, specialid)
947 forward zp_zombie_special_choosed_post(id, specialid)
948
949 /*
950 Execute before admin start a mode
951 Use ZP_PLUGIN_HANDLED for block it
952 */
953 forward zp_game_mode_selected_pre(id, gamemode)
954
955 /**
956 * @deprecated - Do not use!
957 * For backwards compatibility only.
958 */
959 #define ZP_TEAM_ANY 0
960
961 stock zp_get_alive_players()
962 {
963 static i_alive, id
964 i_alive = 0
965
966 for (id = 1; id <= get_maxplayers(); id++)
967 {
968 if(is_user_alive(id))
969 i_alive++
970 }
971 return i_alive;
972 }
973