basebuilder.inc
Original include source with line numbers.
| 1 | #if defined _basebuilder_included |
| 2 | #endinput |
| 3 | #endif |
| 4 | #define _basebuilder_included |
| 5 | |
| 6 | enum |
| 7 | { |
| 8 | COLOR_RED = 0, //200, 000, 000 |
| 9 | COLOR_REDORANGE, //255, 083, 073 |
| 10 | COLOR_ORANGE, //255, 117, 056 |
| 11 | COLOR_YELLOWORANGE, //255, 174, 066 |
| 12 | COLOR_PEACH, //255, 207, 171 |
| 13 | COLOR_YELLOW, //252, 232, 131 |
| 14 | COLOR_LEMONYELLOW, //254, 254, 034 |
| 15 | COLOR_JUNGLEGREEN, //059, 176, 143 |
| 16 | COLOR_YELLOWGREEN, //197, 227, 132 |
| 17 | COLOR_GREEN, //000, 200, 000 |
| 18 | COLOR_AQUAMARINE, //120, 219, 226 |
| 19 | COLOR_BABYBLUE, //135, 206, 235 |
| 20 | COLOR_SKYBLUE, //128, 218, 235 |
| 21 | COLOR_BLUE, //000, 000, 200 |
| 22 | COLOR_VIOLET, //146, 110, 174 |
| 23 | COLOR_PINK, //255, 105, 180 |
| 24 | COLOR_MAGENTA, //246, 100, 175 |
| 25 | COLOR_MAHOGANY, //205, 074, 076 |
| 26 | COLOR_TAN, //250, 167, 108 |
| 27 | COLOR_LIGHTBROWN, //234, 126, 093 |
| 28 | COLOR_BROWN, //180, 103, 077 |
| 29 | COLOR_GRAY, //149, 145, 140 |
| 30 | COLOR_BLACK, //000, 000, 000 |
| 31 | COLOR_WHITE //255, 255, 255 |
| 32 | } |
| 33 | |
| 34 | enum |
| 35 | { |
| 36 | PUSHING = 1, |
| 37 | PULLING |
| 38 | } |
| 39 | |
| 40 | enum |
| 41 | { |
| 42 | ATT_HEALTH = 0, |
| 43 | ATT_SPEED, |
| 44 | ATT_GRAVITY |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * Returns whether Base Builder is active. |
| 49 | */ |
| 50 | stock is_basebuilder_active() |
| 51 | { |
| 52 | if(!cvar_exists("bb_enabled")) |
| 53 | { |
| 54 | log_amx("Cvar: ^"bb_enabled^" does not exist.") |
| 55 | return 0 |
| 56 | } |
| 57 | return get_cvar_num("bb_enabled") |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * Registers a custom class which will be added to the zombie classes menu of BB. |
| 62 | * |
| 63 | * Note: The returned zombie class ID can be later used to identify |
| 64 | * the class when calling the bb_get_user_zombie_class() natives. |
| 65 | * |
| 66 | * @param name Caption to display on the menu. |
| 67 | * @param info Brief description of the class. |
| 68 | * @param model Player model to be used. |
| 69 | * @param clawmodel Claws model to be used. |
| 70 | * @param hp Initial health points. |
| 71 | * @param speed Maximum speed. |
| 72 | * @param gravity Gravity multiplier. |
| 73 | * @param knockback Empty value. |
| 74 | * @param adminflags Set flag of admin only class, ADMIN_USER is normal players. |
| 75 | * @param credits Cost of unlocking this class (if credits is enabled). |
| 76 | * @return An internal zombie class ID, or -1 on failure. |
| 77 | */ |
| 78 | native bb_register_zombie_class(const name[], const info[], const model[], const clawmodel[], hp, speed, Float:gravity, Float:knockback = 0.0, adminflags = ADMIN_ALL, credits = 0 ) |
| 79 | native zp_register_zombie_class(const name[], const info[], const model[], const clawmodel[], hp, speed, Float:gravity, Float:knockback = 0.0, adminflags = ADMIN_ALL, credits = 0 ) |
| 80 | |
| 81 | /** |
| 82 | * Returns a zombie classes cost. |
| 83 | * |
| 84 | * @param classid A valid zombie class ID. |
| 85 | */ |
| 86 | native bb_get_class_cost(classid) |
| 87 | |
| 88 | /** |
| 89 | * Returns a player's current zombie class ID. |
| 90 | * |
| 91 | * @param id Player index. |
| 92 | * @return Internal zombie class ID, or -1 if not yet chosen. |
| 93 | */ |
| 94 | native bb_get_user_zombie_class(id) |
| 95 | native zp_get_user_zombie_class(id) |
| 96 | |
| 97 | /** |
| 98 | * Returns a player's next zombie class ID (when they respawn). |
| 99 | * |
| 100 | * @param id Player index. |
| 101 | * @return Internal zombie class ID, or -1 if not yet chosen. |
| 102 | */ |
| 103 | native bb_get_user_next_class(id) |
| 104 | native zp_get_user_next_class(id) |
| 105 | |
| 106 | /** |
| 107 | * Sets a player's next zombie class ID (when they respawn). |
| 108 | * |
| 109 | * @param id Player index. |
| 110 | * @param classid A valid zombie class ID. |
| 111 | * @return True on success, false otherwise. |
| 112 | */ |
| 113 | native bb_set_user_zombie_class(id, classid) |
| 114 | native zp_set_user_zombie_class(id, classid) |
| 115 | |
| 116 | /** |
| 117 | * Returns whether a player is a zombie. |
| 118 | * |
| 119 | * @param id Player index. |
| 120 | * @return True if it is, false otherwise. |
| 121 | */ |
| 122 | native bb_is_user_zombie(id) |
| 123 | native zp_get_user_zombie(id) |
| 124 | |
| 125 | /** |
| 126 | * Returns whether a player is banned from building. |
| 127 | * |
| 128 | * @param id Player index. |
| 129 | * @return True if it is, false otherwise. |
| 130 | */ |
| 131 | native bb_is_user_banned(id) |
| 132 | |
| 133 | /** |
| 134 | * Returns whether the game is still in the build phase. |
| 135 | * |
| 136 | * @param id Player index. |
| 137 | * @return True if it is, false otherwise. |
| 138 | */ |
| 139 | native bb_is_build_phase() |
| 140 | |
| 141 | /** |
| 142 | * Returns whether the game is in the preparation phase. |
| 143 | * |
| 144 | * @return True if it is, false otherwise. |
| 145 | */ |
| 146 | native bb_is_prep_phase() |
| 147 | |
| 148 | /** |
| 149 | * Returns the current build time (in seconds). |
| 150 | */ |
| 151 | native bb_get_build_time() |
| 152 | |
| 153 | /** |
| 154 | * Sets the build timer to a specified number. |
| 155 | * |
| 156 | * @param time Time to set build timer to. (integer) |
| 157 | */ |
| 158 | native bb_set_build_time(time) |
| 159 | |
| 160 | /** |
| 161 | * Returns the players current color ENUM. |
| 162 | * |
| 163 | * @param id Player index. |
| 164 | */ |
| 165 | native bb_get_user_color(id) |
| 166 | |
| 167 | /** |
| 168 | * Sets the build timer to a specified number. |
| 169 | * |
| 170 | * @param id Player index. |
| 171 | * @param color Color to set. (enum) |
| 172 | */ |
| 173 | native bb_set_user_color(id, color) |
| 174 | |
| 175 | /** |
| 176 | * Drops the users entity (if he has one). |
| 177 | * |
| 178 | * @param id Player index. |
| 179 | */ |
| 180 | native bb_drop_user_block(id) |
| 181 | |
| 182 | /** |
| 183 | * Returns the users entity.. |
| 184 | * |
| 185 | * @param id Player index. |
| 186 | * @return Entity index if true, 0 if none |
| 187 | */ |
| 188 | native bb_get_user_block(id) |
| 189 | |
| 190 | /** |
| 191 | * Sets the users current moving block to the entity specified. |
| 192 | * |
| 193 | * @param id Player index. |
| 194 | * @param entity Entity index. |
| 195 | */ |
| 196 | native bb_set_user_block(id, entity) |
| 197 | |
| 198 | /** |
| 199 | * Returns whether a block is locked or not. |
| 200 | * |
| 201 | * @param entity Entity index. |
| 202 | * @return True if it is, false otherwise |
| 203 | */ |
| 204 | native bb_is_locked_block(entity) |
| 205 | |
| 206 | /** |
| 207 | * Locks specified block if applicable. |
| 208 | * |
| 209 | * @param entity Entity index. |
| 210 | */ |
| 211 | native bb_lock_block(entity) |
| 212 | |
| 213 | /** |
| 214 | * Unlocks specified block if applicable. |
| 215 | * |
| 216 | * @param entity Entity index. |
| 217 | */ |
| 218 | native bb_unlock_block(id, entity) |
| 219 | |
| 220 | /** |
| 221 | * Releases the zombies if valid. |
| 222 | */ |
| 223 | native bb_release_zombies() |
| 224 | |
| 225 | /** |
| 226 | * Sets their "primary weapon" (weapon that is drawn at round start). |
| 227 | * |
| 228 | * @param id Player index. |
| 229 | * @param csw_primary CSW_ primary to set to from CSW_P228 to CSW_P90. |
| 230 | */ |
| 231 | native bb_set_user_primary(id, csw_gun) |
| 232 | |
| 233 | /** |
| 234 | * Returns their current primary weapon. |
| 235 | * |
| 236 | * @param id Player index. |
| 237 | * @return Returns primary weapon as CSW_ constant. |
| 238 | */ |
| 239 | native bb_get_user_primary(id) |
| 240 | |
| 241 | /** |
| 242 | * Returns current mod admin flags for the following |
| 243 | * |
| 244 | * @return Returns the ADMIN flags for specified level |
| 245 | */ |
| 246 | native bb_get_flags_build() |
| 247 | native bb_get_flags_lock() |
| 248 | native bb_get_flags_buildban() |
| 249 | native bb_get_flags_swap() |
| 250 | native bb_get_flags_revive() |
| 251 | native bb_get_flags_guns() |
| 252 | native bb_get_flags_release() |
| 253 | native bb_get_flags_override() |
| 254 | |
| 255 | /*------------------------------------------------------------------------------------------------*/ |
| 256 | |
| 257 | //Disabled until fixed |
| 258 | |
| 259 | /** |
| 260 | * Sets a multiplier for a class (for use with credits add-on) |
| 261 | * |
| 262 | * @param id Player index. |
| 263 | * @param attribute Attribute enum to change |
| 264 | * @param amount Float value hat will multiply by |
| 265 | * @return Returns 1 if successful, 0 if not |
| 266 | */ |
| 267 | //native bb_set_user_mult(id, attribute, Float:amount) |
| 268 | /*------------------------------------------------------------------------------------------------*/ |
| 269 | |
| 270 | /** |
| 271 | * Called when the zombies are released |
| 272 | * at the end of the build or preparation phase |
| 273 | */ |
| 274 | forward bb_round_started() |
| 275 | |
| 276 | /** |
| 277 | * Called when the preparation phase begins |
| 278 | * at the end of the build phase, before zombie release |
| 279 | */ |
| 280 | forward bb_prepphase_started() |
| 281 | |
| 282 | /** |
| 283 | * Called when the build phase begins |
| 284 | * When the round starts (logevent) |
| 285 | */ |
| 286 | forward bb_buildphase_started() |
| 287 | |
| 288 | /** |
| 289 | * Called when a player picks his NEXT zombie class |
| 290 | * |
| 291 | * @param id Player index forwarding the event. |
| 292 | * @param class Class index picked |
| 293 | */ |
| 294 | forward bb_zombie_class_picked(id, class) |
| 295 | |
| 296 | /** |
| 297 | * Called when a player has his CURRENT class applied. (respawn) |
| 298 | * |
| 299 | * @param id Player index forwarding the event. |
| 300 | * @param class Class index picked |
| 301 | */ |
| 302 | forward bb_zombie_class_set(id, class) |
| 303 | |
| 304 | /** |
| 305 | * Called when a player pushes or pulls an entity |
| 306 | * |
| 307 | * @param id Player index forwarding the event. |
| 308 | * @param entity The entity index being moved |
| 309 | * @param pushpull Whether it's being pushed or pulled |
| 310 | * 1 = pushing, 2 = pulling |
| 311 | */ |
| 312 | forward bb_block_pushpull(id, entity, pushpull) |
| 313 | |
| 314 | /** |
| 315 | * Called when a player grabs an entity |
| 316 | * Before entity successfully grabbed |
| 317 | * |
| 318 | * @param id Player index forwarding the event. |
| 319 | * @param entity The entity index being grabbed |
| 320 | */ |
| 321 | forward bb_grab_pre(id, entity) |
| 322 | |
| 323 | /** |
| 324 | * Called when a player grabs an entity |
| 325 | * After the entity is grabbed |
| 326 | * |
| 327 | * @param id Player index forwarding the event. |
| 328 | * @param entity The entity index being grabbed |
| 329 | */ |
| 330 | forward bb_grab_post(id, entity) |
| 331 | |
| 332 | /** |
| 333 | * Called when a player drops an entity |
| 334 | * Before entity actually dropped |
| 335 | * |
| 336 | * @param id Player index forwarding the event. |
| 337 | * @param entity The entity index being dropped |
| 338 | */ |
| 339 | forward bb_drop_pre(id, entity) |
| 340 | |
| 341 | /** |
| 342 | * Called when a player drops an entity |
| 343 | * After the entity is dropped |
| 344 | * |
| 345 | * @param id Player index forwarding the event. |
| 346 | * @param entity The entity index being dropped |
| 347 | */ |
| 348 | forward bb_drop_post(id, entity) |
| 349 | |
| 350 | /** |
| 351 | * Called when a player receives a new color |
| 352 | * Only when they random or select from menu |
| 353 | * |
| 354 | * @param id Player index forwarding the event. |
| 355 | * @param color The entity index being dropped |
| 356 | */ |
| 357 | forward bb_new_color(id, color) |
| 358 | |
| 359 | /** |
| 360 | * Called when a player locks an entity |
| 361 | * Before entity actually locked |
| 362 | * |
| 363 | * @param id Player index forwarding the event. |
| 364 | * @param entity The entity index being locked |
| 365 | */ |
| 366 | forward bb_lock_pre(id, entity) |
| 367 | |
| 368 | /** |
| 369 | * Called when a player locks an entity |
| 370 | * After the entity is locked |
| 371 | * |
| 372 | * @param id Player index forwarding the event. |
| 373 | * @param entity The entity index being locked |
| 374 | */ |
| 375 | forward bb_lock_post(id, entity) |
| 376 | /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE |
| 377 | *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par } |
| 378 | */ |
| 379 | |