WeaponMod: различия между версиями
Nikita (обсуждение | вклад) (Новая страница: «== hl_wpnmod.inc == === wpnmod_register_weapon === Регистрация нового оружия. Возвращает ID зарегистрированно…») |
Nikita (обсуждение | вклад) |
||
Строка 7: | Строка 7: | ||
native wpnmod_register_weapon(const szName[], const iSlot, const iPosition, const szAmmo1[], const iMaxAmmo1, const szAmmo2[], const, iMaxAmmo2, const iMaxClip, const iFlags, const iWeight); | native wpnmod_register_weapon(const szName[], const iSlot, const iPosition, const szAmmo1[], const iMaxAmmo1, const szAmmo2[], const, iMaxAmmo2, const iMaxClip, const iFlags, const iWeight); | ||
+ | |||
{| class="wide" | {| class="wide" | ||
Строка 47: | Строка 48: | ||
native wpnmod_register_weapon_forward(const iWeaponID, const e_WpnFwds: iForward, const szCallBack[]); | native wpnmod_register_weapon_forward(const iWeaponID, const e_WpnFwds: iForward, const szCallBack[]); | ||
− | + | ||
− | + | {| class="wide" | |
− | + | |- | |
+ | | iWeaponID | ||
+ | | ID оружия | ||
+ | |- | ||
+ | | iForward | ||
+ | | Forward type to register. | ||
+ | |- | ||
+ | | szCallBack | ||
+ | | The forward to call | ||
+ | |} | ||
=== wpnmod_get_weapon_info === | === wpnmod_get_weapon_info === | ||
Строка 57: | Строка 67: | ||
native wpnmod_get_weapon_info(const iId, const e_ItemInfo: iInfoType, any:...); | native wpnmod_get_weapon_info(const iId, const e_ItemInfo: iInfoType, any:...); | ||
− | + | ||
− | + | {| class="wide" | |
− | + | |- | |
+ | | iId | ||
+ | | The ID of registered weapon or weapon entity Id. | ||
+ | |- | ||
+ | | iInfoType | ||
+ | | ItemInfo type | ||
+ | |} | ||
+ | |||
+ | return Weapon's ItemInfo variable. | ||
Строка 67: | Строка 85: | ||
native wpnmod_get_weapon_count(); | native wpnmod_get_weapon_count(); | ||
− | |||
=== wpnmod_register_ammobox === | === wpnmod_register_ammobox === | ||
Строка 74: | Строка 91: | ||
native wpnmod_register_ammobox(const szClassname[]); | native wpnmod_register_ammobox(const szClassname[]); | ||
− | {| class=" | + | |
+ | |||
+ | {| class="wide" border="1" | ||
| szName | | szName | ||
| Название аммобокса ("uranium", "9mm", "my_ammo" и т.д.) | | Название аммобокса ("uranium", "9mm", "my_ammo" и т.д.) | ||
Строка 86: | Строка 105: | ||
native wpnmod_register_ammobox_forward(const iWeaponID, const e_AmmoFwds: iForward, const szCallBack[]); | native wpnmod_register_ammobox_forward(const iWeaponID, const e_AmmoFwds: iForward, const szCallBack[]); | ||
− | |||
− | |||
− | |||
+ | {| class="wide" | ||
+ | |- | ||
+ | | iAmmoboxID | ||
+ | | The ID of registered ammobox | ||
+ | |- | ||
+ | | iForward | ||
+ | | Forward type to register | ||
+ | |- | ||
+ | | szCallBack | ||
+ | | The forward to call | ||
+ | |} | ||
=== wpnmod_get_ammobox_info === | === wpnmod_get_ammobox_info === | ||
Строка 97: | Строка 124: | ||
native wpnmod_get_ammobox_info(const iId, const e_AmmoInfo: iInfoType, any:...); | native wpnmod_get_ammobox_info(const iId, const e_AmmoInfo: iInfoType, any:...); | ||
− | + | ||
− | + | {| class="wide" | |
− | + | |- | |
+ | | iId | ||
+ | | The ID of registered ammobox or ammobox entity Id | ||
+ | |- | ||
+ | | iInfoType | ||
+ | | e_AmmoInfo_* type | ||
+ | |} | ||
+ | |||
+ | return Ammobox's AmmoInfo variable. | ||
=== wpnmod_get_ammobox_count === | === wpnmod_get_ammobox_count === | ||
Строка 112: | Строка 147: | ||
native wpnmod_set_think(const iItem, const szCallBack[]); | native wpnmod_set_think(const iItem, const szCallBack[]); | ||
− | + | ||
− | + | {| class="wide" | |
+ | |- | ||
+ | | iItem | ||
+ | | Weapon's entity index | ||
+ | |- | ||
+ | | szCallBack | ||
+ | | The forward to call | ||
+ | |} | ||
=== wpnmod_set_touch === | === wpnmod_set_touch === | ||
Строка 121: | Строка 163: | ||
native wpnmod_set_touch(const iEntity, const szCallBack[]); | native wpnmod_set_touch(const iEntity, const szCallBack[]); | ||
− | + | ||
− | + | {| class="wide" | |
+ | |- | ||
+ | | iEntity | ||
+ | | Entity index | ||
+ | |- | ||
+ | | szCallBack | ||
+ | | The forward to call | ||
+ | |} | ||
=== wpnmod_send_weapon_anim === | === wpnmod_send_weapon_anim === | ||
Строка 130: | Строка 179: | ||
native wpnmod_send_weapon_anim(const iItem, const iAnim); | native wpnmod_send_weapon_anim(const iItem, const iAnim); | ||
− | + | ||
− | + | {| class="wide" | |
+ | |- | ||
+ | | iItem | ||
+ | | Weapon's entity index. | ||
+ | |- | ||
+ | | iAnim | ||
+ | | Sequence number. | ||
+ | |} | ||
=== wpnmod_set_player_anim === | === wpnmod_set_player_anim === | ||
Строка 139: | Строка 195: | ||
native wpnmod_set_player_anim(const iPlayer, const PLAYER_ANIM: iPlayerAnim); | native wpnmod_set_player_anim(const iPlayer, const PLAYER_ANIM: iPlayerAnim); | ||
− | + | ||
− | + | {| class="wide" | |
+ | |- | ||
+ | | iPlayer | ||
+ | | Player index. | ||
+ | |- | ||
+ | | iPlayerAnim | ||
+ | | Animation (see PLAYER_ANIM constants). | ||
+ | |} | ||
=== wpnmod_set_anim_ext === | === wpnmod_set_anim_ext === | ||
Строка 148: | Строка 211: | ||
native wpnmod_set_anim_ext(const iPlayer, const szAnimExt[]); | native wpnmod_set_anim_ext(const iPlayer, const szAnimExt[]); | ||
− | + | ||
− | + | {| class="wide" | |
+ | |- | ||
+ | | iPlayer | ||
+ | | Player id. | ||
+ | |- | ||
+ | | szAnimExt[] | ||
+ | | Animation extension prefix. | ||
+ | |} | ||
=== wpnmod_get_anim_ext === | === wpnmod_get_anim_ext === | ||
Строка 157: | Строка 227: | ||
native wpnmod_get_anim_ext(const iPlayer, szDest[], iMaxLen); | native wpnmod_get_anim_ext(const iPlayer, szDest[], iMaxLen); | ||
− | + | ||
− | + | {| class="wide" | |
− | + | |- | |
+ | | iPlayer | ||
+ | | Player id. | ||
+ | |- | ||
+ | | szDest[] | ||
+ | | Buffer. | ||
+ | |- | ||
+ | | iMaxLen | ||
+ | |Max buffer size. | ||
+ | |} | ||
=== wpnmod_set_offset_int === | === wpnmod_set_offset_int === | ||
Строка 167: | Строка 246: | ||
native wpnmod_set_offset_int(const iEntity, const e_Offsets: iOffset, const iValue); | native wpnmod_set_offset_int(const iEntity, const e_Offsets: iOffset, const iValue); | ||
− | + | ||
− | + | {| class="wide" | |
− | + | |- | |
+ | | iEntity | ||
+ | | Entity index. | ||
+ | |- | ||
+ | | iOffset | ||
+ | | Offset (see e_Offsets constants). | ||
+ | |- | ||
+ | | iValue | ||
+ | | Value. | ||
+ | |} | ||
=== wpnmod_get_offset_int === | === wpnmod_get_offset_int === | ||
Строка 177: | Строка 265: | ||
native wpnmod_get_offset_int(const iEntity, const e_Offsets: iOffset); | native wpnmod_get_offset_int(const iEntity, const e_Offsets: iOffset); | ||
− | + | ||
− | + | {| class="wide" | |
− | + | |- | |
+ | | iEntity | ||
+ | | Entity index. | ||
+ | |- | ||
+ | | iOffset | ||
+ | | Offset (see e_Offsets constants). | ||
+ | |} | ||
+ | |||
+ | return value from private data. (integer) | ||
=== wpnmod_set_offset_float === | === wpnmod_set_offset_float === | ||
Строка 187: | Строка 283: | ||
native wpnmod_set_offset_float(const iEntity, const e_Offsets: iOffset, const Float: flValue); | native wpnmod_set_offset_float(const iEntity, const e_Offsets: iOffset, const Float: flValue); | ||
− | + | ||
− | + | {| class="wide" | |
− | + | |- | |
+ | | iEntity | ||
+ | | Entity index. | ||
+ | |- | ||
+ | | iOffset | ||
+ | | Offset (see e_Offsets constants). | ||
+ | |- | ||
+ | | flValue | ||
+ | | Value. | ||
+ | |} | ||
=== wpnmod_get_offset_float === | === wpnmod_get_offset_float === | ||
Строка 197: | Строка 302: | ||
native Float: wpnmod_get_offset_float(const iEntity, const e_Offsets: iOffset); | native Float: wpnmod_get_offset_float(const iEntity, const e_Offsets: iOffset); | ||
− | + | ||
− | + | {| class="wide" | |
− | + | |- | |
− | + | | iEntity | |
+ | | Entity index. | ||
+ | |- | ||
+ | | iOffset | ||
+ | | Offset (see e_Offsets constants). | ||
+ | |} | ||
+ | |||
+ | return value from private data. (float) | ||
=== wpnmod_set_offset_cbase === | === wpnmod_set_offset_cbase === | ||
Строка 208: | Строка 320: | ||
native wpnmod_set_offset_cbase(const iEntity, const e_CBase: iOffset, const iValue, const iExtraOffset = 0); | native wpnmod_set_offset_cbase(const iEntity, const e_CBase: iOffset, const iValue, const iExtraOffset = 0); | ||
− | + | ||
− | + | {| class="wide" | |
− | + | |- | |
− | + | | iEntity | |
+ | | The entity to examine the private data | ||
+ | |- | ||
+ | | iOffset | ||
+ | | Offset (See e_CBase constants) | ||
+ | |- | ||
+ | | iValue | ||
+ | | The index to store | ||
+ | |- | ||
+ | | iExtraOffset | ||
+ | | The extra offset | ||
+ | |} | ||
=== wpnmod_get_offset_cbase === | === wpnmod_get_offset_cbase === | ||
Строка 219: | Строка 342: | ||
native wpnmod_get_offset_cbase(const iEntity, const e_CBase: iOffset, const iExtraOffset = 0); | native wpnmod_get_offset_cbase(const iEntity, const e_CBase: iOffset, const iExtraOffset = 0); | ||
− | + | ||
− | + | {| class="wide" | |
− | + | |- | |
− | + | | iEntity | |
− | + | | The entity to examine the private data. | |
+ | |- | ||
+ | | iOffset | ||
+ | | Offset (See e_CBase constants). | ||
+ | |- | ||
+ | | iExtraOffset | ||
+ | | The extra offset. | ||
+ | |} | ||
+ | |||
+ | return value from private data. (integer) | ||
=== wpnmod_default_deploy === | === wpnmod_default_deploy === | ||
Строка 231: | Строка 363: | ||
native wpnmod_default_deploy(const iItem, const szViewModel[], const szWeaponModel[], const iAnim, const szAnimExt[]); | native wpnmod_default_deploy(const iItem, const szViewModel[], const szWeaponModel[], const iAnim, const szAnimExt[]); | ||
− | + | ||
− | + | {| class="wide" | |
− | + | |- | |
− | + | | iItem | |
− | + | | Weapon's entity index. | |
+ | |- | ||
+ | | szViewModel | ||
+ | | Weapon's view model (V) | ||
+ | |- | ||
+ | | szWeaponModel | ||
+ | | Weapon's player model (P) | ||
+ | |- | ||
+ | | iAnim | ||
+ | | Sequence number of deploy animation | ||
+ | |- | ||
+ | | szAnimExt | ||
+ | | Animation extension | ||
+ | |} | ||
+ | |||
=== wpnmod_default_reload === | === wpnmod_default_reload === | ||
Строка 243: | Строка 389: | ||
native wpnmod_default_reload(const iItem, const iClipSize, const iAnim, const Float: flDelay); | native wpnmod_default_reload(const iItem, const iClipSize, const iAnim, const Float: flDelay); | ||
− | + | ||
− | + | {| class="wide" | |
− | + | |- | |
− | + | | iItem | |
+ | | Weapon's entity index | ||
+ | |- | ||
+ | | iClipSize | ||
+ | | Maximum weapon's clip size | ||
+ | |- | ||
+ | | iAnim | ||
+ | | Sequence number of reload animation | ||
+ | |- | ||
+ | | flDelay | ||
+ | | Reload delay time | ||
+ | |} | ||
=== wpnmod_reset_empty_sound === | === wpnmod_reset_empty_sound === | ||
Строка 254: | Строка 411: | ||
native wpnmod_reset_empty_sound(const iItem); | native wpnmod_reset_empty_sound(const iItem); | ||
− | + | ||
+ | {| class="wide" | ||
+ | |- | ||
+ | | iItem | ||
+ | | Индекс энтити оружия | ||
+ | |} | ||
=== wpnmod_play_empty_sound === | === wpnmod_play_empty_sound === | ||
Строка 262: | Строка 424: | ||
native wpnmod_play_empty_sound(const iItem); | native wpnmod_play_empty_sound(const iItem); | ||
− | + | ||
+ | {| class="wide" | ||
+ | |- | ||
+ | | iItem | ||
+ | | Weapon's entity index. | ||
+ | |} | ||
+ | |||
=== wpnmod_fire_bullets === | === wpnmod_fire_bullets === | ||
Строка 270: | Строка 438: | ||
native wpnmod_fire_bullets(const iPlayer, const iAttacker, const iShotsCount, const Float: vecSpread[3], const Float: flDistance, const Float: flDamage, const bitsDamageType, const iTracerFreq); | native wpnmod_fire_bullets(const iPlayer, const iAttacker, const iShotsCount, const Float: vecSpread[3], const Float: flDistance, const Float: flDamage, const bitsDamageType, const iTracerFreq); | ||
− | + | ||
− | + | {| class="wide" | |
− | + | |- | |
− | + | | iPlayer | |
− | + | | Player index. | |
− | + | |- | |
− | + | | iAttacker | |
− | + | | Attacker index (usualy it equal to previous param). | |
+ | |- | ||
+ | | iShotsCount | ||
+ | | Number of shots. | ||
+ | |- | ||
+ | | vecSpread | ||
+ | | Spread. | ||
+ | |- | ||
+ | | flDistance | ||
+ | | Max shot distance. | ||
+ | |- | ||
+ | | flDamage | ||
+ | | Damage amount. | ||
+ | |- | ||
+ | | bitsDamageType | ||
+ | | Damage type | ||
+ | |- | ||
+ | | iTracerFreq | ||
+ | | Tracer frequancy | ||
+ | |} | ||
=== wpnmod_fire_contact_grenade === | === wpnmod_fire_contact_grenade === | ||
Строка 285: | Строка 472: | ||
native wpnmod_fire_contact_grenade(const iPlayer, const Float: vecStart[3], const Float: vecVelocity[3], const szCallBack[] = ""); | native wpnmod_fire_contact_grenade(const iPlayer, const Float: vecStart[3], const Float: vecVelocity[3], const szCallBack[] = ""); | ||
− | |||
− | |||
− | |||
− | |||
− | + | {| class="wide" | |
+ | |- | ||
+ | | iPlayer | ||
+ | | Player index | ||
+ | |- | ||
+ | | vecStart | ||
+ | | Start position | ||
+ | |- | ||
+ | | vecVelocity | ||
+ | | Velocity | ||
+ | |- | ||
+ | | szCallBack | ||
+ | | The forward to call on explode | ||
+ | |} | ||
+ | |||
+ | return contact grenade index or -1 on failure. (integer) | ||
=== wpnmod_fire_timed_grenade === | === wpnmod_fire_timed_grenade === | ||
Строка 298: | Строка 496: | ||
native wpnmod_fire_timed_grenade(const iPlayer, const Float: vecStart[3], const Float: vecVelocity[3], const Float: flTime = 3.0, const szCallBack[] = ""); | native wpnmod_fire_timed_grenade(const iPlayer, const Float: vecStart[3], const Float: vecVelocity[3], const Float: flTime = 3.0, const szCallBack[] = ""); | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | {| class="wide" | |
+ | |- | ||
+ | | iPlayer | ||
+ | | Player index. | ||
+ | |- | ||
+ | | vecStart | ||
+ | | Start position. | ||
+ | |- | ||
+ | | vecVelocity | ||
+ | | Velocity. | ||
+ | |- | ||
+ | | flTime | ||
+ | | Time before detonate. | ||
+ | |- | ||
+ | | szCallBack | ||
+ | | The forward to call on explode. | ||
+ | |} | ||
+ | |||
+ | return contact grenade index or -1 on failure. (integer) | ||
=== wpnmod_radius_damage === | === wpnmod_radius_damage === | ||
Строка 312: | Строка 523: | ||
native wpnmod_radius_damage(const Float: vecSrc[3], const iInflictor, const iAttacker, const Float: flDamage, const Float: flRadius, const iClassIgnore, const bitsDamageType); | native wpnmod_radius_damage(const Float: vecSrc[3], const iInflictor, const iAttacker, const Float: flDamage, const Float: flRadius, const iClassIgnore, const bitsDamageType); | ||
− | + | {| class="wide" | |
− | + | |- | |
− | + | | vecSrc | |
− | + | | Origin of explosion. | |
− | + | |- | |
− | + | | iInflictor | |
− | + | | Entity which causes the damage impact. | |
+ | |- | ||
+ | | iAttacker | ||
+ | | Attacker index. | ||
+ | |- | ||
+ | | flDamage | ||
+ | | Damage amount. | ||
+ | |- | ||
+ | | flRadius | ||
+ | | Damage radius. | ||
+ | |- | ||
+ | | iClassIgnore | ||
+ | | Class to ignore. | ||
+ | |- | ||
+ | | bitsDamageType | ||
+ | | (DMG_BLAST and etc). | ||
+ | |} | ||
=== wpnmod_radius_damage2 === | === wpnmod_radius_damage2 === | ||
Строка 326: | Строка 553: | ||
native wpnmod_radius_damage2(const Float: vecSrc[3], const iInflictor, const iAttacker, const Float: flDamage, const Float: flRadius, const iClassIgnore, const bitsDamageType); | native wpnmod_radius_damage2(const Float: vecSrc[3], const iInflictor, const iAttacker, const Float: flDamage, const Float: flRadius, const iClassIgnore, const bitsDamageType); | ||
− | + | {| class="wide" | |
− | + | |- | |
− | + | | vecSrc | |
− | + | | Origin of explosion. | |
− | + | |- | |
− | + | | iInflictor | |
− | + | | Entity which causes the damage impact. | |
+ | |- | ||
+ | | iAttacker | ||
+ | | Attacker index. | ||
+ | |- | ||
+ | | flDamage | ||
+ | | Damage amount. | ||
+ | |- | ||
+ | | flRadius | ||
+ | | Damage radius. | ||
+ | |- | ||
+ | | iClassIgnore | ||
+ | | Class to ignore. | ||
+ | |- | ||
+ | | bitsDamageType | ||
+ | | (DMG_BLAST and etc). | ||
+ | |} | ||
=== wpnmod_clear_multi_damage === | === wpnmod_clear_multi_damage === | ||
Строка 346: | Строка 589: | ||
native wpnmod_apply_multi_damage(const iInflictor, const iAttacker); | native wpnmod_apply_multi_damage(const iInflictor, const iAttacker); | ||
− | + | {| class="wide" | |
− | + | |- | |
+ | | iInflictor | ||
+ | | Entity which causes the damage impact. | ||
+ | |- | ||
+ | | iAttacker | ||
+ | | Attacker index. | ||
+ | |} | ||
=== wpnmod_eject_brass === | === wpnmod_eject_brass === | ||
Строка 355: | Строка 604: | ||
native wpnmod_eject_brass(const iPlayer, const iShellModelIndex, const iSoundtype, const Float: flForwardScale, const Float: flUpScale, const Float: flRightScale); | native wpnmod_eject_brass(const iPlayer, const iShellModelIndex, const iSoundtype, const Float: flForwardScale, const Float: flUpScale, const Float: flRightScale); | ||
− | + | {| class="wide" | |
− | + | |- | |
− | + | | iPlayer | |
− | + | | Player index. | |
− | + | |- | |
− | + | | iShellModelIndex | |
+ | | Index of precached shell's model. | ||
+ | |- | ||
+ | | iSoundtype | ||
+ | | Bounce sound type (see defines). | ||
+ | |- | ||
+ | | flForwardScale | ||
+ | | Forward scale value. | ||
+ | |- | ||
+ | | flUpScale | ||
+ | | Up scale value. | ||
+ | |- | ||
+ | | flRightScale | ||
+ | | Right scale value. | ||
+ | |} | ||
=== wpnmod_create_item === | === wpnmod_create_item === | ||
Строка 368: | Строка 631: | ||
native wpnmod_create_item(const szName[], const Float: vecOrigin[3] = {0.0, 0.0, 0.0}, const Float: vecAngles[3] = {0.0, 0.0, 0.0}); | native wpnmod_create_item(const szName[], const Float: vecOrigin[3] = {0.0, 0.0, 0.0}, const Float: vecAngles[3] = {0.0, 0.0, 0.0}); | ||
− | + | {| class="wide" | |
− | + | |- | |
− | + | | szName | |
− | + | | Item's name | |
+ | |- | ||
+ | | vecOrigin | ||
+ | | Origin were to spawn | ||
+ | |- | ||
+ | | vecAngles | ||
+ | | Angles | ||
+ | |} | ||
+ | |||
+ | return item entity index or -1 on failure. (integer) | ||
=== wpnmod_get_player_ammo === | === wpnmod_get_player_ammo === | ||
Строка 379: | Строка 651: | ||
native wpnmod_get_player_ammo(const iPlayer, const szAmmoName[]); | native wpnmod_get_player_ammo(const iPlayer, const szAmmoName[]); | ||
− | + | {| class="wide" | |
− | + | |- | |
− | + | | iPlayer | |
+ | | ID игрока | ||
+ | |- | ||
+ | | szAmmoName | ||
+ | | Название типа патронов ("9mm", "uranium", "MY_AMMO" и т.д.) | ||
+ | |} | ||
=== wpnmod_set_player_ammo === | === wpnmod_set_player_ammo === | ||
Строка 389: | Строка 666: | ||
native wpnmod_set_player_ammo(const iPlayer, const szAmmoName[], const iAmount); | native wpnmod_set_player_ammo(const iPlayer, const szAmmoName[], const iAmount); | ||
− | + | {| class="wide" | |
− | + | |- | |
− | + | | iPlayer | |
+ | | ID игрока | ||
+ | |- | ||
+ | | szAmmoName | ||
+ | | Название типа патронов ("9mm", "uranium", "MY_AMMO" и т.д.) | ||
+ | |- | ||
+ | | iAmount | ||
+ | | Количество патронов | ||
+ | |} | ||
=== wpnmod_get_damage_decal === | === wpnmod_get_damage_decal === | ||
Строка 399: | Строка 684: | ||
native wpnmod_get_damage_decal(const iEntity); | native wpnmod_get_damage_decal(const iEntity); | ||
− | + | {| class="wide" | |
− | + | |- | |
+ | | iEntity | ||
+ | | Энтити | ||
+ | |} | ||
+ | |||
+ | return Index of damage decal. (integer) | ||
=== wpnmod_get_gun_position === | === wpnmod_get_gun_position === | ||
Строка 408: | Строка 698: | ||
native wpnmod_get_gun_position(const iPlayer, Float: vecResult[3], const Float: flForwardScale = 1.0, const Float: flRightScale = 1.0, const Float: flUpScale = 1.0); | native wpnmod_get_gun_position(const iPlayer, Float: vecResult[3], const Float: flForwardScale = 1.0, const Float: flRightScale = 1.0, const Float: flUpScale = 1.0); | ||
− | + | {| class="wide" | |
− | + | |- | |
− | + | | iPlayer | |
− | + | | Player index | |
− | + | |- | |
+ | | vecResult | ||
+ | | Calculated gun position | ||
+ | |- | ||
+ | | flForwardScale | ||
+ | | Forward scale value | ||
+ | |- | ||
+ | | flUpScale | ||
+ | | Up scale value | ||
+ | |- | ||
+ | | flRightScale | ||
+ | | Right scale value | ||
+ | |} | ||
=== wpnmod_explode_entity === | === wpnmod_explode_entity === | ||
Строка 426: | Строка 728: | ||
native wpnmod_decal_trace(const iTrace, const iDecalIndex = -1, const szDecalName[] = ""); | native wpnmod_decal_trace(const iTrace, const iDecalIndex = -1, const szDecalName[] = ""); | ||
− | + | {| class="wide" | |
− | + | |- | |
− | + | | iTrace | |
+ | | Trace handler. | ||
+ | |- | ||
+ | | iDecalIndex | ||
+ | | Decal index. | ||
+ | |- | ||
+ | | szDecalName | ||
+ | | Decal name. | ||
+ | |} | ||
=== wpnmod_trace_texture === | === wpnmod_trace_texture === | ||
Строка 436: | Строка 746: | ||
native wpnmod_trace_texture(const iEntity, const Float: vecSrc[3], const Float: vecEnd[3], szTextureName[], const iLen); | native wpnmod_trace_texture(const iEntity, const Float: vecSrc[3], const Float: vecEnd[3], szTextureName[], const iLen); | ||
− | + | ||
− | + | {| class="wide" | |
− | + | |- | |
− | + | | iEntity | |
− | + | | Entity index that we want to get the texture. | |
+ | |- | ||
+ | | vecSrc | ||
+ | | The point from where the trace starts. | ||
+ | |- | ||
+ | | vecEnd | ||
+ | | The point where the trace ends. | ||
+ | |- | ||
+ | | szTextureName | ||
+ | | Buffer to save the texture name. | ||
+ | |- | ||
+ | | iLen | ||
+ | | Buffer's length. | ||
+ | |} |
Версия 13:30, 14 июня 2013
Содержание
- 1 hl_wpnmod.inc
- 1.1 wpnmod_register_weapon
- 1.2 wpnmod_register_weapon_forward
- 1.3 wpnmod_get_weapon_info
- 1.4 wpnmod_get_weapon_count
- 1.5 wpnmod_register_ammobox
- 1.6 wpnmod_register_ammobox_forward
- 1.7 wpnmod_get_ammobox_info
- 1.8 wpnmod_get_ammobox_count
- 1.9 wpnmod_set_think
- 1.10 wpnmod_set_touch
- 1.11 wpnmod_send_weapon_anim
- 1.12 wpnmod_set_player_anim
- 1.13 wpnmod_set_anim_ext
- 1.14 wpnmod_get_anim_ext
- 1.15 wpnmod_set_offset_int
- 1.16 wpnmod_get_offset_int
- 1.17 wpnmod_set_offset_float
- 1.18 wpnmod_get_offset_float
- 1.19 wpnmod_set_offset_cbase
- 1.20 wpnmod_get_offset_cbase
- 1.21 wpnmod_default_deploy
- 1.22 wpnmod_default_reload
- 1.23 wpnmod_reset_empty_sound
- 1.24 wpnmod_play_empty_sound
- 1.25 wpnmod_fire_bullets
- 1.26 wpnmod_fire_contact_grenade
- 1.27 wpnmod_fire_timed_grenade
- 1.28 wpnmod_radius_damage
- 1.29 wpnmod_radius_damage2
- 1.30 wpnmod_clear_multi_damage
- 1.31 wpnmod_apply_multi_damage
- 1.32 wpnmod_eject_brass
- 1.33 wpnmod_create_item
- 1.34 wpnmod_get_player_ammo
- 1.35 wpnmod_set_player_ammo
- 1.36 wpnmod_get_damage_decal
- 1.37 wpnmod_get_gun_position
- 1.38 wpnmod_explode_entity
- 1.39 wpnmod_decal_trace
- 1.40 wpnmod_trace_texture
hl_wpnmod.inc
wpnmod_register_weapon
Регистрация нового оружия. Возвращает ID зарегистрированного оружия или -1 в случае ошибки.
native wpnmod_register_weapon(const szName[], const iSlot, const iPosition, const szAmmo1[], const iMaxAmmo1, const szAmmo2[], const, iMaxAmmo2, const iMaxClip, const iFlags, const iWeight);
szName | Имя оружия |
iSlot | ID слота от 1 до 5 |
iPosition | Позиция в слоте от 1 до 5 |
szAmmo1 | Тип патронов основной атаки ("9mm", "uranium", "MY_AMMO" и т.д.). |
iMaxAmmo1 | Максимальное количество патронов в обойме для основной атаки |
szAmmo2 | Тип патронов вторичной атаки |
iMaxAmmo2 | Максимальное количество патронов в обойме для вторичной атаки |
iMaxClip | Максимальное количество переносимых игроком патронов (в обойме не считается) |
iFlags | Флаги оружия (смотри константы). |
iWeight | Вес оружия (для автопереключения |
wpnmod_register_weapon_forward
Регистрирует форвард оружия.
native wpnmod_register_weapon_forward(const iWeaponID, const e_WpnFwds: iForward, const szCallBack[]);
iWeaponID | ID оружия |
iForward | Forward type to register. |
szCallBack | The forward to call |
wpnmod_get_weapon_info
Returns any ItemInfo variable for weapon. Use the e_ItemInfo_* enum.
native wpnmod_get_weapon_info(const iId, const e_ItemInfo: iInfoType, any:...);
iId | The ID of registered weapon or weapon entity Id. |
iInfoType | ItemInfo type |
return Weapon's ItemInfo variable.
wpnmod_get_weapon_count
Возвращает количество зарегистрированного оружия.
native wpnmod_get_weapon_count();
wpnmod_register_ammobox
Регистрация нового аммобокса в модуле.
native wpnmod_register_ammobox(const szClassname[]);
szName | Название аммобокса ("uranium", "9mm", "my_ammo" и т.д.) |
wpnmod_register_ammobox_forward
Регистрирует форвард аммобокса
native wpnmod_register_ammobox_forward(const iWeaponID, const e_AmmoFwds: iForward, const szCallBack[]);
iAmmoboxID | The ID of registered ammobox |
iForward | Forward type to register |
szCallBack | The forward to call |
wpnmod_get_ammobox_info
Returns any AmmoInfo variable for ammobox. Use the e_AmmoInfo_* enum.
native wpnmod_get_ammobox_info(const iId, const e_AmmoInfo: iInfoType, any:...);
iId | The ID of registered ammobox or ammobox entity Id |
iInfoType | e_AmmoInfo_* type |
return Ammobox's AmmoInfo variable.
wpnmod_get_ammobox_count
Возвращает количество зарегистрированных аммобоксов.
native wpnmod_get_ammobox_count();
wpnmod_set_think
Sets weapon's think function. Analogue of set_task native.
native wpnmod_set_think(const iItem, const szCallBack[]);
iItem | Weapon's entity index |
szCallBack | The forward to call |
wpnmod_set_touch
Sets entity's touch function.
native wpnmod_set_touch(const iEntity, const szCallBack[]);
iEntity | Entity index |
szCallBack | The forward to call |
wpnmod_send_weapon_anim
Играть анимацию оружия.
native wpnmod_send_weapon_anim(const iItem, const iAnim);
iItem | Weapon's entity index. |
iAnim | Sequence number. |
wpnmod_set_player_anim
Sets the activity for player based on an event or current state.
native wpnmod_set_player_anim(const iPlayer, const PLAYER_ANIM: iPlayerAnim);
iPlayer | Player index. |
iPlayerAnim | Animation (see PLAYER_ANIM constants). |
wpnmod_set_anim_ext
Set animation extension for player.
native wpnmod_set_anim_ext(const iPlayer, const szAnimExt[]);
iPlayer | Player id. |
szAnimExt[] | Animation extension prefix. |
wpnmod_get_anim_ext
Get animation extension for player.
native wpnmod_get_anim_ext(const iPlayer, szDest[], iMaxLen);
iPlayer | Player id. |
szDest[] | Buffer. |
iMaxLen | Max buffer size. |
wpnmod_set_offset_int
Sets an integer from private data.
native wpnmod_set_offset_int(const iEntity, const e_Offsets: iOffset, const iValue);
iEntity | Entity index. |
iOffset | Offset (see e_Offsets constants). |
iValue | Value. |
wpnmod_get_offset_int
Returns an integer from private data.
native wpnmod_get_offset_int(const iEntity, const e_Offsets: iOffset);
iEntity | Entity index. |
iOffset | Offset (see e_Offsets constants). |
return value from private data. (integer)
wpnmod_set_offset_float
Sets a float from private data.
native wpnmod_set_offset_float(const iEntity, const e_Offsets: iOffset, const Float: flValue);
iEntity | Entity index. |
iOffset | Offset (see e_Offsets constants). |
flValue | Value. |
wpnmod_get_offset_float
Returns a float from private data.
native Float: wpnmod_get_offset_float(const iEntity, const e_Offsets: iOffset);
iEntity | Entity index. |
iOffset | Offset (see e_Offsets constants). |
return value from private data. (float)
wpnmod_set_offset_cbase
Set the corresponding cbase field in private data with the index.
native wpnmod_set_offset_cbase(const iEntity, const e_CBase: iOffset, const iValue, const iExtraOffset = 0);
iEntity | The entity to examine the private data |
iOffset | Offset (See e_CBase constants) |
iValue | The index to store |
iExtraOffset | The extra offset |
wpnmod_get_offset_cbase
This will return an index of the corresponding cbase field in private data.
native wpnmod_get_offset_cbase(const iEntity, const e_CBase: iOffset, const iExtraOffset = 0);
iEntity | The entity to examine the private data. |
iOffset | Offset (See e_CBase constants). |
iExtraOffset | The extra offset. |
return value from private data. (integer)
wpnmod_default_deploy
Default deploy function.
native wpnmod_default_deploy(const iItem, const szViewModel[], const szWeaponModel[], const iAnim, const szAnimExt[]);
iItem | Weapon's entity index. |
szViewModel | Weapon's view model (V) |
szWeaponModel | Weapon's player model (P) |
iAnim | Sequence number of deploy animation |
szAnimExt | Animation extension |
wpnmod_default_reload
Default reload function.
native wpnmod_default_reload(const iItem, const iClipSize, const iAnim, const Float: flDelay);
iItem | Weapon's entity index |
iClipSize | Maximum weapon's clip size |
iAnim | Sequence number of reload animation |
flDelay | Reload delay time |
wpnmod_reset_empty_sound
Sets the weapon so that it can play empty sound again.
native wpnmod_reset_empty_sound(const iItem);
iItem | Индекс энтити оружия |
wpnmod_play_empty_sound
Plays the weapon's empty sound.
native wpnmod_play_empty_sound(const iItem);
iItem | Weapon's entity index. |
wpnmod_fire_bullets
Выстрел из оружия.
native wpnmod_fire_bullets(const iPlayer, const iAttacker, const iShotsCount, const Float: vecSpread[3], const Float: flDistance, const Float: flDamage, const bitsDamageType, const iTracerFreq);
iPlayer | Player index. |
iAttacker | Attacker index (usualy it equal to previous param). |
iShotsCount | Number of shots. |
vecSpread | Spread. |
flDistance | Max shot distance. |
flDamage | Damage amount. |
bitsDamageType | Damage type |
iTracerFreq | Tracer frequancy |
wpnmod_fire_contact_grenade
Fire default contact grenade from player's weapon.
native wpnmod_fire_contact_grenade(const iPlayer, const Float: vecStart[3], const Float: vecVelocity[3], const szCallBack[] = "");
iPlayer | Player index |
vecStart | Start position |
vecVelocity | Velocity |
szCallBack | The forward to call on explode |
return contact grenade index or -1 on failure. (integer)
wpnmod_fire_timed_grenade
Fire default timed grenade from player's weapon.
native wpnmod_fire_timed_grenade(const iPlayer, const Float: vecStart[3], const Float: vecVelocity[3], const Float: flTime = 3.0, const szCallBack[] = "");
iPlayer | Player index. |
vecStart | Start position. |
vecVelocity | Velocity. |
flTime | Time before detonate. |
szCallBack | The forward to call on explode. |
return contact grenade index or -1 on failure. (integer)
wpnmod_radius_damage
Make damage upon entities within a certain range. Only damage ents that can clearly be seen by the explosion.
native wpnmod_radius_damage(const Float: vecSrc[3], const iInflictor, const iAttacker, const Float: flDamage, const Float: flRadius, const iClassIgnore, const bitsDamageType);
vecSrc | Origin of explosion. |
iInflictor | Entity which causes the damage impact. |
iAttacker | Attacker index. |
flDamage | Damage amount. |
flRadius | Damage radius. |
iClassIgnore | Class to ignore. |
bitsDamageType | (DMG_BLAST and etc). |
wpnmod_radius_damage2
Same as wpnmod_radius_damage, but blocks 'ghost mines' and 'ghost nades'.
native wpnmod_radius_damage2(const Float: vecSrc[3], const iInflictor, const iAttacker, const Float: flDamage, const Float: flRadius, const iClassIgnore, const bitsDamageType);
vecSrc | Origin of explosion. |
iInflictor | Entity which causes the damage impact. |
iAttacker | Attacker index. |
flDamage | Damage amount. |
flRadius | Damage radius. |
iClassIgnore | Class to ignore. |
bitsDamageType | (DMG_BLAST and etc). |
wpnmod_clear_multi_damage
Resets the global multi damage accumulator.
native wpnmod_clear_multi_damage();
wpnmod_apply_multi_damage
Inflicts contents of global multi damage register on entity.
native wpnmod_apply_multi_damage(const iInflictor, const iAttacker);
iInflictor | Entity which causes the damage impact. |
iAttacker | Attacker index. |
wpnmod_eject_brass
Eject a brass from player's weapon.
native wpnmod_eject_brass(const iPlayer, const iShellModelIndex, const iSoundtype, const Float: flForwardScale, const Float: flUpScale, const Float: flRightScale);
iPlayer | Player index. |
iShellModelIndex | Index of precached shell's model. |
iSoundtype | Bounce sound type (see defines). |
flForwardScale | Forward scale value. |
flUpScale | Up scale value. |
flRightScale | Right scale value. |
wpnmod_create_item
Spawn an item by name.
native wpnmod_create_item(const szName[], const Float: vecOrigin[3] = {0.0, 0.0, 0.0}, const Float: vecAngles[3] = {0.0, 0.0, 0.0});
szName | Item's name |
vecOrigin | Origin were to spawn |
vecAngles | Angles |
return item entity index or -1 on failure. (integer)
wpnmod_get_player_ammo
Получает количество патронов заданного типа у игрока.
native wpnmod_get_player_ammo(const iPlayer, const szAmmoName[]);
iPlayer | ID игрока |
szAmmoName | Название типа патронов ("9mm", "uranium", "MY_AMMO" и т.д.) |
wpnmod_set_player_ammo
Set player's ammo inventory.
native wpnmod_set_player_ammo(const iPlayer, const szAmmoName[], const iAmount);
iPlayer | ID игрока |
szAmmoName | Название типа патронов ("9mm", "uranium", "MY_AMMO" и т.д.) |
iAmount | Количество патронов |
wpnmod_get_damage_decal
Returns index of random damage decal for given entity.
native wpnmod_get_damage_decal(const iEntity);
iEntity | Энтити |
return Index of damage decal. (integer)
wpnmod_get_gun_position
Get player's gun position. Result will set in vecResult.
native wpnmod_get_gun_position(const iPlayer, Float: vecResult[3], const Float: flForwardScale = 1.0, const Float: flRightScale = 1.0, const Float: flUpScale = 1.0);
iPlayer | Player index |
vecResult | Calculated gun position |
flForwardScale | Forward scale value |
flUpScale | Up scale value |
flRightScale | Right scale value |
wpnmod_explode_entity
Explode and then remove entity.
native wpnmod_explode_entity(const iEntity, const bitsDamageType = 0, const szCallBack[] = "");
wpnmod_decal_trace
Draw decal by index or name on trace end.
native wpnmod_decal_trace(const iTrace, const iDecalIndex = -1, const szDecalName[] = "");
iTrace | Trace handler. |
iDecalIndex | Decal index. |
szDecalName | Decal name. |
wpnmod_trace_texture
Detects the texture of an entity from a direction.
native wpnmod_trace_texture(const iEntity, const Float: vecSrc[3], const Float: vecEnd[3], szTextureName[], const iLen);
iEntity | Entity index that we want to get the texture. |
vecSrc | The point from where the trace starts. |
vecEnd | The point where the trace ends. |
szTextureName | Buffer to save the texture name. |
iLen | Buffer's length. |