Half-Life Weapon Mod

Half-Life Weapon Mod 0.1-dev

Нет прав для скачивания
hl_wpnmod.inc

Код:
/*
 * Half-Life Weapon Mod
 * Copyright (c) 2012 - 2014 AGHL.RU Dev Team
 *
 * http://aghl.ru/fodfdfdfrum/ - Russian Half-Life and Adrenaline Gamer Community
 *
 *
 *    This program is free software; you can redistribute it and/or modify it
 *    under the terms of the GNU General Public License as published by the
 *    Free Software Foundation; either version 2 of the License, or (at
 *    your option) any later version.
 *
 *    This program is distributed in the hope that it will be useful, but
 *    WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *    General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with this program; if not, write to the Free Software Foundation,
 *    Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 *    In addition, as a special exception, the author gives permission to
 *    link the code of this program with the Half-Life Game Engine ("HL
 *    Engine") and Modified Game Libraries ("MODs") developed by Valve,
 *    L.L.C ("Valve").  You must obey the GNU General Public License in all
 *    respects for all of the code used other than the HL Engine and MODs
 *    from Valve.  If you modify this file, you may extend this exception
 *    to your version of the file, but you are not obligated to do so.  If
 *    you do not wish to do so, delete this exception statement from your
 *    version.
 *
 */

#if defined _hl_wpnmod_included
    #endinput
#endif
#define _hl_wpnmod_included

#if AMXX_VERSION_NUM >= 175
    #pragma reqlib weaponmod
#if !defined AMXMODX_NOAUTOLOAD
    #pragma loadlib weaponmod
#endif
#else
    #pragma library weaponmod
#endif

#include <hl_wpnmod_const>
#include <hl_wpnmod_compat>
#include <fakemeta>

#define SET_MODEL(%0,%1) engfunc(EngFunc_SetModel, %0, %1)
#define PRECACHE_MODEL(%0) engfunc(EngFunc_PrecacheModel,%0)
#define PRECACHE_SOUND(%0) engfunc(EngFunc_PrecacheSound,%0)
#define PRECACHE_GENERIC(%0) engfunc(EngFunc_PrecacheGeneric,%0)

/**
 * Register new weapon in module.
 *
 * @param szName           The weapon name.
 * @param iSlot            SlotID (1...5).
 * @param iPosition        NumberInSlot (1...5).
 * @param szAmmo1          Primary ammo type ("9mm", "uranium", "MY_AMMO" etc).
 * @param iMaxAmmo1        Max amount of primary ammo.
 * @param szAmmo2          Secondary ammo type.
 * @param iMaxAmmo2        Max amount of secondary ammo.
 * @param iMaxClip         Max amount of ammo in weapon's clip.
 * @param iFlags           Weapon's flags (see defines).
 * @param iWeight          This value used to determine this weapon's importance in autoselection.
 *
 * @return                 The ID of registerd weapon or -1 on failure. (integer)
 */
native WpnMod_RegisterWeapon(const szName[], const iSlot, const iPosition, const szAmmo1[], const iMaxAmmo1, const szAmmo2[], const iMaxAmmo2, const iMaxClip, const iFlags, const iWeight);

/**
 * Register weapon's forward.
 *
 * @param iWeaponID        The ID of registered weapon.
 * @param iForward         Forward type to register.
 * @param szCallBack       The forward to call.
 */
native WpnMod_RegisterWeaponForward(const iWeaponID, const e_WpnFwds: iForward, const szCallBack[]);

/**
 * Register new ammobox in module.
 *
 * @param szName           The ammobox classname.
 *
 * @return                 The ID of registerd ammobox or -1 on failure. (integer)
 */
native WpnMod_RegisterAmmoBox(const szClassname[]);

/**
 * Register ammobox's forward.
 *
 * @param iAmmoboxID       The ID of registered ammobox.
 * @param iForward         Forward type to register.
 * @param szCallBack       The forward to call.
 */
native WpnMod_RegisterAmmoBoxForward(const iWeaponID, const e_AmmoFwds: iForward, const szCallBack[]);

/**
 * Returns any ItemInfo variable for weapon. Use the e_ItemInfo_* enum.
 *
 * @param iId              The ID of registered weapon or weapon entity Id.
 * @param iInfoType        ItemInfo type.
 *
 * @return                 Weapon's ItemInfo variable.
 */
native WpnMod_GetWeaponInfo(const iId, const e_ItemInfo: iInfoType, any:...);

/**
 * Returns any AmmoInfo variable for ammobox. Use the e_AmmoInfo_* enum.
 *
 * @param iId              The ID of registered ammobox or ammobox entity Id.
 * @param iInfoType        e_AmmoInfo_* type.
 *
 * @return                 Ammobox's AmmoInfo variable.
 */
native WpnMod_GetAmmoBoxInfo(const iId, const e_AmmoInfo: iInfoType, any:...);

/**
 * Gets number of registered weapons.
 *
 * @return                 Number of registered weapons. (integer)
 */
native WpnMod_GetWeaponNum();

/**
 * Gets number of registered ammoboxes.
 *
 * @return                 Number of registered ammoboxes. (integer)
 */
native WpnMod_GetAmmoBoxNum();

/**
 * Spawn an item by name.
 *
 * @param szClassName      Item's classname.
 * @param vecOrigin        Origin were to spawn.
 * @param vecAngles        Angles.
 *
 * @return                 Item entity index or -1 on failure. (integer)
 */
native WpnMod_CreateItem(const szClassName[], const Float: vecOrigin[3] = {0.0, 0.0, 0.0}, const Float: vecAngles[3] = {0.0, 0.0, 0.0});

/**
 * Gives a single item to player.
 *
 * Usage:
 *    // Giving a crowbar to player.
 *     WpnMod_GiveItem(iPlayer, "weapon_crowbar");
 *
 * @param iPlayer          Player index.
 *
 * @return                 Item entity index or -1 on failure. (integer)
 */
native WpnMod_GiveItem(const iPlayer, const szItemName[]);

/**
 * Gives a multiple items to player.
 *
 * Usage:
 *    // Giving one crowbar and two automatic rifles to player.
 *     WpnMod_GiveEquip(iPlayer, "weapon_crowbar", "weapon_9mmAR:2");
 *
 * @param iPlayer            Player index.
 */
native WpnMod_GiveEquip(const iPlayer, const any: ...);

/**
 * Default deploy function.
 *
 * @param iItem            Weapon's entity index.
 * @param szViewModel      Weapon's view model (V).
 * @param szWeaponModel    Weapon's player model (P).
 * @param iAnim            Sequence number of deploy animation.
 * @param szAnimExt        Animation extension.
 */
native WpnMod_DefaultDeploy(const iItem, const szViewModel[], const szWeaponModel[], const iAnim, const szAnimExt[]);

/**
 * Default reload function.
 *
 * @param iItem            Weapon's entity index.
 * @param iClipSize        Maximum weapon's clip size.
 * @param iAnim            Sequence number of reload animation.
 * @param flDelay          Reload delay time.
 */
native WpnMod_DefaultReload(const iItem, const iClipSize, const iAnim, const Float: flDelay);

/**
 * Sets the weapon so that it can play empty sound again.
 *
 * @param iItem            Weapon's entity index.
 */
native WpnMod_ResetEmptySound(const iItem);

/**
 * Plays the weapon's empty sound.
 *
 * @param iItem            Weapon's entity index.
 */
native WpnMod_PlayEmptySound(const iItem);

/**
* Get player's ammo inventory.
 *
 * @param iPlayer          Player id.
 * @param szAmmoName       Ammo type. ("9mm", "uranium", "MY_AMMO" etc..)
 *
 * @return                 Amount of given ammo. (integer)
*/
native WpnMod_GetPlayerAmmo(const iPlayer, const szAmmoName[]);

/**
* Set player's ammo inventory.
 *
 * @param iPlayer          Player id.
 * @param szAmmoName       Ammo type. ("9mm", "uranium", "MY_AMMO" etc..)
 * @param iAmount          Ammo amount.
*/
native WpnMod_SetPlayerAmmo(const iPlayer, const szAmmoName[], const iAmount);

/**
 * Plays weapon's animation.
 *
 * @param iItem            Weapon's entity index.
 * @param iAnim            Sequence number.
 */
native WpnMod_SendWeaponAnim(const iItem, const iAnim);

/**
 * Sets the activity for player based on an event or current state.
 *
 * @param iPlayer          Player index.
 * @param iPlayerAnim      Animation (see PLAYER_ANIM constants).
 */
native WpnMod_SetPlayerAnim(const iPlayer, const PLAYER_ANIM: iPlayerAnim);

/**
 * Returns a value from entity's private data. Use the e_pvData_* enum.
 *
 * @param iEntity          Entity index.
 * @param iPvData          pvData type.
 *
 * @return                 Entity's value from privaate data.
 */
native any: WpnMod_GetPrivateData(const iEntity, const e_pvData: iPvData, any: ...);

/**
 * Sets a value to entity's private data. Use the e_pvData_* enum.
 *
 * @param iEntity          Entity index.
 * @param iPvData          pvData type.
*/
native WpnMod_SetPrivateData(const iEntity, const e_pvData: iPvData, const any: ...);

/**
 *
*/
native any: WpnMod_GetEntityField(const iEntity, const szField[], any:...);

/**
 *
*/
native WpnMod_SetEntityField(const iEntity, const szField[], const any:...);

/**
 * Sets entity's think callback. Analogue of set_task native.
 *
 * Usage:
 *     WpnMod_SetThink(iItem, "M249_CompleteReload", 1.52);
 *
 * @param iEntity          Entity's index.
 * @param szCallBack       The forward to call.
 * @param flNextThink      Time until next think.
 */
native WpnMod_SetThink(const iEntity, const szCallBack[], const Float: flNextThink = 0.0);

/**
 * Sets entity's touch calback.
 *
 * @param iEntity          Entity's index.
 * @param szCallBack       The forward to call.
 * @param szToucher        Specify toucher's classname.
 */
native WpnMod_SetTouch(const iEntity, const szCallBack[], const szToucher[] = "");

/**
 * Fire bullets from player's weapon.
 *
 * @param iPlayer          Player index.
 * @param iAttacker        Attacker index (usualy it equal to previous param).
 * @param iShotsCount      Number of shots.
 * @param vecSpread        Spread.
 * @param flDistance       Max shot distance.
 * @param flDamage         Damage amount.
 * @param bitsDamageType   Damage type.
 * @param iTracerFreq      Tracer frequancy.
 */
native WpnMod_FireBullets(const iPlayer, const iAttacker, const iShotsCount, const Float: vecSpread[3], const Float: flDistance, const Float: flDamage, const bitsDamageType, const iTracerFreq);

hl_wpnmod_compat.inc

Код:
/**
 * Who put these backwards... (c)
 */
 
 /*
 * Half-Life Weapon Mod
 * Copyright (c) 2012 - 2014 AGHL.RU Dev Team
 *
 * http://aghl.ru/forum/ - Russian Half-Life and Adrenaline Gamer Community
 *
 *
 *    This program is free software; you can redistribute it and/or modify it
 *    under the terms of the GNU General Public License as published by the
 *    Free Software Foundation; either version 2 of the License, or (at
 *    your option) any later version.
 *
 *    This program is distributed in the hope that it will be useful, but
 *    WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *    General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with this program; if not, write to the Free Software Foundation,
 *    Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 *    In addition, as a special exception, the author gives permission to
 *    link the code of this program with the Half-Life Game Engine ("HL
 *    Engine") and Modified Game Libraries ("MODs") developed by Valve,
 *    L.L.C ("Valve").  You must obey the GNU General Public License in all
 *    respects for all of the code used other than the HL Engine and MODs
 *    from Valve.  If you modify this file, you may extend this exception
 *    to your version of the file, but you are not obligated to do so.  If
 *    you do not wish to do so, delete this exception statement from your
 *    version.
 *
 */

#if defined _hl_wpnmod_compat_included
    #endinput
#endif

#define _hl_wpnmod_compat_included

#define    wpnmod_register_weapon WpnMod_RegisterWeapon
#define wpnmod_register_weapon_forward WpnMod_RegisterWeaponForward
#define wpnmod_get_weapon_info WpnMod_GetWeaponInfo
#define wpnmod_get_weapon_count WpnMod_GetWeaponNum
#define wpnmod_register_ammobox WpnMod_RegisterAmmoBox
#define wpnmod_register_ammobox_forward WpnMod_RegisterAmmoBoxForward
#define wpnmod_get_ammobox_info WpnMod_GetAmmoBoxInfo
#define wpnmod_get_ammobox_count WpnMod_GetAmmoBoxNum
#define    wpnmod_create_item WpnMod_CreateItem
#define    wpnmod_default_deploy WpnMod_DefaultDeploy
#define    wpnmod_default_reload WpnMod_DefaultReload
#define    wpnmod_reset_empty_sound WpnMod_ResetEmptySound
#define    wpnmod_play_empty_sound WpnMod_PlayEmptySound
#define    wpnmod_get_player_ammo WpnMod_GetPlayerAmmo
#define    wpnmod_set_player_ammo WpnMod_SetPlayerAmmo
#define    wpnmod_send_weapon_anim WpnMod_SendWeaponAnim
#define    wpnmod_set_player_anim WpnMod_SetPlayerAnim
#define wpnmod_set_think WpnMod_SetThink
#define wpnmod_set_touch WpnMod_SetTouch
#define wpnmod_fire_bullets WpnMod_FireBullets

#define    wpnmod_set_anim_ext(%0,%1) WpnMod_SetPrivateData(%0, PV_SZ_szAnimExtention, %1)
#define    wpnmod_get_anim_ext(%0,%1,%2) WpnMod_GetPrivateData(%0, PV_SZ_szAnimExtention, %1, %2)
#define    wpnmod_set_offset_int(%0,%1,%2) WpnMod_SetPrivateData(%0, e_pvData: __OffsetsCompat[%1], %2)
#define    wpnmod_get_offset_int(%0,%1) WpnMod_GetPrivateData(%0, e_pvData: __OffsetsCompat[%1])
#define    wpnmod_set_offset_float(%0,%1,%2) WpnMod_SetPrivateData(%0, e_pvData: __OffsetsCompat[%1], %2)
#define    wpnmod_get_offset_float(%0,%1) WpnMod_GetPrivateData(%0, e_pvData: __OffsetsCompat[%1])
#define wpnmod_set_offset_cbase(%0,%1,%2) WpnMod_SetPrivateData(%0, e_pvData: __OffsetsCompat_CBase[%1], %2)
#define wpnmod_get_offset_cbase _GET_CBASE_1:_GET_CBASE_0

// Credits to Y_Less
#define _GET_CBASE_0(%0,%1) _GET_CBASE_1:_GET_CBASE_0(%0,%1,0)
#define _GET_CBASE_1:_GET_CBASE_0(%0,%1,%2) WpnMod_GetPrivateData(%0, e_pvData: __OffsetsCompat_CBase[%1], %2)

enum e_CBase
{
    CBase_pPlayer,
    CBase_pNext,
    CBase_rgpPlayerItems,
    CBase_pActiveItem,
    CBase_pLastItem,
    CBase_End
};

enum e_Offsets
{
    Offset_flStartThrow,
    Offset_flReleaseThrow,
    Offset_iChargeReady,
    Offset_iInAttack,
    Offset_iFireState,
    Offset_iFireOnEmpty,
    Offset_flPumpTime,
    Offset_iInSpecialReload,
    Offset_flNextPrimaryAttack,
    Offset_flNextSecondaryAttack,
    Offset_flTimeWeaponIdle,
    Offset_iPrimaryAmmoType,
    Offset_iSecondaryAmmoType,
    Offset_iClip,
    Offset_iInReload,
    Offset_iDefaultAmmo,
    Offset_flNextAttack,
    Offset_iWeaponVolume,
    Offset_iWeaponFlash,
    Offset_iLastHitGroup,
    Offset_iFOV,
    Offset_iuser1,
    Offset_iuser2,
    Offset_iuser3,
    Offset_iuser4,
    Offset_fuser1,
    Offset_fuser2,
    Offset_fuser3,
    Offset_fuser4,
    Offset_End
};

stock const __OffsetsCompat_CBase[CBase_End] =
{
    PV_ENT_pPlayer,
    PV_ENT_pNext,
    PV_ENT_rgpPlayerItems,
    PV_ENT_pActiveItem,
    PV_ENT_pLastItem,
};

stock const __OffsetsCompat[Offset_End] =
{
    PV_FL_flStartThrow,
    PV_FL_flReleaseThrow,
    PV_INT_iChargeReady,
    PV_INT_iInAttack,
    PV_INT_iFireState,
    PV_INT_iFireOnEmpty,
    PV_FL_flPumpTime,
    PV_INT_iInSpecialReload,
    PV_FL_flNextPrimaryAttack,
    PV_FL_flNextSecondaryAttack,
    PV_FL_flTimeWeaponIdle,
    PV_INT_iPrimaryAmmoType,
    PV_INT_iSecondaryAmmoType,
    PV_INT_iClip,
    PV_INT_iInReload,
    PV_INT_iDefaultAmmo,
    PV_FL_flNextAttack,
    PV_INT_iWeaponVolume,
    PV_INT_iWeaponFlash,
    PV_INT_iLastHitGroup,
    PV_INT_iFOV,
    PV_INT_iuser1,
    PV_INT_iuser2,
    PV_INT_iuser3,
    PV_INT_iuser4,
    PV_FL_fuser1,
    PV_FL_fuser2,
    PV_FL_fuser3,
    PV_FL_fuser4
};







/**
 * Fire default contact grenade from player's weapon.
 *
 * @param iPlayer            Player index.
 * @param vecStart            Start position.
 * @param vecVelocity        Velocity.
 * @param szCallBack        The forward to call on explode.
 *
 * @return                    Contact grenade index or -1 on failure. (integer)
 */
native wpnmod_fire_contact_grenade(const iPlayer, const Float: vecStart[3], const Float: vecVelocity[3], const szCallBack[] = "");

/**
 * Fire default timed grenade from player's weapon.
 *
 * @param iPlayer            Player index.
 * @param vecStart            Start position.
 * @param vecVelocity        Velocity.
 * @param flTime            Time before detonate.
 * @param szCallBack        The forward to call on explode.
 *
 * @return                    Contact grenade index or -1 on failure. (integer)
 */
native wpnmod_fire_timed_grenade(const iPlayer, const Float: vecStart[3], const Float: vecVelocity[3], const Float: flTime = 3.0, const szCallBack[] = "");

/**
 * Make damage upon entities within a certain range.
 *     Only damage ents that can clearly be seen by the explosion.
 *
 * @param vecSrc            Origin of explosion.
 * @param iInflictor        Entity which causes the damage impact.
 * @param iAttacker            Attacker index.
 * @param flDamage            Damage amount.
 * @param flRadius            Damage radius.
 * @param iClassIgnore        Class to ignore.
 * @param bitsDamageType    Damage type (DMG_BLAST and etc).
 */
native wpnmod_radius_damage(const Float: vecSrc[3], const iInflictor, const iAttacker, const Float: flDamage, const Float: flRadius, const iClassIgnore, const bitsDamageType);

/**
 * Same as wpnmod_radius_damage, but blocks 'ghost mines' and 'ghost nades'.
 *
 * @param vecSrc            Origin of explosion.
 * @param iInflictor        Entity which causes the damage impact.
 * @param iAttacker            Attacker index.
 * @param flDamage            Damage amount.
 * @param flRadius            Damage radius.
 * @param iClassIgnore        Class to ignore.
 * @param bitsDamageType    Damage type (DMG_BLAST and etc).
 */
native wpnmod_radius_damage2(const Float: vecSrc[3], const iInflictor, const iAttacker, const Float: flDamage, const Float: flRadius, const iClassIgnore, const bitsDamageType);

/**
 * Resets the global multi damage accumulator.
 */
 native wpnmod_clear_multi_damage();

 /**
 * Inflicts contents of global multi damage register on entity.
 *
 * @param iInflictor        Entity which causes the damage impact.
 * @param iAttacker            Attacker index.
 */
 native wpnmod_apply_multi_damage(const iInflictor, const iAttacker);

/**
 * Eject a brass from player's weapon.
 *
 * @param iPlayer            Player index.
 * @param iShellModelIndex    Index of precached shell's model.
 * @param iSoundtype        Bounce sound type (see defines).
 * @param flForwardScale    Forward scale value.
 * @param flUpScale            Up scale value.
 * @param flRightScale        Right scale value.
 */
native wpnmod_eject_brass(const iPlayer, const iShellModelIndex, const iSoundtype, const Float: flForwardScale, const Float: flUpScale, const Float: flRightScale);

/**
 * Returns index of random damage decal for given entity.
 *
 * @param iEntity        Entity.
 *
 * @return                Index of damage decal. (integer)
 */
native wpnmod_get_damage_decal(const iEntity);

/**
 * Get player's gun position. Result will set in vecResult.
 *
 * @param iPlayer            Player index.
 * @param vecResult            Calculated gun position.
 * @param flForwardScale    Forward scale value.
 * @param flUpScale            Up scale value.
 * @param flRightScale        Right scale value.
 */
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);

/**
 * Explode and then remove entity.
 *
 * @param iEntity            Entity index.
 * @param bitsDamageType    Damage type.
 * @param szCallBack        The forward to call on explode.
 */
native wpnmod_explode_entity(const iEntity, const bitsDamageType = 0, const szCallBack[] = "");

/**
 * Draw decal by index or name on trace end.
 *
 * @param iTrace            Trace handler.
 * @param iDecalIndex        Decal index.
 * @param szDecalName        Decal name.
 */
native wpnmod_decal_trace(const iTrace, const iDecalIndex = -1, const szDecalName[] = "");

/**
 * Detects the texture of an entity from a direction.
 *
 * @param iEntity            Entity index that we want to get the texture.
 * @param vecSrc            The point from where the trace starts.
 * @param vecEnd            The point where the trace ends.
 * @param szTextureName        Buffer to save the texture name.
 * @param iLen                Buffer's length.
 */
native wpnmod_trace_texture(const iEntity, const Float: vecSrc[3], const Float: vecEnd[3], szTextureName[], const iLen);

hl_wpnmod_const.inc

Код:
/*
 * Half-Life Weapon Mod
 * Copyright (c) 2012 - 2014 AGHL.RU Dev Team
 *
 * http://aghl.ru/forum/ - Russian Half-Life and Adrenaline Gamer Community
 *
 *
 *    This program is free software; you can redistribute it and/or modify it
 *    under the terms of the GNU General Public License as published by the
 *    Free Software Foundation; either version 2 of the License, or (at
 *    your option) any later version.
 *
 *    This program is distributed in the hope that it will be useful, but
 *    WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *    General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with this program; if not, write to the Free Software Foundation,
 *    Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 *    In addition, as a special exception, the author gives permission to
 *    link the code of this program with the Half-Life Game Engine ("HL
 *    Engine") and Modified Game Libraries ("MODs") developed by Valve,
 *    L.L.C ("Valve").  You must obey the GNU General Public License in all
 *    respects for all of the code used other than the HL Engine and MODs
 *    from Valve.  If you modify this file, you may extend this exception
 *    to your version of the file, but you are not obligated to do so.  If
 *    you do not wish to do so, delete this exception statement from your
 *    version.
 *
 */
 
#if defined _hl_wpnmod_const_included
    #endinput
#endif

#define _hl_wpnmod_const_included

#define WPNMOD_API_VERSION 2


// Maximum available weapons
#define MAX_WEAPONS                        32

// Temp entity bounce sound types
#define TE_BOUNCE_NULL                    0
#define TE_BOUNCE_SHELL                    1
#define TE_BOUNCE_SHOTSHELL                2

// Gun volumes
#define LOUD_GUN_VOLUME                    1000
#define NORMAL_GUN_VOLUME                600
#define QUIET_GUN_VOLUME                200

// Gun flash
#define    BRIGHT_GUN_FLASH                512
#define NORMAL_GUN_FLASH                256
#define    DIM_GUN_FLASH                    128

// Weapon flags
#define ITEM_FLAG_SELECTONEMPTY            1
#define ITEM_FLAG_NOAUTORELOAD            2
#define ITEM_FLAG_NOAUTOSWITCHEMPTY        4
#define ITEM_FLAG_LIMITINWORLD            8
#define ITEM_FLAG_EXHAUSTIBLE            16 // A player can totally exhaust their ammo supply and lose this weapon

// Default spreads
#define VECTOR_CONE_1DEGREES            Float:{ 0.00873, 0.00873, 0.00873 }
#define VECTOR_CONE_2DEGREES            Float:{ 0.01745, 0.01745, 0.01745 }
#define VECTOR_CONE_3DEGREES            Float:{ 0.02618, 0.02618, 0.02618 }
#define VECTOR_CONE_4DEGREES            Float:{ 0.03490, 0.03490, 0.03490 }
#define VECTOR_CONE_5DEGREES            Float:{ 0.04362, 0.04362, 0.04362 }
#define VECTOR_CONE_6DEGREES            Float:{ 0.05234, 0.05234, 0.05234 }
#define VECTOR_CONE_7DEGREES            Float:{ 0.06105, 0.06105, 0.06105 }
#define VECTOR_CONE_8DEGREES            Float:{ 0.06976, 0.06976, 0.06976 }
#define VECTOR_CONE_9DEGREES            Float:{ 0.07846, 0.07846, 0.07846 }
#define VECTOR_CONE_10DEGREES            Float:{ 0.08716, 0.08716, 0.08716 }
#define VECTOR_CONE_15DEGREES            Float:{ 0.13053, 0.13053, 0.13053 }
#define VECTOR_CONE_20DEGREES            Float:{ 0.17365, 0.17365, 0.17365 }

// For CLASSIFY
#define    CLASS_NONE                        0
#define CLASS_MACHINE                    1
#define CLASS_PLAYER                    2
#define    CLASS_HUMAN_PASSIVE                3
#define CLASS_HUMAN_MILITARY            4
#define CLASS_ALIEN_MILITARY            5
#define CLASS_ALIEN_PASSIVE                6
#define CLASS_ALIEN_MONSTER                7
#define CLASS_ALIEN_PREY                8
#define CLASS_ALIEN_PREDATOR            9
#define CLASS_INSECT                    10
#define CLASS_PLAYER_ALLY                11
#define CLASS_PLAYER_BIOWEAPON            12 // Hornets and snarks, launched by players
#define CLASS_ALIEN_BIOWEAPON            13 // Hornets and snarks, launched by the alien menace

// Grenade explosion flags
#define SF_EXPLOSION_NODAMAGE            ( 1 << 0 ) // When set, explosion will not actually inflict damage
#define SF_EXPLOSION_NOFIREBALL            ( 1 << 1 ) // Don't draw the fireball
#define SF_EXPLOSION_NOSMOKE            ( 1 << 2 ) // Don't draw the smoke
#define SF_EXPLOSION_NODECAL            ( 1 << 3 ) // Don't make a scorch mark
#define SF_EXPLOSION_NOSPARKS            ( 1 << 4 ) // Don't make a sparks
#define SF_EXPLOSION_NODEBRIS            ( 1 << 5 ) // Don't make a debris sound

enum PLAYER_ANIM
{
    PLAYER_IDLE,
    PLAYER_WALK,
    PLAYER_JUMP,
    PLAYER_SUPERJUMP,
    PLAYER_DIE,
    PLAYER_ATTACK1,
};

enum e_AmmoFwds
{
    /**
     * Forward params for all functions:
     *
     * @param iItem                Ammobox's entity index.
     */
  
    Fwd_Ammo_Spawn,                    /* This is called whenever a ammobox entity is created. */
    Fwd_Ammo_AddAmmo,

    Fwd_Ammo_End
};

enum e_WpnFwds
{
    /**
     * Forward params for all functions:
     *
     * @param iItem                Weapon's entity index.
     * @param iPlayer            Player index, owner of weapon.
     * @param iClip                Amount of ammo in weapon's clip.
     * @param iAmmo                Amount of ammo in backpack on a user for weapon.
     */
  
    Fwd_Wpn_Spawn,                    /* This is called whenever a weapon entity is created. */
    Fwd_Wpn_CanDeploy,                /* Whether or not this weapon can be deployed. */
    Fwd_Wpn_Deploy,                    /* Deploys a weapon. */
    Fwd_Wpn_Idle,                    /* Displays the idle animation for the weapon. */
    Fwd_Wpn_PrimaryAttack,            /* Called when the main attack of a weapon is triggered. */
    Fwd_Wpn_SecondaryAttack,        /* Called when the secondary attack of a weapon is triggered. */
    Fwd_Wpn_Reload,                    /* Called when the weapon is reloaded. */
    Fwd_Wpn_CanHolster,                /* Whether or not the weapon can be holstered. */
    Fwd_Wpn_Holster,                /* Holsters a weapon. */
    Fwd_Wpn_IsUseable,                /* Whether or not the weapon is usable. (has ammo, etc.) */
    Fwd_Wpn_AddToPlayer,
    Fwd_Wpn_AddToPlayer2,
    Fwd_Wpn_ItemPostFrame,

    Fwd_Wpn_End
};

enum e_AmmoInfo
{
    AmmoInfo_szName,

    AmmoInfo_End
};

enum e_ItemInfo
{
    ItemInfo_bCustom,

    ItemInfo_iSlot,
    ItemInfo_iPosition,
    ItemInfo_iMaxAmmo1,
    ItemInfo_iMaxAmmo2,
    ItemInfo_iMaxClip,
    ItemInfo_iId,
    ItemInfo_iFlags,
    ItemInfo_iWeight,

    ItemInfo_szName,
    ItemInfo_szAmmo1,
    ItemInfo_szAmmo2,
    ItemInfo_szTitle,
    ItemInfo_szAuthor,
    ItemInfo_szVersion,

    ItemInfo_End
};

enum e_pvData
{
    PV_INT_iChargeReady,
    PV_INT_iInAttack,
    PV_INT_iFireState,
    PV_INT_iFireOnEmpty,
    PV_INT_iInSpecialReload,
    PV_INT_iPrimaryAmmoType,
    PV_INT_iSecondaryAmmoType,
    PV_INT_iClip,
    PV_INT_iInReload,
    PV_INT_iDefaultAmmo,
    PV_INT_iWeaponVolume,
    PV_INT_iWeaponFlash,
    PV_INT_iLastHitGroup,
    PV_INT_iFOV,
    PV_INT_iuser1,
    PV_INT_iuser2,
    PV_INT_iuser3,
    PV_INT_iuser4,

    PV_FL_flStartThrow,
    PV_FL_flReleaseThrow,
    PV_FL_flPumpTime,
    PV_FL_flNextPrimaryAttack,
    PV_FL_flNextSecondaryAttack,
    PV_FL_flTimeWeaponIdle,
    PV_FL_flNextAttack,
    PV_FL_fuser1,
    PV_FL_fuser2,
    PV_FL_fuser3,
    PV_FL_fuser4,

    PV_ENT_pPlayer,
    PV_ENT_pNext,
    PV_ENT_rgpPlayerItems,
    PV_ENT_pActiveItem,
    PV_ENT_pLastItem,

    PV_SZ_szAnimExtention
};
Назад
Верх