AMXX-BG.INFO zp50_gamemodes.inc Raw include

zp50_gamemodes.inc

Original include source with line numbers.

Back Download .inc
1 #if defined _zp50_gamemodes_included
2 #endinput
3 #endif
4 #define _zp50_gamemodes_included
5
6 #include <zp50_core>
7 #include <zp50_gamemodes_const>
8
9 #if AMXX_VERSION_NUM >= 175
10 #pragma reqlib zp50_gamemodes
11 #if !defined AMXMODX_NOAUTOLOAD
12 #pragma loadlib zp50_gamemodes
13 #endif
14 #else
15 #pragma library zp50_gamemodes
16 #endif
17
18
19 /**
20 * Registers a new game mode.
21 *
22 * @param name Game mode name.
23 * @return An internal game mode ID, or ZP_INVALID_GAME_MODE on failure.
24 */
25 native zp_gamemodes_register(const name[])
26
27 /**
28 * Sets a default game mode (to start if no other game mode can been started).
29 *
30 * @param game_mode_id A valid game mode ID.
31 * @return True on success, false otherwise.
32 */
33 native zp_gamemodes_set_default(game_mode_id)
34
35 /**
36 * Returns default game mode.
37 *
38 * @return A valid game mode ID.
39 */
40 native zp_gamemodes_get_default()
41
42 /**
43 * Returns game mode that was chosen for the current round.
44 *
45 * @return An internal game mode ID, or ZP_NO_GAME_MODE.
46 */
47 native zp_gamemodes_get_chosen()
48
49 /**
50 * Returns game mode that is currently in progress.
51 *
52 * @return An internal game mode ID, or ZP_NO_GAME_MODE.
53 */
54 native zp_gamemodes_get_current()
55
56 /**
57 * Returns a game mode's ID.
58 *
59 * @param name Game mode name to look for.
60 * @return Internal game mode ID, or ZP_INVALID_GAME_MODE if not found.
61 */
62 native zp_gamemodes_get_id(const name[])
63
64 /**
65 * Returns a game mode's name.
66 *
67 * @param game_mode_id A valid game mode ID.
68 * @param name The buffer to store the string in.
69 * @param len Character size of the output buffer.
70 * @return True on success, false otherwise.
71 */
72 native zp_gamemodes_get_name(game_mode_id, name[], len)
73
74 /**
75 * Forces a game mode to start.
76 *
77 * @param game_mode_id A valid game mode ID.
78 * @param target_player Player ID to be passed to game mode (optional).
79 * @return True on success, false if game mode can't start.
80 */
81 native zp_gamemodes_start(game_mode_id, target_player = RANDOM_TARGET_PLAYER)
82
83 /**
84 * Returns number of registered game modes.
85 *
86 * @return Game mode count.
87 */
88 native zp_gamemodes_get_count()
89
90 /**
91 * Sets whether zombies can infect humans for the current game mode.
92 *
93 * @param allow True to allow, false otherwise.
94 */
95 native zp_gamemodes_set_allow_infect(allow = true)
96
97 /**
98 * Returns whether zombies are allowed to infect humans for the current game mode.
99 *
100 * @return True if allowed, false otherwise.
101 */
102 native zp_gamemodes_get_allow_infect()
103
104 /**
105 * Called when ZP tries to choose a game mode for the current
106 * round. Returning PLUGIN_HANDLED here will tell the game modes
107 * manager that your mode can't be chosen (useful to set custom
108 * conditions, like a min amount of players, etc.)
109 *
110 * @param game_mode_id Internal game mode ID.
111 * @param skipchecks True when mode is being started by an admin.
112 */
113 forward zp_fw_gamemodes_choose_pre(game_mode_id, skipchecks)
114
115 /**
116 * Called when a game mode is chosen for the current round.
117 *
118 * @param game_mode_id Internal ID for the game mode that was chosen.
119 * @param target_player Player ID passed to game mode (can be RANDOM_TARGET_PLAYER).
120 */
121 forward zp_fw_gamemodes_choose_post(game_mode_id, target_player)
122
123 /**
124 * Called when a game mode starts.
125 *
126 * @param game_mode_id Internal ID for the game mode that was started.
127 */
128 forward zp_fw_gamemodes_start(game_mode_id)
129
130 /**
131 * Called when a game mode ends.
132 *
133 * Note: this can pass ZP_NO_GAME_MODE (if no game mode was in progress).
134 *
135 * @param game_mode_id Internal ID for the game mode that ended.
136 */
137 forward zp_fw_gamemodes_end(game_mode_id)
138