AMXX-BG.INFO zombie_plague_advance.inc

zombie_plague_advance

************************************************************************\ =============================================== || Zombie Plague Advance Includes File || * =============================================== --------------- ||How to ||* --------------- To make use of the Zombie Plague Advance API features in your plugin, just add the following line at the beginning of your script: #include <zombie_plague_advance> --------------- ||Natives||* --------------- These work just like any other functions: you may have to pass parameters and they usually return values. Example: if ( is_user_alive( id ) && zp_get_user_zombie( id ) ) { server_print( "Player %d is alive and a zombie", id ) } ---------------- ||Forwards||* ---------------- Forwards get called whenever an event happens during the game. You need to make a public callback somewhere on your script, and it will automatically be triggered when the event occurs. Example: public zp_user_infected_post( id, infector, nemesis ) { if ( !infector || nemesis ) return; server_print( "Player %d just got infected by %d!", id, infector ) } Also, take note of cases when there's a suffix: [These suffixes are only available in some forwards] _pre : means the forward will be called BEFORE the event happens _post : means it will be called AFTER the event takes place \**************************************************************************

Forwards

Name Description
zp_round_started Called when the ZP round starts, i.e. first zombie is chosen or a game mode begins.
zp_round_started_pre Called before the ZP round starts. This is only called for custom game modes. Note: The custom game mode id can be used to start the game mode externally Note: returning ZP_PLUGIN_HANDLED will cause the game mode to be blocked and other game modes will be given a chance.
zp_round_ended Called when the round ends.
zp_user_infected_pre Called when a player gets infected.
zp_user_infected_post
zp_user_humanized_pre Called when a player turns back to human.
zp_user_humanized_post
zp_user_humanized_pre
zp_user_humanized_post
zp_user_infect_attempt Called on a player infect/cure attempt. You can use this to block an infection/humanization by returning ZP_PLUGIN_HANDLED in your plugin. Note: Right now this is only available after the ZP round starts, since some situations (like blocking a first zombie's infection) are not yet handled.
zp_user_humanize_attempt
zp_user_humanize_attempt
zp_game_mode_selected Called when an admin selects a custom game mode from the ZP admin menu. Note: You should trigger the custom game mode here with out any checks
zp_extra_item_selected Called when a player buys an extra item from the ZP menu. Note: You can now return ZP_PLUGIN_HANDLED in your plugin to block the purchase and the player will be automatically refunded.
zp_user_unfrozen Called when a player gets unfrozen (frostnades).
zp_user_last_zombie Called when a player becomes the last zombie. Note: This is called for the first zombie too.
zp_user_last_human Called when a player becomes the last human.
zp_player_spawn_post Called when a player spawns. This is also called for CZ bots which are spawning. Note: You should use this, instead of other spawn forwards, for changing a player's class after the player's spawn.