reapi_gamedll.inc
Original include source with line numbers.
| 1 | #if defined _reapi_gamedll_included |
| 2 | #endinput |
| 3 | #endif |
| 4 | |
| 5 | #define _reapi_gamedll_included |
| 6 | |
| 7 | #include <reapi_gamedll_const> |
| 8 | |
| 9 | /* |
| 10 | * Sets Think callback for entity |
| 11 | * |
| 12 | * @param entity Entity index |
| 13 | * @param callback The forward to call |
| 14 | * @param params Optional set of data to pass through to callback |
| 15 | * @param len Optional size of data |
| 16 | * |
| 17 | * @note Use "" to reset callback |
| 18 | * @note Callback should be contains passing arguments as "public Think_Callback(const ent)" |
| 19 | * |
| 20 | * @noreturn |
| 21 | */ |
| 22 | native SetThink(const ent, const callback[], const params[] = "", const len = 0); |
| 23 | |
| 24 | /* |
| 25 | * Sets Touch callback for entity |
| 26 | * |
| 27 | * @param entity Entity index |
| 28 | * @param callback The forward to call |
| 29 | * @param params Optional set of data to pass through to callback |
| 30 | * @param len Optional size of data |
| 31 | * |
| 32 | * @note Use "" to reset callback |
| 33 | * @note Callback should be contains passing arguments as "public Touch_Callback(const ent, const other)" |
| 34 | * |
| 35 | * @noreturn |
| 36 | */ |
| 37 | native SetTouch(const ent, const callback[], const params[] = "", const len = 0); |
| 38 | |
| 39 | /* |
| 40 | * Sets Use callback for entity |
| 41 | * |
| 42 | * @param entity Entity index |
| 43 | * @param callback The forward to call |
| 44 | * @param params Optional set of data to pass through to callback |
| 45 | * @param len Optional size of data |
| 46 | * |
| 47 | * @note Use "" to reset callback |
| 48 | * @note Callback should be contains passing arguments as "public Use_Callback(const ent, const activator, const caller, USE_TYPE:useType, Float:value)" |
| 49 | * |
| 50 | * @noreturn |
| 51 | */ |
| 52 | native SetUse(const ent, const callback[], const params[] = "", const len = 0); |
| 53 | |
| 54 | /* |
| 55 | * Sets Blocked callback for entity |
| 56 | * |
| 57 | * @param entity Entity index |
| 58 | * @param callback The forward to call |
| 59 | * @param params Optional set of data to pass through to callback |
| 60 | * @param len Optional size of data |
| 61 | * |
| 62 | * @note Use "" to reset callback |
| 63 | * @note Callback should be contains passing arguments as "public Blocked_Callback(const ent, const other)" |
| 64 | * |
| 65 | * @noreturn |
| 66 | */ |
| 67 | native SetBlocked(const ent, const callback[], const params[] = "", const len = 0); |
| 68 | |
| 69 | /* |
| 70 | * Sets MoveDone callback for entity |
| 71 | * |
| 72 | * @param entity Entity index |
| 73 | * @param callback The forward to call |
| 74 | * @param params Optional set of data to pass through to callback |
| 75 | * @param len Optional size of data |
| 76 | * |
| 77 | * @note Use "" to reset callback |
| 78 | * @note Entity should be inherited from CBaseToggle, otherwise server can crash |
| 79 | * @note Callback should be contains passing arguments as "public MoveDone_Callback(const ent)" |
| 80 | * |
| 81 | * @noreturn |
| 82 | */ |
| 83 | native SetMoveDone(const ent, const callback[], const params[] = "", const len = 0); |
| 84 | |
| 85 | /* |
| 86 | * Sets a value to CSGameRules_Members members. |
| 87 | * |
| 88 | * @param member The specified member, look at the enums with name CSGameRules_Members |
| 89 | * |
| 90 | * @return 1 on success. |
| 91 | */ |
| 92 | native set_member_game(CSGameRules_Members:member, any:...); |
| 93 | |
| 94 | /* |
| 95 | * Returns a value from CSGameRules_Members members |
| 96 | * |
| 97 | * @param member The specified member, look at the enums with name CSGameRules_Members |
| 98 | * |
| 99 | * @return If an integer or boolean or one byte, array or everything else is passed via the 3rd argument and more, look at the argument list for the specified member |
| 100 | */ |
| 101 | native any:get_member_game(CSGameRules_Members:member, any:...); |
| 102 | |
| 103 | /* |
| 104 | * Sets a value to an entity's member. |
| 105 | * |
| 106 | * @param index Entity index |
| 107 | * @param member The specified member, look at the enums with name *_Members |
| 108 | * |
| 109 | * @return 1 on success. |
| 110 | */ |
| 111 | native set_member(const index, any:member, any:...); |
| 112 | |
| 113 | /* |
| 114 | * Returns a value from an entity's member. |
| 115 | * |
| 116 | * @param index Entity index |
| 117 | * @param member The specified member, look at the enums with name *_Members |
| 118 | * |
| 119 | * @return If an integer or boolean or one byte, array or everything else is passed via the 3rd argument and more, look at the argument list for the specified member |
| 120 | */ |
| 121 | native any:get_member(const index, any:member, any:...); |
| 122 | |
| 123 | /* |
| 124 | * Sets a value to an entity's member. |
| 125 | * Safe version, can guarantee that the present member is refers to derived class of the entity. |
| 126 | * |
| 127 | * @param index Entity index |
| 128 | * @param member The specified member, look at the enums with name *_Members |
| 129 | * |
| 130 | * @return 1 on success. |
| 131 | */ |
| 132 | native set_member_s(const index, any:member, any:...); |
| 133 | |
| 134 | /* |
| 135 | * Returns a value from an entity's member. |
| 136 | * Safe version, can guarantee that the present member is refers to derived class of the entity. |
| 137 | * |
| 138 | * @param index Entity index |
| 139 | * @param member The specified member, look at the enums with name *_Members |
| 140 | * |
| 141 | * @return If an integer or boolean or one byte, array or everything else is passed via the 3rd argument and more, look at the argument list for the specified member |
| 142 | */ |
| 143 | native any:get_member_s(const index, any:member, any:...); |
| 144 | |
| 145 | /* |
| 146 | * Sets playermove var. |
| 147 | * |
| 148 | * @param var The specified playermove, look at the enum PlayerMove |
| 149 | * |
| 150 | * @return 1 on success. |
| 151 | */ |
| 152 | native set_pmove(const PlayerMove:var, any:...); |
| 153 | |
| 154 | /* |
| 155 | * Returns a playermove var. |
| 156 | * |
| 157 | * @param var The specified playermove var, look at the enums PlayerMove |
| 158 | * |
| 159 | * @return If an integer or boolean or one byte, array or everything else is passed via the 3rd argument and more, look at the argument list for the specified mvar |
| 160 | */ |
| 161 | native any:get_pmove(const PlayerMove:var, any:...); |
| 162 | |
| 163 | /* |
| 164 | * Sets a movevar value to a playermove. |
| 165 | * |
| 166 | * @param var The specified mvar, look at the enum MoveVars |
| 167 | * |
| 168 | * @return 1 on success. |
| 169 | */ |
| 170 | native set_movevar(const MoveVars:var, any:...); |
| 171 | |
| 172 | /* |
| 173 | * Returns a movevar value from a playermove. |
| 174 | * |
| 175 | * @param var The specified mvar, look at the enum MoveVars |
| 176 | * |
| 177 | * @return If an integer or boolean or one byte, array or everything else is passed via the 3rd argument and more, look at the argument list for the specified mvar |
| 178 | */ |
| 179 | native any:get_movevar(const MoveVars:var, any:...); |
| 180 | |
| 181 | /* |
| 182 | * Sets a pmtrace var. |
| 183 | * |
| 184 | * @param var The specified mvar, look at the enum PMTrace |
| 185 | * |
| 186 | * @return 1 on success. |
| 187 | */ |
| 188 | native set_pmtrace(const tracehandle, const PMTrace:var, any:...); |
| 189 | |
| 190 | /* |
| 191 | * Returns a pmtrace var |
| 192 | * |
| 193 | * @param var The specified mvar, look at the enum PMTrace |
| 194 | * |
| 195 | * @return If an integer or boolean or one byte, array or everything else is passed via the 3rd argument and more, look at the argument list for the specified mvar |
| 196 | */ |
| 197 | native any:get_pmtrace(const tracehandle, const PMTrace:var, any:...); |
| 198 | |
| 199 | /* |
| 200 | * Sets a RebuyStruct member. |
| 201 | * |
| 202 | * @param var The specified RebuyStruct, look at the enum RebuyStruct |
| 203 | * |
| 204 | * @return 1 on success. |
| 205 | */ |
| 206 | native set_rebuy(const RebuyHandle:rebuyhandle, const RebuyStruct:member, any:value); |
| 207 | |
| 208 | /* |
| 209 | * Returns a RebuyStruct member |
| 210 | * |
| 211 | * @param var The specified RebuyStruct, look at the enum RebuyStruct |
| 212 | * |
| 213 | * @return If an integer or boolean or one byte, array or everything else is passed via the 3rd argument and more, look at the argument list for the specified RebuyStruct |
| 214 | */ |
| 215 | native any:get_rebuy(const RebuyHandle:rebuyhandle, RebuyStruct:member); |
| 216 | |
| 217 | /* |
| 218 | * Assign the number of the player's animation. |
| 219 | * |
| 220 | * @param index Client index |
| 221 | * @param playerAnim Specific animation number |
| 222 | * |
| 223 | * @noreturn |
| 224 | */ |
| 225 | native rg_set_animation(const index, PLAYER_ANIM:playerAnim); |
| 226 | |
| 227 | /* |
| 228 | * Adds money to player's account. |
| 229 | * |
| 230 | * @param index Client index |
| 231 | * @param amount The amount of money |
| 232 | * @param bTrackChange If bTrackChange is 1, the amount of money added will also be displayed. |
| 233 | * |
| 234 | * @noreturn |
| 235 | */ |
| 236 | native rg_add_account(const index, amount, AccountSet:typeSet = AS_ADD, const bool:bTrackChange = true); |
| 237 | |
| 238 | /* |
| 239 | * Gives the player an item. |
| 240 | * |
| 241 | * @param index Client index |
| 242 | * @param pszName Item classname |
| 243 | * @param type Look at the enums with name GiveType |
| 244 | * |
| 245 | * @return Index of entity if successfull, -1 otherwise |
| 246 | */ |
| 247 | native rg_give_item(const index, const pszName[], GiveType:type = GT_APPEND); |
| 248 | |
| 249 | /* |
| 250 | * Gives the player an custom item, this means that don't handled API things. |
| 251 | * |
| 252 | * @example rg_give_custom_item(id, "weapon_c4"); doesn't sets the member m_bHasC4 to true, as the rg_give_item does. |
| 253 | * |
| 254 | * @param index Client index |
| 255 | * @param pszName Item classname |
| 256 | * @param type Look at the enums with name GiveType |
| 257 | * @param uid Sets a unique index for the entity |
| 258 | * |
| 259 | * @return Index of entity if successfull, -1 otherwise |
| 260 | * |
| 261 | */ |
| 262 | native rg_give_custom_item(const index, const pszName[], GiveType:type = GT_APPEND, const uid = 0); |
| 263 | |
| 264 | /* |
| 265 | * Give the default items to a player. |
| 266 | * |
| 267 | * @param index Client index |
| 268 | * |
| 269 | * @noreturn |
| 270 | */ |
| 271 | native rg_give_default_items(const index); |
| 272 | |
| 273 | /* |
| 274 | * Gives the player a shield |
| 275 | * |
| 276 | * @param index Client index |
| 277 | * @param bDeploy To deploy the shield |
| 278 | * |
| 279 | * @noreturn |
| 280 | */ |
| 281 | native rg_give_shield(const index, const bool:bDeploy = true); |
| 282 | |
| 283 | /* |
| 284 | * Inflicts damage in a radius from the source position. |
| 285 | * |
| 286 | * @param vecSrc The source position |
| 287 | * @param inflictor Inflictor is the entity that caused the damage (such as a gun) |
| 288 | * @param attacker Attacker is the entity that triggered the damage (such as the gun's owner) |
| 289 | * @param flDamage The amount of damage |
| 290 | * @param flRadius Damage radius |
| 291 | * @param iClassIgnore To specify classes that are immune to damage |
| 292 | * @param bitsDamageType Damage type DMG_* |
| 293 | * |
| 294 | * @noreturn |
| 295 | */ |
| 296 | native rg_dmg_radius(Float:vecSrc[3], const inflictor, const attacker, const Float:flDamage, const Float:flRadius, const iClassIgnore, const bitsDamageType); |
| 297 | |
| 298 | /* |
| 299 | * Resets the global multi damage accumulator. |
| 300 | * |
| 301 | * @noreturn |
| 302 | */ |
| 303 | native rg_multidmg_clear(); |
| 304 | |
| 305 | /* |
| 306 | * Inflicts contents of global multi damage registered on victim. |
| 307 | * |
| 308 | * @param inflictor Inflictor is the entity that caused the damage (such as a gun) |
| 309 | * @param attacker Attacker is the entity that triggered the damage (such as the gun's owner) |
| 310 | * |
| 311 | * @noreturn |
| 312 | */ |
| 313 | native rg_multidmg_apply(const inflictor, const attacker); |
| 314 | |
| 315 | /* |
| 316 | * Adds damage to the accumulator. |
| 317 | * |
| 318 | * @param inflictor Inflictor is the entity that caused the damage (such as a gun) |
| 319 | * @param victim The victim that takes damage |
| 320 | * @param flDamage The amount of damage |
| 321 | * @param bitsDamageType Damage type DMG_* |
| 322 | * |
| 323 | * @noreturn |
| 324 | */ |
| 325 | native rg_multidmg_add(const inflictor, const victim, const Float:flDamage, const bitsDamageType); |
| 326 | |
| 327 | /* |
| 328 | * Fires bullets from entity. |
| 329 | * |
| 330 | * @param inflictor Inflictor is the entity that caused the damage (such as a gun) |
| 331 | * @param attacker Attacker is the entity that triggered the damage (such as the gun's owner) |
| 332 | * @param shots The number of shots |
| 333 | * @param vecSrc The source position of the barrel |
| 334 | * @param vecDirShooting Shooting direction |
| 335 | * @param vecSpread Spread |
| 336 | * @param flDistance Max shot distance |
| 337 | * @param iBulletType Bullet type, look at the enum with name Bullet in cssdk_const.inc |
| 338 | * @param iTracerFreq Tracer frequency |
| 339 | * @param iDamage Damage amount |
| 340 | * |
| 341 | * @note: This native doesn't create a decal effect |
| 342 | * @note: Decal creation is handled by PlaybackEvent, including shot animation and shot sound |
| 343 | * |
| 344 | * @noreturn |
| 345 | */ |
| 346 | native rg_fire_bullets(const inflictor, const attacker, const shots, Float:vecSrc[3], Float:vecDirShooting[3], Float:vecSpread[3], const Float:flDistance, const Bullet:iBulletType, const iTracerFreq, const iDamage); |
| 347 | |
| 348 | /* |
| 349 | * Fires buckshots from entity (used at XM1014 and M3 weapons). |
| 350 | * |
| 351 | * @param inflictor Inflictor is the entity that caused the damage (such as a gun) |
| 352 | * @param attacker Attacker is the entity that triggered the damage (such as the gun's owner) |
| 353 | * @param shots The number of shots |
| 354 | * @param vecSrc The source position of the barrel |
| 355 | * @param vecDirShooting Shooting direction |
| 356 | * @param vecSpread Spread |
| 357 | * @param flDistance Max shot distance |
| 358 | * @param iTracerFreq Tracer frequency |
| 359 | * @param iDamage Damage amount |
| 360 | * |
| 361 | * @note: This native doesn't create a decal effect |
| 362 | * @note: Decal creation is handled by PlaybackEvent, including shot animation and shot sound |
| 363 | * |
| 364 | * @noreturn |
| 365 | */ |
| 366 | native rg_fire_buckshots(const inflictor, const attacker, const shots, Float:vecSrc[3], Float:vecDirShooting[3], Float:vecSpread[3], const Float:flDistance, const iTracerFreq, const iDamage); |
| 367 | |
| 368 | /* |
| 369 | * Fires bullets from player's weapon. |
| 370 | * |
| 371 | * @param inflictor Inflictor is the entity that caused the damage (such as a gun) |
| 372 | * @param attacker Attacker is the entity that triggered the damage (such as the gun's owner) |
| 373 | * @param vecSrc The source position of the barrel |
| 374 | * @param vecDirShooting Shooting direction |
| 375 | * @param vecSpread Spread |
| 376 | * @param flDistance Max shot distance |
| 377 | * @param iPenetration The amount of penetration |
| 378 | * @param iBulletType Bullet type, look at the enum with name Bullet in cssdk_const.inc |
| 379 | * @param iDamage Damage amount |
| 380 | * @param flRangeModifier Damage range modifier |
| 381 | * @param bPistol Pistol shot |
| 382 | * @param shared_rand Use player's random seed, get circular gaussian spread |
| 383 | * |
| 384 | * @note: This native doesn't create a decal effect |
| 385 | * @note: Decal creation is handled by PlaybackEvent, including shot animation and shot sound |
| 386 | * |
| 387 | * @return Float:[3] The spread result |
| 388 | */ |
| 389 | native Float:[3] rg_fire_bullets3(const inflictor, const attacker, Float:vecSrc[3], Float:vecDirShooting[3], const Float:vecSpread, const Float:flDistance, const iPenetration, const Bullet:iBulletType, const iDamage, const Float:flRangeModifier, const bool:bPistol, const shared_rand); |
| 390 | |
| 391 | /* |
| 392 | * Forces the round to end. |
| 393 | * |
| 394 | * @param tmDelay Delay before the onset of a new round |
| 395 | * @param st Which team won |
| 396 | * @param event The event is the end of the round |
| 397 | * @param message The message on round end |
| 398 | * @param sentence The sound at the end of the round |
| 399 | * @param trigger This will trigger to all hooks on that function |
| 400 | * Be very careful about recursion! |
| 401 | * |
| 402 | * @return 1 on success, 0 otherwise |
| 403 | */ |
| 404 | native rg_round_end(const Float:tmDelay, const WinStatus:st, const ScenarioEventEndRound:event = ROUND_NONE, const message[] = "default", const sentence[] = "default", const bool:trigger = false); |
| 405 | |
| 406 | /* |
| 407 | * Updates current scores. |
| 408 | * |
| 409 | * @param iCtsWins The amount of wins for counter-terrorists |
| 410 | * @param iTsWins The amount of wins for terrorists |
| 411 | * @param bAdd Adds the score to the current amount |
| 412 | * |
| 413 | * @noreturn |
| 414 | */ |
| 415 | native rg_update_teamscores(const iCtsWins = 0, const iTsWins = 0, const bool:bAdd = true); |
| 416 | |
| 417 | /* |
| 418 | * Creates an entity using Counter-Strike's custom CreateNamedEntity wrapper. |
| 419 | * |
| 420 | * @param classname Entity classname |
| 421 | * @param useHashTable Use this only for known game entities |
| 422 | * @note: Do not use this if you plan to change custom classname an entity after creation, |
| 423 | * otherwise it will never be release from hash table even if an entity was destroyed, |
| 424 | * and that to lead table to inflate/memory leaks |
| 425 | * |
| 426 | * @return Index of the created entity or 0 otherwise |
| 427 | */ |
| 428 | native rg_create_entity(const classname[], const bool:useHashTable = false); |
| 429 | |
| 430 | /* |
| 431 | * Finds an entity in the world using Counter-Strike's custom FindEntityByString wrapper. |
| 432 | * |
| 433 | * @param start_index Entity index to start searching from. -1 to start from the first entity |
| 434 | * @param classname Classname to search for |
| 435 | * @param useHashTable Use this only for known game entities |
| 436 | * |
| 437 | * @note: Do not use this if you use a custom classname |
| 438 | * |
| 439 | * @return Entity index > 0 if found, 0 otherwise |
| 440 | */ |
| 441 | native rg_find_ent_by_class(start_index, const classname[], const bool:useHashTable = false); |
| 442 | |
| 443 | /* |
| 444 | * Finds an entity in the world using Counter-Strike's custom FindEntityByString wrapper, matching by owner. |
| 445 | * |
| 446 | * @param start_index Entity index to start searching from. -1 to start from the first entity |
| 447 | * @param classname Classname to search for |
| 448 | * |
| 449 | * @return 1 if found, 0 otherwise |
| 450 | */ |
| 451 | native rg_find_ent_by_owner(&start_index, const classname[], owner); |
| 452 | |
| 453 | /* |
| 454 | * Finds the weapon by name in the player's inventory. |
| 455 | * |
| 456 | * @param index Client index |
| 457 | * @param weapon Weapon name |
| 458 | * |
| 459 | * @return Weapon's entity index, 0 otherwise |
| 460 | */ |
| 461 | native rg_find_weapon_bpack_by_name(const index, const weapon[]); |
| 462 | |
| 463 | /* |
| 464 | * Checks if the player has the item. |
| 465 | * |
| 466 | * @param index Client index |
| 467 | * @param item Item name |
| 468 | * |
| 469 | * @return true if he does, false otherwise |
| 470 | */ |
| 471 | native bool:rg_has_item_by_name(const index, const item[]); |
| 472 | |
| 473 | /* |
| 474 | * Returns specific information about the weapon. |
| 475 | * |
| 476 | * @param weapon name or id Weapon id, see WEAPON_* constants, WeaponIdType or weapon_* name |
| 477 | * @param WpnInfo:type Info type, see WI_* constants |
| 478 | * |
| 479 | * @note weapon_* name can only be used to get WI_ID |
| 480 | * |
| 481 | * @return Weapon information |
| 482 | * @error If weapon_id or type are out of bounds, an error will be thrown |
| 483 | */ |
| 484 | native any:rg_get_weapon_info(any:...); |
| 485 | |
| 486 | /* |
| 487 | * Sets specific weapon info values. |
| 488 | * |
| 489 | * @param weapon_id Weapon id, see WEAPON_* constants |
| 490 | * @param type Info type, see WI_* constants |
| 491 | * |
| 492 | * @return 1 on success, 0 otherwise |
| 493 | */ |
| 494 | native rg_set_weapon_info(const {WeaponIdType,_}:weapon_id, WpnInfo:type, any:...); |
| 495 | |
| 496 | /* |
| 497 | * Remove all the player's stuff in a specific slot. |
| 498 | * |
| 499 | * @param index Client index |
| 500 | * @param slot The slot that will be emptied |
| 501 | * @param removeAmmo Remove ammunition |
| 502 | * |
| 503 | * @return 1 - successful removal of all items in the slot or the slot is empty |
| 504 | * 0 - if at least one item failed to remove |
| 505 | */ |
| 506 | native rg_remove_items_by_slot(const index, const InventorySlotType:slot, const bool:removeAmmo = true); |
| 507 | |
| 508 | /* |
| 509 | * Drop to floor all the player's stuff by specific slot. |
| 510 | * |
| 511 | * @param index Client index |
| 512 | * @param slot Specific slot for remove of each item. |
| 513 | * |
| 514 | * @return 1 - successful drop of all items in the slot or the slot is empty |
| 515 | * 0 - if at least one item failed to drop |
| 516 | */ |
| 517 | native rg_drop_items_by_slot(const index, const InventorySlotType:slot); |
| 518 | |
| 519 | /* |
| 520 | * Remove all of the player's items. |
| 521 | * |
| 522 | * @param index Client index |
| 523 | * @param removeSuit Remove suit |
| 524 | * |
| 525 | * @return 1 on success, 0 otherwise |
| 526 | */ |
| 527 | native rg_remove_all_items(const index, const bool:removeSuit = false); |
| 528 | |
| 529 | /* |
| 530 | * Forces the player to drop the specified item classname. |
| 531 | * |
| 532 | * @param index Client index |
| 533 | * @param item_name Item classname, if no name, the active item classname |
| 534 | * |
| 535 | * @return Entity index of weaponbox, AMX_NULLENT (-1) otherwise |
| 536 | * |
| 537 | */ |
| 538 | native rg_drop_item(const index, const item_name[]); |
| 539 | |
| 540 | /* |
| 541 | * Executes a client command on the gamedll side. |
| 542 | * |
| 543 | * @param index Client index |
| 544 | * @param command Client command to execute |
| 545 | * @param arg Optional command arguments |
| 546 | * |
| 547 | * @return 1 on success, 0 otherwise |
| 548 | */ |
| 549 | native rg_internal_cmd(const index, const cmd[], const arg[] = ""); |
| 550 | |
| 551 | /* |
| 552 | * Removes the specified item classname from the player |
| 553 | * |
| 554 | * @param index Client index |
| 555 | * @param item_name Item classname |
| 556 | * @param removeAmmo Remove ammunition |
| 557 | * |
| 558 | * @return 1 if found and remove, 0 otherwise |
| 559 | */ |
| 560 | native rg_remove_item(const index, const item_name[], const bool:removeAmmo = false); |
| 561 | |
| 562 | /* |
| 563 | * Sets the amount of ammo in the client's backpack for a specific weapon. |
| 564 | * |
| 565 | * @param index Client index |
| 566 | * @param weapon Weapon id |
| 567 | * @param amount New backpack ammo amount to set |
| 568 | * |
| 569 | * @noreturn |
| 570 | */ |
| 571 | native rg_set_user_bpammo(const index, WeaponIdType:weapon, amount); |
| 572 | |
| 573 | /* |
| 574 | * Returns the amount of ammo in the client's backpack for a specific weapon. |
| 575 | * |
| 576 | * @param index Client index |
| 577 | * @param weapon Weapon id |
| 578 | * |
| 579 | * @return Amount of ammo in backpack |
| 580 | */ |
| 581 | native rg_get_user_bpammo(const index, WeaponIdType:weapon); |
| 582 | |
| 583 | /* |
| 584 | * Sets the amount of clip ammo for a specific weapon. |
| 585 | * |
| 586 | * @param index Client index |
| 587 | * @param weapon Weapon id |
| 588 | * @param amount New clip ammo amount to set |
| 589 | * |
| 590 | * @noreturn |
| 591 | */ |
| 592 | native rg_set_user_ammo(const index, WeaponIdType:weapon, amount); |
| 593 | |
| 594 | /* |
| 595 | * Returns the amount of clip ammo for a specific weapon. |
| 596 | * |
| 597 | * @param index Client index |
| 598 | * @param weapon Weapon id |
| 599 | * |
| 600 | * @return Amount of clip ammo |
| 601 | */ |
| 602 | native rg_get_user_ammo(const index, WeaponIdType:weapon); |
| 603 | |
| 604 | /* |
| 605 | * Sets the client's defusekit status and allows to set a custom HUD icon and color. |
| 606 | * |
| 607 | * @param index Client index |
| 608 | * @param defusekit If nonzero the client will have a defusekit, otherwise it will be removed |
| 609 | * @param color Color RGB |
| 610 | * @param icon HUD sprite to use as an icon |
| 611 | * @param flash If nonzero the icon will flash red |
| 612 | * |
| 613 | * @noreturn |
| 614 | */ |
| 615 | native rg_give_defusekit(const index, const bool:bDefusekit = true, const Float:color[] = {0.0, 160.0, 0.0}, const icon[] = "defuser", const bool:bFlash = false); |
| 616 | |
| 617 | /* |
| 618 | * Returns the client's armor value and retrieves the type of armor. |
| 619 | * |
| 620 | * @param index Client index |
| 621 | * @param armortype Variable to store armor type in |
| 622 | * |
| 623 | * @return Amount of armor, 0 if the client has no armor |
| 624 | */ |
| 625 | native rg_get_user_armor(const index, &ArmorType:armortype = ARMOR_NONE); |
| 626 | |
| 627 | /* |
| 628 | * Sets the client's armor value and the type of armor. |
| 629 | * |
| 630 | * @param index Client index |
| 631 | * @param armorvalue Amount of armor to set |
| 632 | * @param armortype Armor type to set |
| 633 | * |
| 634 | * @noreturn |
| 635 | */ |
| 636 | native rg_set_user_armor(const index, armorvalue, ArmorType:armortype); |
| 637 | |
| 638 | /* |
| 639 | * Sets the client's team without killing the player and sets the client's model. |
| 640 | * @note To obtain a TeamName use the following: |
| 641 | * new TeamName:team = get_member(id, m_iTeam); |
| 642 | * |
| 643 | * @param index Client index |
| 644 | * @param team Team id |
| 645 | * @param model Internal model, use MODEL_AUTO for a random appearance or MODEL_UNASSIGNED to not update it |
| 646 | * |
| 647 | * @param send_teaminfo If true, a TeamInfo message will be sent |
| 648 | * @param check_win_conditions If true, a CheckWinConditions will be call |
| 649 | * |
| 650 | * @return 1 on success, 0 otherwise |
| 651 | */ |
| 652 | native rg_set_user_team(const index, {TeamName,_}:team, {ModelName,_}:model = MODEL_AUTO, const bool:send_teaminfo = true, const bool:check_win_conditions = false); |
| 653 | |
| 654 | /* |
| 655 | * Sets the client's player model. |
| 656 | * |
| 657 | * @param index Client index |
| 658 | * @param model Model name |
| 659 | * @param update_index If true, the modelindex is updated as well |
| 660 | * |
| 661 | * @return 1 on success, 0 otherwise |
| 662 | */ |
| 663 | native rg_set_user_model(const index, const model[], const bool:update_index = false); |
| 664 | |
| 665 | /* |
| 666 | * Resets the client's model. |
| 667 | * |
| 668 | * @param index Client index |
| 669 | * @param update_index If true, the modelindex is reset as well |
| 670 | * |
| 671 | * @return 1 on success, 0 otherwise |
| 672 | */ |
| 673 | native rg_reset_user_model(const index, const bool:update_index = false); |
| 674 | |
| 675 | /* |
| 676 | * Enable/Disable player's footsteps. |
| 677 | * |
| 678 | * @param index Client index |
| 679 | * @param silent To enable silent footsteps |
| 680 | * |
| 681 | * @return 1 on success, 0 otherwise |
| 682 | */ |
| 683 | native rg_set_user_footsteps(const index, bool:silent = false); |
| 684 | |
| 685 | /* |
| 686 | * Get the current footsteps state of the player. |
| 687 | * |
| 688 | * @param index Client index |
| 689 | * |
| 690 | * @return 1 if the player has silent footsteps, 0 otherwise |
| 691 | */ |
| 692 | native rg_get_user_footsteps(const index); |
| 693 | |
| 694 | /* |
| 695 | * Transfers C4 from one player to another. |
| 696 | * |
| 697 | * @param index Client index |
| 698 | * @param receiver Receiver index, if 0 it will transfer to a random player |
| 699 | * |
| 700 | * @return Index of player entity if successfull, 0 otherwise |
| 701 | */ |
| 702 | native rg_transfer_c4(const index, const receiver = 0); |
| 703 | |
| 704 | /* |
| 705 | * Instantly reload client's weapons. |
| 706 | * |
| 707 | * @param index Client index |
| 708 | * @param weapon Weapon entity-index, if 0 then all weapons will be reloaded |
| 709 | * |
| 710 | * @return 1 on success, 0 otherwise |
| 711 | */ |
| 712 | native rg_instant_reload_weapons(const index, const weapon = 0); |
| 713 | |
| 714 | /* |
| 715 | * Plant a bomb. |
| 716 | * |
| 717 | * @param index Owner index or 0 for worldspawn. |
| 718 | * @param origin The origin of the bomb where it will be planted. |
| 719 | * @param angles The angles of the planted bomb. |
| 720 | * |
| 721 | * @return Index of bomb entity or AMX_NULLENT (-1) otherwise |
| 722 | */ |
| 723 | native rg_plant_bomb(const index, Float:vecOrigin[3], Float:vecAngles[3] = {0.0,0.0,0.0}); |
| 724 | |
| 725 | /* |
| 726 | * Sets the amount of reward in the game account for all players. |
| 727 | * |
| 728 | * @param rules_index Look at the enum with name RewardRules |
| 729 | * @param amount The money amount |
| 730 | * |
| 731 | * @noreturn |
| 732 | */ |
| 733 | native rg_set_account_rules(const RewardRules:rules_index, const amount); |
| 734 | |
| 735 | /* |
| 736 | * Gets the specified reward rule's money amount. |
| 737 | * |
| 738 | * @param rules_index Look at the enum with name RewardRules |
| 739 | * |
| 740 | * @return The amount of reward |
| 741 | * |
| 742 | */ |
| 743 | native rg_get_account_rules(const RewardRules:rules_index); |
| 744 | |
| 745 | /* |
| 746 | * Checks if the bomb is planted. |
| 747 | * |
| 748 | * @return true if the bomb is planted, false otherwise |
| 749 | */ |
| 750 | native bool:rg_is_bomb_planted(); |
| 751 | |
| 752 | /* |
| 753 | * Forces a player to join a team. |
| 754 | * |
| 755 | * @param index Client index |
| 756 | * @param team Team id |
| 757 | * |
| 758 | * @return 1 on success, 0 otherwise |
| 759 | */ |
| 760 | native rg_join_team(const index, const TeamName:team); |
| 761 | |
| 762 | /* |
| 763 | * Instantly balances the teams. |
| 764 | * |
| 765 | * @noreturn |
| 766 | */ |
| 767 | native rg_balance_teams(); |
| 768 | |
| 769 | /* |
| 770 | * Swaps players' teams without reseting frags, deaths and wins. |
| 771 | * |
| 772 | * @noreturn |
| 773 | */ |
| 774 | native rg_swap_all_players(); |
| 775 | |
| 776 | /* |
| 777 | * Instantly switches the player to his opposite team. |
| 778 | * @note Switch from CT to TERRORIST is also opposite. |
| 779 | * |
| 780 | * @param index Client index |
| 781 | * |
| 782 | * @noreturn |
| 783 | */ |
| 784 | native rg_switch_team(const index); |
| 785 | |
| 786 | /* |
| 787 | * Forces the player to switch to a specific weapon. |
| 788 | * |
| 789 | * @param index Client index |
| 790 | * @param weapon Weapon entity-index |
| 791 | * |
| 792 | * @return 1 on success, 0 otherwise |
| 793 | */ |
| 794 | native rg_switch_weapon(const index, const weapon); |
| 795 | |
| 796 | /* |
| 797 | * Gets which team has a higher join priority. |
| 798 | * |
| 799 | * @return Returns the Team Name |
| 800 | */ |
| 801 | native TeamName:rg_get_join_team_priority(); |
| 802 | |
| 803 | /* |
| 804 | * Checks whether the player can take damage from the attacker. |
| 805 | * |
| 806 | * @param index Client index |
| 807 | * @param attacker Attacker index |
| 808 | * |
| 809 | * @return true if player can take damage, false otherwise |
| 810 | */ |
| 811 | native bool:rg_is_player_can_takedamage(const index, const attacker); |
| 812 | |
| 813 | /* |
| 814 | * Checks whether the player can respawn. |
| 815 | * |
| 816 | * @param index Client index |
| 817 | * |
| 818 | * @return true if player can respawn, false otherwise |
| 819 | */ |
| 820 | native bool:rg_is_player_can_respawn(const index); |
| 821 | |
| 822 | /* |
| 823 | * Gets WeaponIdType from weaponbox |
| 824 | * |
| 825 | * @param entity Weaponbox entity |
| 826 | * |
| 827 | * @return return enum of WeaponIdType |
| 828 | */ |
| 829 | native WeaponIdType:rg_get_weaponbox_id(const entity); |
| 830 | |
| 831 | /* |
| 832 | * Respawn on round for players/bots. |
| 833 | * |
| 834 | * @param index Client index |
| 835 | * |
| 836 | * @noreturn |
| 837 | */ |
| 838 | native rg_round_respawn(const index); |
| 839 | |
| 840 | /* |
| 841 | * Resets player's maxspeed. |
| 842 | * |
| 843 | * @param index Client index |
| 844 | * |
| 845 | * @noreturn |
| 846 | */ |
| 847 | native rg_reset_maxspeed(const index); |
| 848 | |
| 849 | /* |
| 850 | * Draws a HUD progress bar which fills from 0% to 100% for the time duration in seconds. |
| 851 | * @note: Set the duration to 0 to hide the bar. |
| 852 | * |
| 853 | * @param index Client index |
| 854 | * @param time Duration |
| 855 | * @param observer Send for everyone who is observing the player |
| 856 | * |
| 857 | * @noreturn |
| 858 | */ |
| 859 | native rg_send_bartime(const index, const duration, const bool:observer = true); |
| 860 | |
| 861 | /* |
| 862 | * Same as BarTime, but StartPercent specifies how much of the bar is (already) filled. |
| 863 | * |
| 864 | * @param index Client index |
| 865 | * @param time Duration |
| 866 | * @param startPercent Start percent |
| 867 | * @param observer Send for everyone who is observing the player |
| 868 | * |
| 869 | * @noreturn |
| 870 | */ |
| 871 | native rg_send_bartime2(const index, const duration, const Float:startPercent, const bool:observer = true); |
| 872 | |
| 873 | /* |
| 874 | * Sends the SendAudio message - plays the specified audio. |
| 875 | * |
| 876 | * @param index Receiver index or use 0 for everyone |
| 877 | * @param sample Sound file to play |
| 878 | * @param pitch Sound pitch |
| 879 | * |
| 880 | * @noreturn |
| 881 | */ |
| 882 | native rg_send_audio(const index, const sample[], const pitch = PITCH_NORM); |
| 883 | |
| 884 | /** |
| 885 | * Sets a parameter of the member CSPlayerItem::m_ItemInfo |
| 886 | * |
| 887 | * @param entity Entity index |
| 888 | * @param type Item info type. See ItemInfo constants. |
| 889 | * |
| 890 | */ |
| 891 | native rg_set_iteminfo(const entity, ItemInfo:type, any:...); |
| 892 | |
| 893 | /** |
| 894 | * Gets a parameter of the member CSPlayerItem::m_ItemInfo |
| 895 | * |
| 896 | * @param entity Entity index |
| 897 | * @param type Item info type. See ItemInfo constants. |
| 898 | * |
| 899 | */ |
| 900 | native rg_get_iteminfo(const ent, ItemInfo:type, any:...); |
| 901 | |
| 902 | /** |
| 903 | * Sets a parameter of the global CBasePlayerItem::m_ItemInfoArray array |
| 904 | * @note To have effect on client side (i.g. ammo size on HUD) you should |
| 905 | * alter this value BEFORE WeaponList message is sent to client, or |
| 906 | * force it's alteration by sending again to the specific client. |
| 907 | * Hooking WeaponList message with AMXX's register_message is a choice. |
| 908 | * |
| 909 | * @param weapon_id Weapon id, see WEAPON_* constants |
| 910 | * @param type Item info type. See ItemInfo constants. |
| 911 | * |
| 912 | */ |
| 913 | native rg_set_global_iteminfo(const {WeaponIdType,_}:weapon_id, ItemInfo:type, any:...); |
| 914 | |
| 915 | /** |
| 916 | * Gets a parameter of the global CBasePlayerItem::m_ItemInfoArray array |
| 917 | * |
| 918 | * @param weapon_id Weapon id, see WEAPON_* constants |
| 919 | * @param type Item info type. See ItemInfo constants. |
| 920 | * |
| 921 | */ |
| 922 | native rg_get_global_iteminfo(const {WeaponIdType,_}:weapon_id, ItemInfo:type, any:...); |
| 923 | |
| 924 | /* |
| 925 | * Adds hint message to the queue. |
| 926 | * |
| 927 | * @param index Client index |
| 928 | * @param message The message hint |
| 929 | * @param duration The time duration in seconds stays on screen |
| 930 | * @param bDisplayIfPlayerDead Whether to print hint for dead players? |
| 931 | * @param bOverride Whether to override previous messages? |
| 932 | * |
| 933 | * @return true if prints, false otherwise |
| 934 | */ |
| 935 | native bool:rg_hint_message(const index, const message[], Float:duration = 6.0, bool:bDisplayIfPlayerDead = false, bool:bOverride = false); |
| 936 | |
| 937 | /* |
| 938 | * Instantly restart round. |
| 939 | * |
| 940 | * @noreturn |
| 941 | */ |
| 942 | native rg_restart_round(); |
| 943 | |
| 944 | /* |
| 945 | * Instantly check win conditions. |
| 946 | * |
| 947 | * @noreturn |
| 948 | */ |
| 949 | native rg_check_win_conditions(); |
| 950 | |
| 951 | /* |
| 952 | * Instantly initialize player counts. |
| 953 | * |
| 954 | * @param num_alive_terrorist Count alive terrorists |
| 955 | * @param num_alive_ct Count alive counter-terrorists |
| 956 | * @param num_dead_terrorist Count dead terrorists |
| 957 | * @param num_dead_ct Count dead counter-terrorists |
| 958 | * |
| 959 | * @noreturn |
| 960 | */ |
| 961 | native rg_initialize_player_counts(&num_alive_terrorist = 0, &num_alive_ct = 0, &num_dead_terrorist = 0, &num_dead_ct = 0); |
| 962 | |
| 963 | /* |
| 964 | * Reset if player can hear another player. |
| 965 | * |
| 966 | * @param index Player id |
| 967 | * @noreturn |
| 968 | */ |
| 969 | native rg_reset_can_hear_player(const index); |
| 970 | |
| 971 | /* |
| 972 | * Set if player can hear another player |
| 973 | * |
| 974 | * @param listener Listener player id |
| 975 | * @param sender Sender player id |
| 976 | * @param can_hear Can listener hear sender |
| 977 | * |
| 978 | * @noreturn |
| 979 | */ |
| 980 | native rg_set_can_hear_player(const listener, const sender, const bool:can_hear); |
| 981 | |
| 982 | /* |
| 983 | * Get if player can hear another player |
| 984 | * |
| 985 | * @param listener Listener player id |
| 986 | * @param sender Sender player id |
| 987 | * |
| 988 | * @return boolean |
| 989 | */ |
| 990 | native bool:rg_get_can_hear_player(const listener, const sender); |
| 991 | |
| 992 | /* |
| 993 | * Spawn a head gib |
| 994 | * |
| 995 | * @param index Entity id |
| 996 | * |
| 997 | * @return Index of head gib entity or AMX_NULLENT (-1) otherwise |
| 998 | */ |
| 999 | native rg_spawn_head_gib(const index); |
| 1000 | |
| 1001 | /* |
| 1002 | * Spawn random gibs |
| 1003 | * |
| 1004 | * @param index Entity id |
| 1005 | * @param cGibs Count gibs |
| 1006 | * @param bHuman Set gibs of a human or alien |
| 1007 | * |
| 1008 | * @noreturn |
| 1009 | */ |
| 1010 | native rg_spawn_random_gibs(const index, const cGibs, const bool:bHuman = true); |
| 1011 | |
| 1012 | /* |
| 1013 | * Spawn a grenade (HEGrenade, Flashbang, SmokeGrenade, or C4) |
| 1014 | * |
| 1015 | * @param weaponId WEAPON_HEGRENADE, WEAPON_SMOKEGRENADE, WEAPON_FLASHBANG or WEAPON_C4 |
| 1016 | * @param pevOwner Grenade owner |
| 1017 | * @param vecSrc Grenade spawn position |
| 1018 | * @param vecThrow Grenade velocity vector |
| 1019 | * @param time Grenade explosion time |
| 1020 | * @param iTeam Grenade team, see TEAM_* constants |
| 1021 | * @param usEvent Event index related to grenade (returned value of precache_event) |
| 1022 | * |
| 1023 | * @return Entity index on success, AMX_NULLENT (-1) otherwise |
| 1024 | */ |
| 1025 | native rg_spawn_grenade(WeaponIdType:weaponId, pevOwner, Float:vecSrc[3], Float:vecThrow[3], Float:time, TeamName:iTeam, usEvent = 0); |
| 1026 | |
| 1027 | /* |
| 1028 | * Spawn a weaponbox entity with its properties |
| 1029 | * |
| 1030 | * @param pItem Weapon entity index to attach |
| 1031 | * @param pPlayerOwner Player index to remove pItem entity (0 = no weapon owner) |
| 1032 | * @param modelName Model name ("models/w_*.mdl") |
| 1033 | * @param origin Weaponbox origin position |
| 1034 | * @param angles Weaponbox angles |
| 1035 | * @param velocity Weaponbox initial velocity vector |
| 1036 | * @param lifeTime Time to stay in world (< 0.0 = use mp_item_staytime cvar value) |
| 1037 | * @param packAmmo Set if ammo should be removed from weapon owner |
| 1038 | * |
| 1039 | * @return Weaponbox ent index on success, AMX_NULLENT (-1) otherwise |
| 1040 | */ |
| 1041 | native rg_create_weaponbox(const pItem, const pPlayerOwner, const modelName[], Float:origin[3], Float:angles[3], Float:velocity[3], Float:lifeTime, bool:packAmmo); |
| 1042 | |
| 1043 | /* |
| 1044 | * Removes an entity using gamedll's UTIL_Remove function, which sets a frame delay to ensure its removal. |
| 1045 | * |
| 1046 | * @param pEntity Entity index to remove |
| 1047 | * |
| 1048 | * @return 1 on success, 0 otherwise |
| 1049 | */ |
| 1050 | native rg_remove_entity(const pEntity); |
| 1051 | |
| 1052 | /* |
| 1053 | * Creates a Decal in world based on a traceresult. |
| 1054 | * |
| 1055 | * @param ptr Traceresult pointer, use Fakemeta's create_tr2 to instantiate one |
| 1056 | * @param decalNumber Number of decal to spray, see DECAL_ constants on cssdk_const.inc |
| 1057 | * |
| 1058 | * @noreturn |
| 1059 | */ |
| 1060 | native rg_decal_trace(const ptr, Decal:decalNumber); |
| 1061 | |
| 1062 | /* |
| 1063 | * Emits a sound based on a traceresult simulating a bullet hit (metal, wood, concrete, etc.). |
| 1064 | * @note Used mostly on trace attacks (bullets, knife). |
| 1065 | * |
| 1066 | * @param ptr Traceresult pointer, use Fakemeta's create_tr2 to instantiate one |
| 1067 | * @param vecSrc Start position |
| 1068 | * @param vecEnd End position, must match ptr's vecEndPos member |
| 1069 | * @param iBulletType Bullet type, see BULLET_* constants in cssdk_const.inc |
| 1070 | * |
| 1071 | * @noreturn |
| 1072 | */ |
| 1073 | native rg_emit_texture_sound(const ptr, Float:vecSrc[3], Float:vecEnd[3], Bullet:iBulletType); |
| 1074 | |
| 1075 | /* |
| 1076 | * Generates an ammo slot in game's logic |
| 1077 | * @note To see a visual effect, WeaponList message should be sent using the custom ammo name, |
| 1078 | * where ammo icon HUD will be the one listed in "sprites/weapon_<name>.txt" file. |
| 1079 | * |
| 1080 | * @param szAmmoname Ammo name to create. |
| 1081 | * |
| 1082 | * @note Maximum ammo index is 31, after that every ammo instantiation will start from 1 overriding existing ones. |
| 1083 | * @return New ammo index. If name already exists, will return the matched index from memory. |
| 1084 | */ |
| 1085 | native rg_add_ammo_registry(const szAmmoname[]); |
| 1086 | |
| 1087 | /* |
| 1088 | * Deploys a weapon attached to a player using the CBasePlayerWeapon::DefaultDeploy function. |
| 1089 | * |
| 1090 | * @param entity Weapon to deploy. Must be attached to a player. |
| 1091 | * @param szViewModel Weapon view model name ("models/v_*.mdl") |
| 1092 | * @param szWeaponModel Weapon world model bame ("models/p_*.mdl") |
| 1093 | * @param iAnim Weapon view model animation to play (often "deploy", use HLMV to see anim index) |
| 1094 | * @param szAnimExt Player anim extension name to assign. Examples: "carbine", "shotgun", "knife", etc. |
| 1095 | * Use HLMV on a player model to see animext names. |
| 1096 | * @param skiplocal If 0, weapon animation will be forced to play on client ignoring active client prediction. |
| 1097 | * |
| 1098 | * @return 1 on successful weapon deploy, 0 otherwise. |
| 1099 | */ |
| 1100 | native rg_weapon_deploy(const entity, const szViewModel[], const szWeaponModel[], iAnim, const szAnimExt[], skiplocal = 0); |
| 1101 | |
| 1102 | /* |
| 1103 | * Reloads a weapon or a player's active weapon using the CBasePlayerWeapon::DefaultReload function. |
| 1104 | * |
| 1105 | * @param entity Weapon to reload (> MaxClients) OR player index to reload his current active weapon (>= 1 & <= MaxClients). |
| 1106 | * @param iClipSize Weapon max clip to check. 0 = weapon max clip stored in ItemInfo |
| 1107 | * @param iAnim Weapon view model animation to play (often "reload", use HLMV to see anim index) |
| 1108 | * @param fDelay Player reload duration before clip refill. |
| 1109 | * |
| 1110 | * @return 1 on successful weapon reload, 0 otherwise. |
| 1111 | */ |
| 1112 | native rg_weapon_reload(const entity, iClipSize, iAnim, Float:fDelay); |
| 1113 | |
| 1114 | /* |
| 1115 | * Forces shotgun reload thinking on a weapon or a player's active weapon using the CBasePlayerWeapon::DefaultShotgunReload function. |
| 1116 | * |
| 1117 | * @param entity Weapon to reload (> MaxClients) OR player index to reload his current active weapon (>= 1 & <= MaxClients). |
| 1118 | * @param iAnim Weapon view model "insert" animation to play (use HLMV to see anim index) |
| 1119 | * @param iStartAnim Weapon view model "start reload" animation to play (use HLMV to see anim index) |
| 1120 | * @param fDelay Delay between each buckshot inserted |
| 1121 | * @param fStartDelay Delay before buckshots insertion starts |
| 1122 | * @param pszReloadSound1 Sound to play on every insertion |
| 1123 | * @param pszReloadSound2 Another sound to play on every insertion |
| 1124 | * |
| 1125 | * @note This is used inside weapon's Reload function and is often called every frame player is pressing IN_RELOAD button. |
| 1126 | * @return 1 while weapon not in delay and with ammo remaining to load, 0 otherwise. |
| 1127 | */ |
| 1128 | native rg_weapon_shotgun_reload(const entity, iAnim, iStartAnim, Float:fDelay, Float:fStartDelay, const pszReloadSound1[] = "", const pszReloadSound2[] = ""); |
| 1129 | |
| 1130 | /* |
| 1131 | * Sends a weapon animation using the CBasePlayerWeapon::SendWeaponAnim function. |
| 1132 | * |
| 1133 | * @param entity Weapon to send animation on owner (> MaxClients) OR player index to send animation (>= 1 & <= MaxClients). |
| 1134 | * @param iAnim Weapon view model animation to play (use HLMV to see anim index) |
| 1135 | * @param skiplocal If 0, weapon animation will be forced to play on client ignoring active client prediction. |
| 1136 | * |
| 1137 | * @noreturn |
| 1138 | */ |
| 1139 | native rg_weapon_send_animation(const entity, iAnim, skiplocal = 0); |
| 1140 | |
| 1141 | /* |
| 1142 | * Emits a "recoil" effect on weapon's player using the CBasePlayerWeapon::KickBack function. |
| 1143 | * |
| 1144 | * @param entity Weapon to reload (> MaxClients) OR player index to reload his current active weapon (>= 1 & <= MaxClients). |
| 1145 | * @param up_base Minimum vertical punchangle |
| 1146 | * @param lateral_base Minimum horizontal punchangle |
| 1147 | * @param up_modifier Vertical punchangle units to multiply to m_iShotsFired member |
| 1148 | * @param lateral_modifier Horizontal punchangle units to multiply to m_iShotsFired member |
| 1149 | * @param up_max Maximum vertical punchangle |
| 1150 | * @param lateral_max Maximum horizontal punchangle |
| 1151 | * @param direction_change Probability to change punchangle orientation (positive or negative). 0 = 100% (1/1), 1 = 50% (1/2), 2 = 33.3% (1/3), ... |
| 1152 | * |
| 1153 | * @noreturn |
| 1154 | */ |
| 1155 | native rg_weapon_kickback(const entity, Float:up_base, Float:lateral_base, Float:up_modifier, Float:lateral_modifier, Float:up_max, Float:lateral_max, direction_change); |
| 1156 | |
| 1157 | /* |
| 1158 | * Switches player current weapon into the best one on its inventory using the CHalfLifeMultiplay::GetNextBestWeapon function. |
| 1159 | * |
| 1160 | * @param player Player index. |
| 1161 | * @param currentWeapon Current player active weapon. 0 = retrieve from m_pActiveItem member |
| 1162 | * |
| 1163 | * @note Weapon selection is based on weapon's Weight attribute from ItemInfo structure. |
| 1164 | * @return 1 if weapon was found and switched to, 0 otherwise |
| 1165 | */ |
| 1166 | native rg_switch_best_weapon(const player, const currentWeapon = 0); |
| 1167 | |
| 1168 | /* |
| 1169 | * Disappear a player from the world. Used when VIP reaches escape zone. Basically a silent kill. |
| 1170 | * |
| 1171 | * @param player Player index. |
| 1172 | * |
| 1173 | * @noreturn |
| 1174 | */ |
| 1175 | native rg_disappear(const player); |
| 1176 | |
| 1177 | /* |
| 1178 | * Sets player current Observer mode. |
| 1179 | * @note Player must be a valid observer (m_afPhysicsFlags & PFLAG_OBSERVER). |
| 1180 | * |
| 1181 | * @param player Player index. |
| 1182 | * @param mode Observer mode, see OBS_* constants in cssdk_const.inc |
| 1183 | * |
| 1184 | * @noreturn |
| 1185 | */ |
| 1186 | native rg_set_observer_mode(const player, const mode); |
| 1187 | |
| 1188 | /* |
| 1189 | * Emits a death notice (logs, DeathMsg event, win conditions check) |
| 1190 | * |
| 1191 | * @param pVictim Player index. |
| 1192 | * @param pKiller Killer entity. |
| 1193 | * @param pevInflictor Inflictor entity. 0 = world |
| 1194 | * |
| 1195 | * @noreturn |
| 1196 | */ |
| 1197 | native rg_death_notice(const pVictim, const pKiller, const pevInflictor); |
| 1198 | |