2
0
mirror of https://github.com/rehlds/reapi.git synced 2024-12-28 15:45:31 +03:00

Add natives rg_set_user_ammo, rg_get_user_ammo, rg_give_custom_item, set_rebuy, get_rebuy

Add all the members weapons, also CMapInfo, RebuyStruct, CGrenade
Add hookchain StartDeathCam
Cosmetic changes
Update regamedll API 5.3
This commit is contained in:
s1lent 2017-09-28 04:12:09 +07:00
parent 19d0f05b52
commit 23fe1507a1
No known key found for this signature in database
GPG Key ID: 0FE401DC73916B5C
26 changed files with 2633 additions and 755 deletions

View File

@ -223,6 +223,17 @@
#define PFLAG_USING (1<<4) // Using a continuous entity
#define PFLAG_OBSERVER (1<<5) // Player is locked in stationary cam mode. Spectators can move, observers can't.
// Player HUD
// CBasePlayer::m_iHideHUD
#define HIDEHUD_WEAPONS (1<<0)
#define HIDEHUD_FLASHLIGHT (1<<1)
#define HIDEHUD_ALL (1<<2)
#define HIDEHUD_HEALTH (1<<3)
#define HIDEHUD_TIMER (1<<4)
#define HIDEHUD_MONEY (1<<5)
#define HIDEHUD_CROSSHAIR (1<<6)
#define HIDEHUD_OBSERVER_CROSSHAIR (1<<7)
/**
* @section get_entvar(entity, var_spawnflags) values
*/
@ -1162,3 +1173,12 @@ enum ItemID
ITEM_ANTIDOTE,
ITEM_BATTERY
};
// CMapInfo:m_iBuyingStatus
enum InfoMapBuyParam
{
BUYING_EVERYONE = 0,
BUYING_ONLY_CTS,
BUYING_ONLY_TERRORISTS,
BUYING_NO_ONE,
};

View File

@ -39,7 +39,39 @@ enum members_tables_e
mt_baseitem,
mt_baseweapon,
mt_weaponbox,
mt_armoury
mt_armoury,
mt_grenade,
mt_p228,
mt_scout,
mt_hegrenade,
mt_xm1014,
mt_c4,
mt_mac10,
mt_aug,
mt_smokegrenade,
mt_elite,
mt_fiveseven,
mt_ump45,
mt_sg550,
mt_galil,
mt_famas,
mt_usp,
mt_glock18,
mt_awp,
mt_mp5n,
mt_m249,
mt_m3,
mt_m4a1,
mt_tmp,
mt_g3sg1,
mt_deagle,
mt_sg552,
mt_ak47,
mt_knife,
mt_p90,
mt_shield,
mt_rebuystruct,
mt_mapinfo,
};
// Is like FNullEnt
@ -94,7 +126,6 @@ enum HookChain
* @param post Whether or not to forward this in post
*
* @return Returns a hook handle. Use EnableHookChain/DisableHookChain to toggle the forward on or off
*
*/
native HookChain:RegisterHookChain({EngineFunc, GamedllFunc, GamedllFunc_CBaseAnimating, GamedllFunc_CBasePlayer, GamedllFunc_CSGameRules, ReCheckerFunc}:function_id, const callback[], post = 0);
@ -114,7 +145,6 @@ native bool:DisableHookChain(HookChain:hook);
* @param hook The hook to re-enable
*
* @return Returns true if the function is successfully executed, otherwise false
*
*/
native bool:EnableHookChain(HookChain:hook);
@ -135,7 +165,6 @@ native SetHookChainReturn(AType:type, any:...);
* @param [maxlen] Max length of string (optional)
*
* @return If an integer or boolean or one byte or float, array or everything else is passed via 1st argument and more
*
*/
native any:GetHookChainReturn(AType:type, any:...);
@ -148,7 +177,6 @@ native any:GetHookChainReturn(AType:type, any:...);
* @param [maxlen] Max length of string (optional)
*
* @return Returns true if the function is successfully executed, otherwise false
*
*/
native SetHookChainArg(number, AType:type, any:...);
@ -157,7 +185,6 @@ native SetHookChainArg(number, AType:type, any:...);
* @note This native also checks the validity of an entity.
*
* @return true/false
*
*/
native bool:FClassnameIs(const entityIndex, const className[]);
@ -192,7 +219,6 @@ native get_viewent(const index);
* Check if the entity is valid.
*
* @return true/false
*
*/
native bool:is_entity(const entityIndex);
@ -200,7 +226,6 @@ native bool:is_entity(const entityIndex);
* Check if ReHLDS is available.
*
* @return true/false
*
*/
native bool:is_rehlds();
@ -208,7 +233,6 @@ native bool:is_rehlds();
* Check if ReGameDLL is available.
*
* @return true/false
*
*/
native bool:is_regamedll();
@ -224,7 +248,6 @@ native bool:has_reunion();
* Check if VTC is available.
*
* @return true/false
*
*/
native bool:has_vtc();
@ -232,7 +255,6 @@ native bool:has_vtc();
* Check if Rechecker is available.
*
* @return true/false
*
*/
native bool:has_rechecker();

View File

@ -61,7 +61,6 @@ native set_key_value(const pbuffer, const key[], const value[]);
* @param mapname New map name.
*
* @noreturn
*
*/
native rh_set_mapname(const mapname[]);
@ -74,7 +73,6 @@ native rh_set_mapname(const mapname[]);
* MNT_TRUE will return the original map name independant of the name set with via rh_set_mapname
*
* @noreturn
*
*/
native rh_get_mapname(output[], len, MapNameType:type = MNT_SET);
@ -82,7 +80,6 @@ native rh_get_mapname(output[], len, MapNameType:type = MNT_SET);
* Reverts back the original map name.
*
* @noreturn
*
*/
native rh_reset_mapname();
@ -101,7 +98,6 @@ native rh_reset_mapname();
* @param origin Specify origin and only on "param" entity worldspawn that is 0
*
* @return true if the emission was successfull, false otherwise
*
*/
native bool:rh_emit_sound2(const entity, const recipient, const channel, const sample[], Float:vol = VOL_NORM, Float:attn = ATTN_NORM, const flags = 0, const pitch = PITCH_NORM, emitFlags = 0, const Float:origin[3] = {0.0,0.0,0.0});

View File

@ -21,7 +21,6 @@ native set_member_game(CSGameRules_Members:member, any:...);
* @param member The specified member, look at the enums with name CSGameRules_Members
*
* @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
*
*/
native any:get_member_game(CSGameRules_Members:member, any:...);
@ -33,9 +32,7 @@ native any:get_member_game(CSGameRules_Members:member, any:...);
*
* @return 1 on success.
*/
native set_member(const index, {CBaseEntity_Members, CBaseAnimating_Members, CBaseMonster_Members,
CBasePlayer_Members, CCSPlayer_Members, CBasePlayerItem_Members, CBasePlayerWeapon_Members,
CWeaponBox_Members, CArmoury_Members}:member, any:...);
native set_member(const index, any:member, any:...);
/*
* Returns a value from an entity's member.
@ -45,9 +42,7 @@ native set_member(const index, {CBaseEntity_Members, CBaseAnimating_Members, CBa
*
* @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
*/
native any:get_member(const index, {CBaseEntity_Members, CBaseAnimating_Members, CBaseMonster_Members,
CBasePlayer_Members, CCSPlayer_Members, CBasePlayerItem_Members, CBasePlayerWeapon_Members,
CWeaponBox_Members, CArmoury_Members}:member, any:...);
native any:get_member(const index, any:member, any:...);
/*
* Sets playermove var.
@ -103,6 +98,24 @@ native set_pmtrace(const tracehandle, const PMTrace:var, any:...);
*/
native any:get_pmtrace(const tracehandle, const PMTrace:var, any:...);
/*
* Sets a RebuyStruct member.
*
* @param var The specified RebuyStruct, look at the enum RebuyStruct
*
* @return 1 on success.
*/
native set_rebuy(const RebuyHandle:rebuyhandle, const RebuyStruct:member, value);
/*
* Returns a RebuyStruct member
*
* @param var The specified RebuyStruct, look at the enum RebuyStruct
*
* @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
*/
native get_rebuy(const RebuyHandle:rebuyhandle, RebuyStruct:member);
/*
* Assign the number of the player's animation.
*
@ -135,6 +148,20 @@ native rg_add_account(const index, amount, AccountSet:typeSet = AS_ADD, const bo
*/
native rg_give_item(const index, const pszName[], GiveType:type = GT_APPEND);
/*
* Gives the player an custom item, this means that don't handled API things.
*
* @example rg_give_custom_item(id, "weapon_c4"); doesn't sets the member m_bHasC4 to true, as the rg_give_item does.
*
* @param index Client index
* @param pszName Item classname
* @param type Look at the enums with name GiveType
*
* @return Index of entity if successfull, -1 otherwise
*
*/
native rg_give_custom_item(const index, const pszName[], GiveType:type = GT_APPEND);
/*
* Give the default items to a player.
*
@ -269,7 +296,6 @@ native rg_update_teamscores(const iCtsWins = 0, const iTsWins = 0, const bool:bA
* @note: Do not use this if you use a custom classname
*
* @return Index of the created entity or 0 otherwise
*
*/
native rg_create_entity(const classname[], const bool:useHashTable = false);
@ -283,7 +309,6 @@ native rg_create_entity(const classname[], const bool:useHashTable = false);
* @note: Do not use this if you use a custom classname
*
* @return Entity index > 0 if found, 0 otherwise
*
*/
native rg_find_ent_by_class(start_index, const classname[], const bool:useHashTable = false);
@ -294,7 +319,6 @@ native rg_find_ent_by_class(start_index, const classname[], const bool:useHashTa
* @param classname Classname to search for
*
* @return 1 if found, 0 otherwise
*
*/
native rg_find_ent_by_owner(&start_index, const classname[], owner);
@ -305,7 +329,6 @@ native rg_find_ent_by_owner(&start_index, const classname[], owner);
* @param weapon Weapon name
*
* @return Weapon's entity index, 0 otherwise
*
*/
native rg_find_weapon_bpack_by_name(const index, const weapon[]);
@ -316,7 +339,6 @@ native rg_find_weapon_bpack_by_name(const index, const weapon[]);
* @param item Item name
*
* @return true if he does, false otherwise
*
*/
native bool:rg_has_item_by_name(const index, const item[]);
@ -328,7 +350,6 @@ native bool:rg_has_item_by_name(const index, const item[]);
*
* @return Weapon information
* @error If weapon_id or type are out of bounds, an error will be thrown
*
*/
native any:rg_get_weapon_info(any:...);
@ -339,7 +360,6 @@ native any:rg_get_weapon_info(any:...);
* @param type Info type, see WI_* constants
*
* @return 1 on success, 0 otherwise
*
*/
native rg_set_weapon_info(const {WeaponIdType,_}:weapon_id, WpnInfo:type, any:...);
@ -350,7 +370,6 @@ native rg_set_weapon_info(const {WeaponIdType,_}:weapon_id, WpnInfo:type, any:..
* @param slot The slot that will be emptied
*
* @return 1 on success, 0 otherwise
*
*/
native rg_remove_items_by_slot(const index, const InventorySlotType:slot);
@ -361,7 +380,6 @@ native rg_remove_items_by_slot(const index, const InventorySlotType:slot);
* @param slot Specific slot for remove of each item.
*
* @return 1 on success, 0 otherwise
*
*/
native rg_drop_items_by_slot(const index, const InventorySlotType:slot);
@ -372,7 +390,6 @@ native rg_drop_items_by_slot(const index, const InventorySlotType:slot);
* @param removeSuit Remove suit
*
* @return 1 on success, 0 otherwise
*
*/
native rg_remove_all_items(const index, const bool:removeSuit = false);
@ -395,7 +412,6 @@ native rg_drop_item(const index, const item_name[]);
* @param arg Optional command arguments
*
* @return 1 on success, 0 otherwise
*
*/
native rg_internal_cmd(const index, const cmd[], const arg[] = "");
@ -406,21 +422,9 @@ native rg_internal_cmd(const index, const cmd[], const arg[] = "");
* @param item_name Item classname
*
* @return 1 if found and remove, 0 otherwise
*
*/
native rg_remove_item(const index, const item_name[]);
/*
* Returns the amount of ammo in the client's backpack for a specific weapon.
*
* @param index Client index
* @param weapon Weapon id
*
* @return Amount of ammo in backpack
*
*/
native rg_get_user_bpammo(const index, WeaponIdType:weapon);
/*
* Sets the amount of ammo in the client's backpack for a specific weapon.
*
@ -429,10 +433,40 @@ native rg_get_user_bpammo(const index, WeaponIdType:weapon);
* @param amount New backpack ammo amount to set
*
* @noreturn
*
*/
native rg_set_user_bpammo(const index, WeaponIdType:weapon, amount);
/*
* Returns the amount of ammo in the client's backpack for a specific weapon.
*
* @param index Client index
* @param weapon Weapon id
*
* @return Amount of ammo in backpack
*/
native rg_get_user_bpammo(const index, WeaponIdType:weapon);
/*
* Sets the amount of clip ammo for a specific weapon.
*
* @param index Client index
* @param weapon Weapon id
* @param amount New clip ammo amount to set
*
* @noreturn
*/
native rg_set_user_ammo(const index, WeaponIdType:weapon, amount);
/*
* Returns the amount of clip ammo for a specific weapon.
*
* @param index Client index
* @param weapon Weapon id
*
* @return Amount of clip ammo
*/
native rg_get_user_ammo(const index, WeaponIdType:weapon);
/*
* Sets the client's defusekit status and allows to set a custom HUD icon and color.
*
@ -443,7 +477,6 @@ native rg_set_user_bpammo(const index, WeaponIdType:weapon, amount);
* @param flash If nonzero the icon will flash red
*
* @noreturn
*
*/
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);
@ -454,9 +487,8 @@ native rg_give_defusekit(const index, const bool:bDefusekit = true, const Float:
* @param armortype Variable to store armor type in
*
* @return Amount of armor, 0 if the client has no armor
*
*/
native rg_get_user_armor(const index, &ArmorType:armortype);
native rg_get_user_armor(const index, &ArmorType:armortype = ARMOR_NONE);
/*
* Sets the client's armor value and the type of armor.
@ -466,7 +498,6 @@ native rg_get_user_armor(const index, &ArmorType:armortype);
* @param armortype Armor type to set
*
* @noreturn
*
*/
native rg_set_user_armor(const index, armorvalue, ArmorType:armortype);
@ -482,7 +513,6 @@ native rg_set_user_armor(const index, armorvalue, ArmorType:armortype);
* @param send_teaminfo If true, a TeamInfo message will be sent
*
* @return 1 on success, 0 otherwise
*
*/
native rg_set_user_team(const index, {TeamName,_}:team, {ModelName,_}:model = MODEL_AUTO, const bool:send_teaminfo = true);
@ -494,7 +524,6 @@ native rg_set_user_team(const index, {TeamName,_}:team, {ModelName,_}:model = MO
* @param update_index If true, the modelindex is updated as well
*
* @return 1 on success, 0 otherwise
*
*/
native rg_set_user_model(const index, const model[], const bool:update_index = false);
@ -505,7 +534,6 @@ native rg_set_user_model(const index, const model[], const bool:update_index = f
* @param update_index If true, the modelindex is reset as well
*
* @return 1 on success, 0 otherwise
*
*/
native rg_reset_user_model(const index, const bool:update_index = false);
@ -516,7 +544,6 @@ native rg_reset_user_model(const index, const bool:update_index = false);
* @param silent To enable silent footsteps
*
* @return 1 on success, 0 otherwise
*
*/
native rg_set_user_footsteps(const index, bool:silent = false);
@ -526,7 +553,6 @@ native rg_set_user_footsteps(const index, bool:silent = false);
* @param index Client index
*
* @return 1 if the player has silent footsteps, 0 otherwise
*
*/
native rg_get_user_footsteps(const index);
@ -537,7 +563,6 @@ native rg_get_user_footsteps(const index);
* @param receiver Receiver index, if 0 it will transfer to a random player
*
* @return 1 on success, 0 otherwise
*
*/
native rg_transfer_c4(const index, const receiver = 0);
@ -548,7 +573,6 @@ native rg_transfer_c4(const index, const receiver = 0);
* @param weapon Weapon entity-index, if 0 then all weapons will be reloaded
*
* @return 1 on success, 0 otherwise
*
*/
native rg_instant_reload_weapons(const index, const weapon = 0);
@ -559,7 +583,6 @@ native rg_instant_reload_weapons(const index, const weapon = 0);
* @param amount The money amount
*
* @noreturn
*
*/
native rg_set_account_rules(const RewardRules:rules_index, const amount);
@ -577,7 +600,6 @@ native rg_get_account_rules(const RewardRules:rules_index);
* Checks if the bomb is planted.
*
* @return true if the bomb is planted, false otherwise
*
*/
native bool:rg_is_bomb_planted();
@ -588,7 +610,6 @@ native bool:rg_is_bomb_planted();
* @param team Team id
*
* @return 1 on success, 0 otherwise
*
*/
native rg_join_team(const index, const TeamName:team);
@ -596,7 +617,6 @@ native rg_join_team(const index, const TeamName:team);
* Instantly balances the teams.
*
* @noreturn
*
*/
native rg_balance_teams();
@ -604,7 +624,6 @@ native rg_balance_teams();
* Swaps players' teams without reseting frags, deaths and wins.
*
* @noreturn
*
*/
native rg_swap_all_players();
@ -615,7 +634,6 @@ native rg_swap_all_players();
* @param index Client index
*
* @noreturn
*
*/
native rg_switch_team(const index);
@ -626,7 +644,6 @@ native rg_switch_team(const index);
* @param weapon Weapon entity-index
*
* @return 1 on success, 0 otherwise
*
*/
native rg_switch_weapon(const index, const weapon);
@ -634,7 +651,6 @@ native rg_switch_weapon(const index, const weapon);
* Gets which team has a higher join priority.
*
* @return Returns the Team Name
*
*/
native TeamName:rg_get_join_team_priority();
@ -645,7 +661,6 @@ native TeamName:rg_get_join_team_priority();
* @param attacker Attacker index
*
* @return true if he can take damage, false otherwise
*
*/
native bool:rg_is_player_can_takedamage(const index, const attacker);
@ -655,7 +670,6 @@ native bool:rg_is_player_can_takedamage(const index, const attacker);
* @param entity Weaponbox entity
*
* @return return enum of WeaponIdType
*
*/
native WeaponIdType:rg_get_weaponbox_id(const entity);
@ -665,7 +679,6 @@ native WeaponIdType:rg_get_weaponbox_id(const entity);
* @param index Client index
*
* @noreturn
*
*/
native rg_round_respawn(const index);
@ -675,7 +688,6 @@ native rg_round_respawn(const index);
* @param index Client index
*
* @noreturn
*
*/
native rg_reset_maxspeed(const index);
@ -688,7 +700,6 @@ native rg_reset_maxspeed(const index);
* @param observer Send for everyone who is observing the player
*
* @noreturn
*
*/
native rg_send_bartime(const index, const duration, const bool:observer = true);
@ -701,7 +712,6 @@ native rg_send_bartime(const index, const duration, const bool:observer = true);
* @param observer Send for everyone who is observing the player
*
* @noreturn
*
*/
native rg_send_bartime2(const index, const duration, const startPercent, const bool:observer = true);
@ -713,6 +723,5 @@ native rg_send_bartime2(const index, const duration, const startPercent, const b
* @param pitch Sound pitch
*
* @noreturn
*
*/
native rg_send_audio(const index, const sample[], const pitch = PITCH_NORM);

File diff suppressed because it is too large Load Diff

View File

@ -44,7 +44,6 @@ enum ReCheckerFunc
* @param hash Hash of file to request.
*
* @return Returns a hook handle. Use UnRegisterQueryFile to remove the forward
*
*/
native QueryFileHook:RegisterQueryFile(const file[], const function[], const ResourceType:type, const hash = -1);
@ -55,6 +54,5 @@ native QueryFileHook:RegisterQueryFile(const file[], const function[], const Res
* @param hook The hook to remove
*
* @return Returns true if the hook is successfully removed, otherwise false
*
*/
native bool:UnRegisterQueryFile(QueryFileHook:hook);

View File

@ -45,6 +45,5 @@ native client_auth_type:REU_GetAuthtype(const index);
* @param index Client index
*
* @return 1/0
*
*/
native bool:REU_IsRevemuWithoutAdminRights(const index);

View File

@ -9,7 +9,6 @@
* @param index Client index
*
* @return true if client is speaking, false otherwise
*
*/
native bool:VTC_IsClientSpeaking(const index);
@ -37,7 +36,6 @@ native VTC_UnmuteClient(const index);
* @param index Client index
*
* @return true if client is muted, false otherwise
*
*/
native bool:VTC_IsClientMuted(const index);
@ -51,7 +49,6 @@ native bool:VTC_IsClientMuted(const index);
* VTC_PlaySound(id, "sound/ambience/Opera.wav");
*
* @noreturn
*
*/
native VTC_PlaySound(const receiver, const soundFilePath[]);

View File

@ -363,28 +363,28 @@ public:
CCSPlayer *CSPlayer() const;
// templates
template<typename Functor>
CBasePlayerItem *ForEachItem(int slot, const Functor &func)
template<typename T = CBasePlayerItem, typename Functor>
T *ForEachItem(int slot, const Functor &func)
{
auto item = m_rgpPlayerItems[ slot ];
while (item)
{
if (func(item))
return item;
if (func(static_cast<T *>(item)))
return static_cast<T *>(item);
item = item->m_pNext;
}
return nullptr;
}
template<typename Functor>
CBasePlayerItem *ForEachItem(const Functor &func)
template<typename T = CBasePlayerItem, typename Functor>
T *ForEachItem(const Functor &func)
{
for (auto item : m_rgpPlayerItems)
{
while (item)
{
if (func(item))
return item;
if (func(static_cast<T *>(item)))
return static_cast<T *>(item);
item = item->m_pNext;
}

View File

@ -36,7 +36,7 @@
#include "items.h"
#define REGAMEDLL_API_VERSION_MAJOR 5
#define REGAMEDLL_API_VERSION_MINOR 0
#define REGAMEDLL_API_VERSION_MINOR 3
// CBasePlayer::Spawn hook
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_Spawn;
@ -87,8 +87,8 @@ typedef IHookChainClass<BOOL, class CBasePlayer, class CBasePlayerItem *> IReGam
typedef IHookChainRegistryClass<BOOL, class CBasePlayer, class CBasePlayerItem *> IReGameHookRegistry_CBasePlayer_RemovePlayerItem;
// CBasePlayer::GiveAmmo hook
typedef IHookChainClass<int, class CBasePlayer, int , char *, int> IReGameHook_CBasePlayer_GiveAmmo;
typedef IHookChainRegistryClass<int, class CBasePlayer, int , char *, int> IReGameHookRegistry_CBasePlayer_GiveAmmo;
typedef IHookChainClass<int, class CBasePlayer, int , const char *, int> IReGameHook_CBasePlayer_GiveAmmo;
typedef IHookChainRegistryClass<int, class CBasePlayer, int , const char *, int> IReGameHookRegistry_CBasePlayer_GiveAmmo;
// CBasePlayer::ResetMaxSpeed hook
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_ResetMaxSpeed;
@ -354,6 +354,14 @@ typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_BalanceTeams;
typedef IVoidHookChain<> IReGameHook_CSGameRules_OnRoundFreezeEnd;
typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_OnRoundFreezeEnd;
// PM_UpdateStepSound hook
typedef IVoidHookChain<> IReGameHook_PM_UpdateStepSound;
typedef IVoidHookChainRegistry<> IReGameHookRegistry_PM_UpdateStepSound;
// CBasePlayer::StartDeathCam hook
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_StartDeathCam;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_StartDeathCam;
class IReGameHookchains {
public:
virtual ~IReGameHookchains() {}
@ -442,6 +450,8 @@ public:
virtual IReGameHookRegistry_CSGameRules_GoToIntermission* CSGameRules_GoToIntermission() = 0;
virtual IReGameHookRegistry_CSGameRules_BalanceTeams* CSGameRules_BalanceTeams() = 0;
virtual IReGameHookRegistry_CSGameRules_OnRoundFreezeEnd* CSGameRules_OnRoundFreezeEnd() = 0;
virtual IReGameHookRegistry_PM_UpdateStepSound* PM_UpdateStepSound() = 0;
virtual IReGameHookRegistry_CBasePlayer_StartDeathCam* CBasePlayer_StartDeathCam() = 0;
};
struct ReGameFuncs_t {

View File

@ -331,12 +331,9 @@ public:
virtual void WeaponIdle() = 0;
virtual BOOL UseDecrement() = 0;
virtual BOOL IsPistol() = 0;
public:
int m_iShell;
unsigned short GetEventID() const { return m_usFireUSP; }
private:
unsigned short m_usFireUSP;
unsigned short m_usFire;
};
class CMP5N: public CBasePlayerWeapon {
@ -353,10 +350,8 @@ public:
virtual BOOL UseDecrement() = 0;
public:
int m_iShell;
int iShellOn;
unsigned short GetEventID() const { return m_usFireMP5N; }
private:
unsigned short m_usFireMP5N;
int m_iShellOn;
unsigned short m_usFire;
};
class CSG552: public CBasePlayerWeapon {
@ -374,10 +369,8 @@ public:
virtual BOOL UseDecrement() = 0;
public:
int m_iShell;
int iShellOn;
unsigned short GetEventID() const { return m_usFireSG552; }
private:
unsigned short m_usFireSG552;
int m_iShellOn;
unsigned short m_usFire;
};
class CAK47: public CBasePlayerWeapon {
@ -395,10 +388,8 @@ public:
virtual BOOL UseDecrement() = 0;
public:
int m_iShell;
int iShellOn;
unsigned short GetEventID() const { return m_usFireAK47; }
private:
unsigned short m_usFireAK47;
int m_iShellOn;
unsigned short m_usFire;
};
class CAUG: public CBasePlayerWeapon {
@ -416,10 +407,8 @@ public:
virtual BOOL UseDecrement() = 0;
public:
int m_iShell;
int iShellOn;
unsigned short GetEventID() const { return m_usFireAug; }
private:
unsigned short m_usFireAug;
int m_iShellOn;
unsigned short m_usFire;
};
class CAWP: public CBasePlayerWeapon {
@ -437,9 +426,7 @@ public:
virtual BOOL UseDecrement() = 0;
public:
int m_iShell;
unsigned short GetEventID() const { return m_usFireAWP; }
private:
unsigned short m_usFireAWP;
unsigned short m_usFire;
};
// for usermsg BombDrop
@ -464,8 +451,6 @@ public:
bool m_bStartedArming;
bool m_bBombPlacedAnimation;
float m_fArmedTime;
bool HasShield() const { return m_bHasShield; }
private:
bool m_bHasShield;
};
@ -485,9 +470,7 @@ public:
virtual BOOL IsPistol() = 0;
public:
int m_iShell;
unsigned short GetEventID() const { return m_usFireDeagle; }
private:
unsigned short m_usFireDeagle;
unsigned short m_usFire;
};
class CFlashbang: public CBasePlayerWeapon {
@ -523,9 +506,7 @@ public:
virtual BOOL UseDecrement() = 0;
public:
int m_iShell;
unsigned short GetEventID() const { return m_usFireG3SG1; }
private:
unsigned short m_usFireG3SG1;
unsigned short m_usFire;
};
class CGLOCK18: public CBasePlayerWeapon {
@ -563,7 +544,7 @@ public:
virtual void WeaponIdle() = 0;
virtual BOOL UseDecrement() = 0;
public:
unsigned short m_usCreateExplosion;
unsigned short m_usCreate;
};
class CKnife: public CBasePlayerWeapon {
@ -599,10 +580,8 @@ public:
virtual BOOL UseDecrement() = 0;
public:
int m_iShell;
int iShellOn;
unsigned short GetEventID() const { return m_usFireM249; }
private:
unsigned short m_usFireM249;
int m_iShellOn;
unsigned short m_usFire;
};
class CM3: public CBasePlayerWeapon {
@ -620,9 +599,7 @@ public:
public:
int m_iShell;
float m_flPumpTime;
unsigned short GetEventID() const { return m_usFireM3; }
private:
unsigned short m_usFireM3;
unsigned short m_usFire;
};
class CM4A1: public CBasePlayerWeapon {
@ -640,10 +617,8 @@ public:
virtual BOOL UseDecrement() = 0;
public:
int m_iShell;
int iShellOn;
unsigned short GetEventID() const { return m_usFireM4A1; }
private:
unsigned short m_usFireM4A1;
int m_iShellOn;
unsigned short m_usFire;
};
class CMAC10: public CBasePlayerWeapon {
@ -660,10 +635,8 @@ public:
virtual BOOL UseDecrement() = 0;
public:
int m_iShell;
int iShellOn;
unsigned short GetEventID() const { return m_usFireMAC10; }
private:
unsigned short m_usFireMAC10;
int m_iShellOn;
unsigned short m_usFire;
};
class CP228: public CBasePlayerWeapon {
@ -682,9 +655,7 @@ public:
virtual BOOL IsPistol() = 0;
public:
int m_iShell;
unsigned short GetEventID() const { return m_usFireP228; }
private:
unsigned short m_usFireP228;
unsigned short m_usFire;
};
class CP90: public CBasePlayerWeapon {
@ -701,10 +672,8 @@ public:
virtual BOOL UseDecrement() = 0;
public:
int m_iShell;
int iShellOn;
unsigned short GetEventID() const { return m_usFireP90; }
private:
unsigned short m_usFireP90;
int m_iShellOn;
unsigned short m_usFire;
};
class CSCOUT: public CBasePlayerWeapon {
@ -722,9 +691,7 @@ public:
virtual BOOL UseDecrement() = 0;
public:
int m_iShell;
unsigned short GetEventID() const { return m_usFireScout; }
private:
unsigned short m_usFireScout;
unsigned short m_usFire;
};
class CSmokeGrenade: public CBasePlayerWeapon {
@ -743,7 +710,7 @@ public:
virtual void WeaponIdle() = 0;
virtual BOOL UseDecrement() = 0;
public:
unsigned short m_usCreateSmoke;
unsigned short m_usCreate;
};
class CTMP: public CBasePlayerWeapon {
@ -760,10 +727,8 @@ public:
virtual BOOL UseDecrement() = 0;
public:
int m_iShell;
int iShellOn;
unsigned short GetEventID() const { return m_usFireTMP; }
private:
unsigned short m_usFireTMP;
int m_iShellOn;
unsigned short m_usFire;
};
class CXM1014: public CBasePlayerWeapon {
@ -781,9 +746,7 @@ public:
public:
int m_iShell;
float m_flPumpTime;
unsigned short GetEventID() const { return m_usFireXM1014; }
private:
unsigned short m_usFireXM1014;
unsigned short m_usFire;
};
class CELITE: public CBasePlayerWeapon {
@ -801,11 +764,8 @@ public:
virtual BOOL IsPistol() = 0;
public:
int m_iShell;
unsigned short GetEventID_Left() const { return m_usFireELITE_LEFT; }
unsigned short GetEventID_Right() const { return m_usFireELITE_RIGHT; }
private:
unsigned short m_usFireELITE_LEFT;
unsigned short m_usFireELITE_RIGHT;
unsigned short m_usFire_LEFT;
unsigned short m_usFire_RIGHT;
};
class CFiveSeven: public CBasePlayerWeapon {
@ -824,9 +784,7 @@ public:
virtual BOOL IsPistol() = 0;
public:
int m_iShell;
unsigned short GetEventID() const { return m_usFireFiveSeven; }
private:
unsigned short m_usFireFiveSeven;
unsigned short m_usFire;
};
class CUMP45: public CBasePlayerWeapon {
@ -843,10 +801,8 @@ public:
virtual BOOL UseDecrement() = 0;
public:
int m_iShell;
int iShellOn;
unsigned short GetEventID() const { return m_usFireUMP45; }
private:
unsigned short m_usFireUMP45;
int m_iShellOn;
unsigned short m_usFire;
};
class CSG550: public CBasePlayerWeapon {
@ -864,9 +820,7 @@ public:
virtual BOOL UseDecrement() = 0;
public:
int m_iShell;
unsigned short GetEventID() const { return m_usFireSG550; }
private:
unsigned short m_usFireSG550;
unsigned short m_usFire;
};
class CGalil: public CBasePlayerWeapon {
@ -884,10 +838,8 @@ public:
virtual BOOL UseDecrement() = 0;
public:
int m_iShell;
int iShellOn;
unsigned short GetEventID() const { return m_usFireGalil; }
private:
unsigned short m_usFireGalil;
int m_iShellOn;
unsigned short m_usFire;
};
class CFamas: public CBasePlayerWeapon {
@ -905,5 +857,5 @@ public:
virtual BOOL UseDecrement() = 0;
public:
int m_iShell;
int iShellOn;
int m_iShellOn;
};

View File

@ -188,9 +188,9 @@ BOOL CBasePlayer_RemovePlayerItem(IReGameHook_CBasePlayer_RemovePlayerItem *chai
return callForward<BOOL>(RG_CBasePlayer_RemovePlayerItem, original, indexOfEdict(pthis->pev), indexOfEdict(pItem->pev));
}
int CBasePlayer_GiveAmmo(IReGameHook_CBasePlayer_GiveAmmo *chain, CBasePlayer *pthis, int iAmount, char *szName, int iMax)
int CBasePlayer_GiveAmmo(IReGameHook_CBasePlayer_GiveAmmo *chain, CBasePlayer *pthis, int iAmount, const char *szName, int iMax)
{
auto original = [chain](int _pthis, int _iAmount, char *_szName, int _iMax)
auto original = [chain](int _pthis, int _iAmount, const char *_szName, int _iMax)
{
return chain->callNext(getPrivate<CBasePlayer>(_pthis), _iAmount, _szName, _iMax);
};
@ -470,6 +470,16 @@ bool CBasePlayer_GetIntoGame(IReGameHook_CBasePlayer_GetIntoGame *chain, CBasePl
return callForward<bool>(RG_CBasePlayer_GetIntoGame, original, indexOfEdict(pthis->pev));
}
void CBasePlayer_StartDeathCam(IReGameHook_CBasePlayer_StartDeathCam *chain, CBasePlayer *pthis)
{
auto original = [chain](int _pthis)
{
return chain->callNext(getPrivate<CBasePlayer>(_pthis));
};
callVoidForward(RG_CBasePlayer_StartDeathCam, original, indexOfEdict(pthis->pev));
}
void CBaseAnimating_ResetSequenceInfo(IReGameHook_CBaseAnimating_ResetSequenceInfo *chain, CBaseAnimating *pthis)
{
auto original = [chain](int _pthis)

View File

@ -339,7 +339,7 @@ void CBasePlayer_AddPoints(IReGameHook_CBasePlayer_AddPoints *chain, CBasePlayer
void CBasePlayer_AddPointsToTeam(IReGameHook_CBasePlayer_AddPointsToTeam *chain, CBasePlayer *pthis, int score, BOOL bAllowNegativeScore);
BOOL CBasePlayer_AddPlayerItem(IReGameHook_CBasePlayer_AddPlayerItem *chain, CBasePlayer *pthis, CBasePlayerItem *pItem);
BOOL CBasePlayer_RemovePlayerItem(IReGameHook_CBasePlayer_RemovePlayerItem *chain, CBasePlayer *pthis, CBasePlayerItem *pItem);
int CBasePlayer_GiveAmmo(IReGameHook_CBasePlayer_GiveAmmo *chain, CBasePlayer *pthis, int iAmount, char *szName, int iMax);
int CBasePlayer_GiveAmmo(IReGameHook_CBasePlayer_GiveAmmo *chain, CBasePlayer *pthis, int iAmount, const char *szName, int iMax);
void CBasePlayer_ResetMaxSpeed(IReGameHook_CBasePlayer_ResetMaxSpeed *chain, CBasePlayer *pthis);
void CBasePlayer_Jump(IReGameHook_CBasePlayer_Jump *chain, CBasePlayer *pthis);
void CBasePlayer_Duck(IReGameHook_CBasePlayer_Duck *chain, CBasePlayer *pthis);
@ -368,6 +368,7 @@ void CBasePlayer_MakeVIP(IReGameHook_CBasePlayer_MakeVIP *chain, CBasePlayer *pt
bool CBasePlayer_MakeBomber(IReGameHook_CBasePlayer_MakeBomber *chain, CBasePlayer *pthis);
void CBasePlayer_StartObserver(IReGameHook_CBasePlayer_StartObserver *chain, CBasePlayer *pthis, Vector &vecPosition, Vector &vecViewAngle);
bool CBasePlayer_GetIntoGame(IReGameHook_CBasePlayer_GetIntoGame *chain, CBasePlayer *pthis);
void CBasePlayer_StartDeathCam(IReGameHook_CBasePlayer_StartDeathCam *chain, CBasePlayer *pthis);
void CBaseAnimating_ResetSequenceInfo(IReGameHook_CBaseAnimating_ResetSequenceInfo *chain, CBaseAnimating *pthis);

View File

@ -1,25 +1,25 @@
#include "precompiled.h"
inline size_t getFwdParamType(void(*)(int)) { return FP_CELL; }
inline size_t getFwdParamType(void(*)(size_t)) { return FP_CELL; }
inline size_t getFwdParamType(void(*)(short)) { return FP_CELL; }
inline size_t getFwdParamType(void(*)(bool)) { return FP_CELL; }
inline size_t getFwdParamType(void(*)(Vector&)) { return FP_ARRAY; }
inline size_t getFwdParamType(void(*)(PLAYER_ANIM)) { return FP_CELL; }
inline size_t getFwdParamType(void(*)(WeaponIdType)) { return FP_CELL; }
inline size_t getFwdParamType(void(*)(RewardType)) { return FP_CELL; }
inline size_t getFwdParamType(void(*)(ScenarioEventEndRound)) { return FP_CELL; }
inline size_t getFwdParamType(void(*)(ItemID)) { return FP_CELL; }
inline size_t getFwdParamType(void(*)(ItemRestType)) { return FP_CELL; }
inline size_t getFwdParamType(void(*)(ResourceType_e)) { return FP_CELL; }
inline size_t getFwdParamType(void(*)(float)) { return FP_FLOAT; }
inline size_t getFwdParamType(void(*)(float&)) { return FP_FLOAT; }
inline size_t getFwdParamType(void(*)(const char *)) { return FP_STRING; }
inline size_t getFwdParamType(void(*)(char *)) { return FP_STRING; }
inline size_t getFwdParamType(void(*)(IResourceBuffer*)) { return FP_CELL; }
inline size_t getFwdParamType(void(*)(int)) { return FP_CELL; }
inline size_t getFwdParamType(void(*)(size_t)) { return FP_CELL; }
inline size_t getFwdParamType(void(*)(short)) { return FP_CELL; }
inline size_t getFwdParamType(void(*)(bool)) { return FP_CELL; }
inline size_t getFwdParamType(void(*)(Vector&)) { return FP_ARRAY; }
inline size_t getFwdParamType(void(*)(PLAYER_ANIM)) { return FP_CELL; }
inline size_t getFwdParamType(void(*)(WeaponIdType)) { return FP_CELL; }
inline size_t getFwdParamType(void(*)(RewardType)) { return FP_CELL; }
inline size_t getFwdParamType(void(*)(ScenarioEventEndRound)) { return FP_CELL; }
inline size_t getFwdParamType(void(*)(ItemID)) { return FP_CELL; }
inline size_t getFwdParamType(void(*)(ItemRestType)) { return FP_CELL; }
inline size_t getFwdParamType(void(*)(ResourceType_e)) { return FP_CELL; }
inline size_t getFwdParamType(void(*)(float)) { return FP_FLOAT; }
inline size_t getFwdParamType(void(*)(float&)) { return FP_FLOAT; }
inline size_t getFwdParamType(void(*)(const char *)) { return FP_STRING; }
inline size_t getFwdParamType(void(*)(char *)) { return FP_STRING; }
inline size_t getFwdParamType(void(*)(IResourceBuffer*)) { return FP_CELL; }
template<typename T>
inline size_t getFwdParamType(void(*)(T *)) { return FP_CELL; }
inline size_t getFwdParamType(void(*)(T *)) { return FP_CELL; }
template<size_t current = 0>
void setupParamTypes(size_t param_types[], void (*)())
@ -140,6 +140,7 @@ hook_t hooklist_player[] = {
DLL(CBasePlayer_MakeBomber),
DLL(CBasePlayer_StartObserver),
DLL(CBasePlayer_GetIntoGame),
DLL(CBasePlayer_StartDeathCam),
};
hook_t hooklist_gamerules[] = {

View File

@ -157,6 +157,7 @@ enum GamedllFunc_CBasePlayer
RG_CBasePlayer_MakeBomber,
RG_CBasePlayer_StartObserver,
RG_CBasePlayer_GetIntoGame,
RG_CBasePlayer_StartDeathCam,
// [...]
};

View File

@ -14,73 +14,108 @@
#define CLASS_MEMBERS(cx, mx, postf, pref) ((!(postf & (MAX_REGION_RANGE - 1)) ? regmember::current_cell = 1, true : false) || (postf & (MAX_REGION_RANGE - 1)) == regmember::current_cell++) ? regmember([](member_t* ptr){ decltypefx(cx, pref, ., mx) f = {};ptr->size = getTypeSize(f);ptr->max_size = sizeof(f);ptr->offset = offsetof(##cx, ##pref##mx);ptr->type = getMemberType(f);ptr->name = #postf;}) : regmember(#pref#mx)
#define GM_MEMBERS(mx) CLASS_MEMBERS(CHalfLifeMultiplay, mx, mx,)
#define GM_VOICE_MEMBERS(mx) CLASS_MEMBERS(CHalfLifeMultiplay, mx, mx, m_VoiceGameMgr.)
#define BASE_MEMBERS(mx) CLASS_MEMBERS(CBaseEntity, mx, mx,)
#define ANIM_MEMBERS(mx) CLASS_MEMBERS(CBaseAnimating, mx, mx,)
#define MONST_MEMBERS(mx) CLASS_MEMBERS(CBaseMonster, mx, mx,)
#define PL_MEMBERS(mx) CLASS_MEMBERS(CBasePlayer, mx, mx,)
#define EVAR_MEMBERS(mx) CLASS_MEMBERS(com_entvars, mx, var_##mx,)
#define PMOVE_MEMBERS(mx) CLASS_MEMBERS(com_playermove, mx, pm_##mx,)
#define MOVEVAR_MEMBERS(mx) CLASS_MEMBERS(movevars_t, mx, mv_##mx,)
#define UCMD_MEMBERS(mx) CLASS_MEMBERS(usercmd_s, mx, ucmd_##mx,)
#define PMTRACE_MEMBERS(mx) CLASS_MEMBERS(pmtrace_s, mx, pmt_##mx,)
#define CSPL_MEMBERS(mx) CLASS_MEMBERS(CCSPlayer, mx, mx,)
#define BASEITEM_MEMBERS(mx) CLASS_MEMBERS(CBasePlayerItem, mx, mx,)
#define BASEWPN_MEMBERS(mx) CLASS_MEMBERS(CBasePlayerWeapon, mx, m_Weapon_##mx, m_)
#define WPNBOX_MEMBERS(mx) CLASS_MEMBERS(CWeaponBox, mx, m_WeaponBox_##mx, m_)
#define ARMOURY_MEMBERS(mx) CLASS_MEMBERS(CArmoury, mx, m_Armoury_##mx, m_)
#define GM_MEMBERS(mx) CLASS_MEMBERS(CHalfLifeMultiplay, mx, mx,)
#define GM_VOICE_MEMBERS(mx) CLASS_MEMBERS(CHalfLifeMultiplay, mx, mx, m_VoiceGameMgr.)
#define BASE_MEMBERS(mx) CLASS_MEMBERS(CBaseEntity, mx, mx,)
#define ANIM_MEMBERS(mx) CLASS_MEMBERS(CBaseAnimating, mx, mx,)
#define MONST_MEMBERS(mx) CLASS_MEMBERS(CBaseMonster, mx, mx,)
#define PL_MEMBERS(mx) CLASS_MEMBERS(CBasePlayer, mx, mx,)
#define EVAR_MEMBERS(mx) CLASS_MEMBERS(com_entvars, mx, var_##mx,)
#define PMOVE_MEMBERS(mx) CLASS_MEMBERS(com_playermove, mx, pm_##mx,)
#define MOVEVAR_MEMBERS(mx) CLASS_MEMBERS(movevars_t, mx, mv_##mx,)
#define UCMD_MEMBERS(mx) CLASS_MEMBERS(usercmd_s, mx, ucmd_##mx,)
#define PMTRACE_MEMBERS(mx) CLASS_MEMBERS(pmtrace_s, mx, pmt_##mx,)
#define CSPL_MEMBERS(mx) CLASS_MEMBERS(CCSPlayer, mx, mx,)
#define BASEITEM_MEMBERS(mx) CLASS_MEMBERS(CBasePlayerItem, mx, mx,)
#define BASEWPN_MEMBERS(mx) CLASS_MEMBERS(CBasePlayerWeapon, mx, m_Weapon_##mx, m_)
#define WPNBOX_MEMBERS(mx) CLASS_MEMBERS(CWeaponBox, mx, m_WeaponBox_##mx, m_)
#define ARMOURY_MEMBERS(mx) CLASS_MEMBERS(CArmoury, mx, m_Armoury_##mx, m_)
#define GRENADE_MEMBERS(mx) CLASS_MEMBERS(CGrenade, mx, m_Grenade_##mx, m_)
#define P228_MEMBERS(mx) CLASS_MEMBERS(CP228, mx, m_P228_##mx, m_)
#define SCOUT_MEMBERS(mx) CLASS_MEMBERS(CSCOUT, mx, m_SCOUT_##mx, m_)
#define HEGREN_MEMBERS(mx) CLASS_MEMBERS(CHEGrenade, mx, m_HEGrenade_##mx, m_)
#define XM1014_MEMBERS(mx) CLASS_MEMBERS(CXM1014, mx, m_XM1014_##mx, m_)
#define C4_MEMBERS(mx) CLASS_MEMBERS(CC4, mx, m_C4_##mx, m_)
#define MAC10_MEMBERS(mx) CLASS_MEMBERS(CMAC10, mx, m_MAC10_##mx, m_)
#define AUG_MEMBERS(mx) CLASS_MEMBERS(CAUG, mx, m_AUG_##mx, m_)
#define SMOKEGREN_MEMBERS(mx) CLASS_MEMBERS(CSmokeGrenade, mx, m_SmokeGrenade_##mx, m_)
#define ELITE_MEMBERS(mx) CLASS_MEMBERS(CELITE, mx, m_ELITE_##mx, m_)
#define FIVESEVEN_MEMBERS(mx) CLASS_MEMBERS(CFiveSeven, mx, m_FiveSeven_##mx, m_)
#define UMP45_MEMBERS(mx) CLASS_MEMBERS(CUMP45, mx, m_UMP45_##mx, m_)
#define SG550_MEMBERS(mx) CLASS_MEMBERS(CSG550, mx, m_SG550_##mx, m_)
#define GALIL_MEMBERS(mx) CLASS_MEMBERS(CGalil, mx, m_Galil_##mx, m_)
#define FAMAS_MEMBERS(mx) CLASS_MEMBERS(CFamas, mx, m_Famas_##mx, m_)
#define USP_MEMBERS(mx) CLASS_MEMBERS(CUSP, mx, m_USP_##mx, m_)
#define GLOCK18_MEMBERS(mx) CLASS_MEMBERS(CGLOCK18, mx, m_GLOCK18_##mx, m_)
#define AWP_MEMBERS(mx) CLASS_MEMBERS(CAWP, mx, m_AWP_##mx, m_)
#define MP5N_MEMBERS(mx) CLASS_MEMBERS(CMP5N, mx, m_MP5N_##mx, m_)
#define M249_MEMBERS(mx) CLASS_MEMBERS(CM249, mx, m_M249_##mx, m_)
#define M3_MEMBERS(mx) CLASS_MEMBERS(CM3, mx, m_M3_##mx, m_)
#define M4A1_MEMBERS(mx) CLASS_MEMBERS(CM4A1, mx, m_M4A1_##mx, m_)
#define TMP_MEMBERS(mx) CLASS_MEMBERS(CTMP, mx, m_TMP_##mx, m_)
#define G3SG1_MEMBERS(mx) CLASS_MEMBERS(CG3SG1, mx, m_G3SG1_##mx, m_)
#define DEAGLE_MEMBERS(mx) CLASS_MEMBERS(CDEAGLE, mx, m_DEAGLE_##mx, m_)
#define SG552_MEMBERS(mx) CLASS_MEMBERS(CSG552, mx, m_SG552_##mx, m_)
#define AK47_MEMBERS(mx) CLASS_MEMBERS(CAK47, mx, m_AK47_##mx, m_)
#define KNIFE_MEMBERS(mx) CLASS_MEMBERS(CKnife, mx, m_Knife_##mx, m_)
#define P90_MEMBERS(mx) CLASS_MEMBERS(CP90, mx, m_P90_##mx, m_)
#define SHIELD_MEMBERS(mx) CLASS_MEMBERS(CWShield, mx, m_Shield_##mx, m_)
#define REBUYSTRUCT_MEMBERS(mx) CLASS_MEMBERS(RebuyStruct, mx, mx,)
#define MAPINFO_MEMBERS(mx) CLASS_MEMBERS(CMapInfo, mx, m_MapInfo_##mx, m_)
inline MType getMemberType(float*) { return MEMBER_FLOAT; }
inline MType getMemberType(float) { return MEMBER_FLOAT; }
inline MType getMemberType(float*) { return MEMBER_FLOAT; }
inline MType getMemberType(float) { return MEMBER_FLOAT; }
inline MType getMemberType(double) { return MEMBER_DOUBLE; }
inline MType getMemberType(double) { return MEMBER_DOUBLE; }
inline MType getMemberType(CBasePlayer**) { return MEMBER_CLASSPTR; }
inline MType getMemberType(CBasePlayer*) { return MEMBER_CLASSPTR; }
inline MType getMemberType(CBasePlayerItem**) { return MEMBER_CLASSPTR; }
inline MType getMemberType(CBasePlayerItem*) { return MEMBER_CLASSPTR; }
inline MType getMemberType(CBaseEntity*) { return MEMBER_CLASSPTR; }
inline MType getMemberType(CBasePlayer**) { return MEMBER_CLASSPTR; }
inline MType getMemberType(CBasePlayer*) { return MEMBER_CLASSPTR; }
inline MType getMemberType(CBasePlayerItem**) { return MEMBER_CLASSPTR; }
inline MType getMemberType(CBasePlayerItem*) { return MEMBER_CLASSPTR; }
inline MType getMemberType(CBaseEntity*) { return MEMBER_CLASSPTR; }
inline MType getMemberType(EHANDLE) { return MEMBER_EHANDLE; }
inline MType getMemberType(entvars_t*) { return MEMBER_EVARS; }
inline MType getMemberType(edict_t*) { return MEMBER_EDICT; }
inline MType getMemberType(EHANDLE) { return MEMBER_EHANDLE; }
inline MType getMemberType(entvars_t*) { return MEMBER_EVARS; }
inline MType getMemberType(edict_t*) { return MEMBER_EDICT; }
inline MType getMemberType(Vector*) { return MEMBER_VECTOR; }
inline MType getMemberType(Vector) { return MEMBER_VECTOR; }
inline MType getMemberType(Vector*) { return MEMBER_VECTOR; }
inline MType getMemberType(Vector) { return MEMBER_VECTOR; }
inline MType getMemberType(char*) { return MEMBER_STRING; }
inline MType getMemberType(string_t) { return MEMBER_QSTRING; }
inline MType getMemberType(string_t*) { return MEMBER_QSTRING; }
inline MType getMemberType(qstring_t) { return MEMBER_QSTRING; }
inline MType getMemberType(qstring_t*) { return MEMBER_QSTRING; }
inline MType getMemberType(char*) { return MEMBER_STRING; }
inline MType getMemberType(string_t) { return MEMBER_QSTRING; }
inline MType getMemberType(string_t*) { return MEMBER_QSTRING; }
inline MType getMemberType(qstring_t) { return MEMBER_QSTRING; }
inline MType getMemberType(qstring_t*) { return MEMBER_QSTRING; }
inline MType getMemberType(char) { return MEMBER_BYTE; }
inline MType getMemberType(byte) { return MEMBER_BYTE; }
inline MType getMemberType(byte*) { return MEMBER_BYTE; }
inline MType getMemberType(char) { return MEMBER_BYTE; }
inline MType getMemberType(byte) { return MEMBER_BYTE; }
inline MType getMemberType(byte*) { return MEMBER_BYTE; }
inline MType getMemberType(int*) { return MEMBER_INTEGER; }
inline MType getMemberType(int) { return MEMBER_INTEGER; }
inline MType getMemberType(unsigned) { return MEMBER_INTEGER; }
inline MType getMemberType(TeamName) { return MEMBER_INTEGER; }
inline MType getMemberType(JoinState) { return MEMBER_INTEGER; }
inline MType getMemberType(ModelName) { return MEMBER_INTEGER; }
inline MType getMemberType(_Menu) { return MEMBER_INTEGER; }
inline MType getMemberType(MusicState) { return MEMBER_INTEGER; }
inline MType getMemberType(Activity) { return MEMBER_INTEGER; }
inline MType getMemberType(MONSTERSTATE) { return MEMBER_INTEGER; }
inline MType getMemberType(ArmorType) { return MEMBER_INTEGER; }
inline MType getMemberType(ArmouryItemPack) { return MEMBER_INTEGER; }
inline MType getMemberType(int*) { return MEMBER_INTEGER; }
inline MType getMemberType(int) { return MEMBER_INTEGER; }
inline MType getMemberType(unsigned) { return MEMBER_INTEGER; }
inline MType getMemberType(TeamName) { return MEMBER_INTEGER; }
inline MType getMemberType(JoinState) { return MEMBER_INTEGER; }
inline MType getMemberType(ModelName) { return MEMBER_INTEGER; }
inline MType getMemberType(_Menu) { return MEMBER_INTEGER; }
inline MType getMemberType(MusicState) { return MEMBER_INTEGER; }
inline MType getMemberType(Activity) { return MEMBER_INTEGER; }
inline MType getMemberType(MONSTERSTATE) { return MEMBER_INTEGER; }
inline MType getMemberType(ArmorType) { return MEMBER_INTEGER; }
inline MType getMemberType(ArmouryItemPack) { return MEMBER_INTEGER; }
inline MType getMemberType(InfoMapBuyParam) { return MEMBER_INTEGER; }
inline MType getMemberType(short) { return MEMBER_SHORT; }
inline MType getMemberType(unsigned short) { return MEMBER_SHORT; }
inline MType getMemberType(TraceResult) { return MEMBER_TRACERESULT; }
inline MType getMemberType(bool) { return MEMBER_BOOL; }
inline MType getMemberType(CUnifiedSignals) { return MEMBER_SIGNALS; }
inline MType getMemberType(RebuyStruct) { return MEBMER_REBUYSTRUCT; }
inline MType getMemberType(short) { return MEMBER_SHORT; }
inline MType getMemberType(unsigned short) { return MEMBER_SHORT; }
inline MType getMemberType(pmtrace_t) { return MEMBER_PMTRACE; }
inline MType getMemberType(usercmd_s) { return MEBMER_USERCMD; }
inline MType getMemberType(bool) { return MEMBER_BOOL; }
inline MType getMemberType(CUnifiedSignals) { return MEMBER_SIGNALS; }
inline MType getMemberType(RebuyStruct) { return MEBMER_REBUYSTRUCT; }
inline MType getMemberType(pmtrace_t) { return MEMBER_PMTRACE; }
inline MType getMemberType(usercmd_s) { return MEBMER_USERCMD; }
template<typename T>
inline MType getMemberType(T) { static_assert(false, "Not implemented overload"); }
@ -748,6 +783,210 @@ member_t memberlist_armoury[] = {
ARMOURY_MEMBERS(bAlreadyCounted),
};
member_t memberlist_grenade[] = {
GRENADE_MEMBERS(bStartDefuse),
GRENADE_MEMBERS(bIsC4),
GRENADE_MEMBERS(pBombDefuser),
GRENADE_MEMBERS(flDefuseCountDown),
GRENADE_MEMBERS(flC4Blow),
GRENADE_MEMBERS(flNextFreqInterval),
GRENADE_MEMBERS(flNextBeep),
GRENADE_MEMBERS(flNextFreq),
GRENADE_MEMBERS(sBeepName),
GRENADE_MEMBERS(fAttenu),
GRENADE_MEMBERS(flNextBlink),
GRENADE_MEMBERS(fNextDefuse),
GRENADE_MEMBERS(bJustBlew),
GRENADE_MEMBERS(iTeam),
GRENADE_MEMBERS(iCurWave),
GRENADE_MEMBERS(pentCurBombTarget),
GRENADE_MEMBERS(SGSmoke),
GRENADE_MEMBERS(angle),
GRENADE_MEMBERS(usEvent),
GRENADE_MEMBERS(bLightSmoke),
GRENADE_MEMBERS(bDetonated),
GRENADE_MEMBERS(vSmokeDetonate),
GRENADE_MEMBERS(iBounceCount),
GRENADE_MEMBERS(fRegisteredSound),
};
member_t memberlist_p228[] = {
P228_MEMBERS(iShell),
P228_MEMBERS(usFire),
};
member_t memberlist_scout[] = {
SCOUT_MEMBERS(iShell),
SCOUT_MEMBERS(usFire),
};
member_t memberlist_hegrenade[] = {
HEGREN_MEMBERS(usCreate),
};
member_t memberlist_xm1014[] = {
XM1014_MEMBERS(iShell),
XM1014_MEMBERS(flPumpTime),
XM1014_MEMBERS(usFire),
};
member_t memberlist_c4[] = {
C4_MEMBERS(bStartedArming),
C4_MEMBERS(bBombPlacedAnimation),
C4_MEMBERS(fArmedTime),
C4_MEMBERS(bHasShield),
};
member_t memberlist_mac10[] = {
MAC10_MEMBERS(iShell),
MAC10_MEMBERS(iShellOn),
MAC10_MEMBERS(usFire),
};
member_t memberlist_aug[] = {
AUG_MEMBERS(iShell),
AUG_MEMBERS(iShellOn),
AUG_MEMBERS(usFire),
};
member_t memberlist_smokegrenade[] = {
SMOKEGREN_MEMBERS(usCreate),
};
member_t memberlist_elite[] = {
ELITE_MEMBERS(iShell),
ELITE_MEMBERS(usFire_LEFT),
ELITE_MEMBERS(usFire_RIGHT),
};
member_t memberlist_fiveseven[] = {
FIVESEVEN_MEMBERS(iShell),
FIVESEVEN_MEMBERS(usFire),
};
member_t memberlist_ump45[] = {
UMP45_MEMBERS(iShell),
UMP45_MEMBERS(iShellOn),
UMP45_MEMBERS(usFire),
};
member_t memberlist_sg550[] = {
SG550_MEMBERS(iShell),
SG550_MEMBERS(usFire),
};
member_t memberlist_galil[] = {
GALIL_MEMBERS(iShell),
GALIL_MEMBERS(iShellOn),
GALIL_MEMBERS(usFire),
};
member_t memberlist_famas[] = {
FAMAS_MEMBERS(iShell),
FAMAS_MEMBERS(iShellOn),
};
member_t memberlist_usp[] = {
USP_MEMBERS(iShell),
USP_MEMBERS(usFire),
};
member_t memberlist_glock18[] = {
GLOCK18_MEMBERS(iShell),
GLOCK18_MEMBERS(bBurstFire),
};
member_t memberlist_awp[] = {
AWP_MEMBERS(iShell),
AWP_MEMBERS(usFire),
};
member_t memberlist_mp5n[] = {
MP5N_MEMBERS(iShell),
MP5N_MEMBERS(iShellOn),
MP5N_MEMBERS(usFire),
};
member_t memberlist_m249[] = {
M249_MEMBERS(iShell),
M249_MEMBERS(iShellOn),
M249_MEMBERS(usFire),
};
member_t memberlist_m3[] = {
M3_MEMBERS(iShell),
M3_MEMBERS(flPumpTime),
M3_MEMBERS(usFire),
};
member_t memberlist_m4a1[] = {
M4A1_MEMBERS(iShell),
M4A1_MEMBERS(iShellOn),
M4A1_MEMBERS(usFire),
};
member_t memberlist_tmp[] = {
TMP_MEMBERS(iShell),
TMP_MEMBERS(iShellOn),
TMP_MEMBERS(usFire),
};
member_t memberlist_g3sg1[] = {
G3SG1_MEMBERS(iShell),
G3SG1_MEMBERS(usFire),
};
member_t memberlist_deagle[] = {
DEAGLE_MEMBERS(iShell),
DEAGLE_MEMBERS(usFire),
};
member_t memberlist_sg552[] = {
SG552_MEMBERS(iShell),
SG552_MEMBERS(iShellOn),
SG552_MEMBERS(usFire),
};
member_t memberlist_ak47[] = {
AK47_MEMBERS(iShell),
AK47_MEMBERS(iShellOn),
AK47_MEMBERS(usFire),
};
member_t memberlist_knife[] = {
KNIFE_MEMBERS(trHit),
KNIFE_MEMBERS(usKnife),
};
member_t memberlist_p90[] = {
P90_MEMBERS(iShell),
P90_MEMBERS(iShellOn),
P90_MEMBERS(usFire),
};
member_t memberlist_shield[] = {
SHIELD_MEMBERS(hEntToIgnoreTouchesFrom),
SHIELD_MEMBERS(flTimeToIgnoreTouches),
};
member_t memberlist_rebuystruct[] = {
REBUYSTRUCT_MEMBERS(m_primaryWeapon),
REBUYSTRUCT_MEMBERS(m_primaryAmmo),
REBUYSTRUCT_MEMBERS(m_secondaryWeapon),
REBUYSTRUCT_MEMBERS(m_secondaryAmmo),
REBUYSTRUCT_MEMBERS(m_heGrenade),
REBUYSTRUCT_MEMBERS(m_flashbang),
REBUYSTRUCT_MEMBERS(m_smokeGrenade),
REBUYSTRUCT_MEMBERS(m_defuser),
REBUYSTRUCT_MEMBERS(m_nightVision),
REBUYSTRUCT_MEMBERS(m_armor),
};
member_t memberlist_mapinfo[] = {
MAPINFO_MEMBERS(iBuyingStatus),
MAPINFO_MEMBERS(flBombRadius),
};
memberlist_t memberlist;
member_t *memberlist_t::operator[](size_t members) const
@ -773,6 +1012,38 @@ member_t *memberlist_t::operator[](size_t members) const
CASE(baseweapon)
CASE(weaponbox)
CASE(armoury)
CASE(grenade)
CASE(p228)
CASE(scout)
CASE(hegrenade)
CASE(xm1014)
CASE(c4)
CASE(mac10)
CASE(aug)
CASE(smokegrenade)
CASE(elite)
CASE(fiveseven)
CASE(ump45)
CASE(sg550)
CASE(galil)
CASE(famas)
CASE(usp)
CASE(glock18)
CASE(awp)
CASE(mp5n)
CASE(m249)
CASE(m3)
CASE(m4a1)
CASE(tmp)
CASE(g3sg1)
CASE(deagle)
CASE(sg552)
CASE(ak47)
CASE(knife)
CASE(p90)
CASE(shield)
CASE(rebuystruct)
CASE(mapinfo)
}
return nullptr;

View File

@ -24,6 +24,7 @@ enum MType
MEBMER_REBUYSTRUCT, // struct RebuyStruct
MEMBER_PMTRACE, // struct pmtrace_t
MEBMER_USERCMD, // struct usercmd_s
MEMBER_TRACERESULT, // struct TraceResult
};
struct memberlist_t
@ -46,7 +47,39 @@ struct memberlist_t
mt_baseitem,
mt_baseweapon,
mt_weaponbox,
mt_armoury
mt_armoury,
mt_grenade,
mt_p228,
mt_scout,
mt_hegrenade,
mt_xm1014,
mt_c4,
mt_mac10,
mt_aug,
mt_smokegrenade,
mt_elite,
mt_fiveseven,
mt_ump45,
mt_sg550,
mt_galil,
mt_famas,
mt_usp,
mt_glock18,
mt_awp,
mt_mp5n,
mt_m249,
mt_m3,
mt_m4a1,
mt_tmp,
mt_g3sg1,
mt_deagle,
mt_sg552,
mt_ak47,
mt_knife,
mt_p90,
mt_shield,
mt_rebuystruct,
mt_mapinfo,
};
};
@ -108,21 +141,21 @@ enum CSGameRules_Members
m_nMaxPlayers,
m_UpdateInterval,
m_flRestartRoundTime, // The global time when the round is supposed to end, if this is not 0 (deprecated name m_fTeamCount)
m_flRestartRoundTime, // The global time when the round is supposed to end, if this is not 0 (deprecated name m_fTeamCount)
m_flCheckWinConditions,
m_fRoundStartTime, // Time round has started (deprecated name m_fRoundCount)
m_iRoundTime, // (From mp_roundtime) - How many seconds long this round is.
m_iRoundTimeSecs,
m_iIntroRoundTime, // (From mp_freezetime) - How many seconds long the intro round (when players are frozen) is.
m_fRoundStartTimeReal, // The global time when the intro round ends and the real one starts
// wrote the original "m_flRoundTime" comment for this variable).
m_fRoundStartTimeReal, // The global time when the intro round ends and the real one starts
// wrote the original "m_flRoundTime" comment for this variable).
m_iAccountTerrorist,
m_iAccountCT,
m_iNumTerrorist, // The number of terrorists on the team (this is generated at the end of a round)
m_iNumCT, // The number of CTs on the team (this is generated at the end of a round)
m_iNumCT, // The number of CTs on the team (this is generated at the end of a round)
m_iNumSpawnableTerrorist,
m_iNumSpawnableCT,
m_iSpawnPointCount_Terrorist, // Number of Terrorist spawn points
m_iSpawnPointCount_Terrorist, // Number of Terrorist spawn points
m_iSpawnPointCount_CT, // Number of CT spawn points
m_iHostagesRescued,
m_iHostagesTouched,
@ -139,11 +172,11 @@ enum CSGameRules_Members
m_bMapHasVIPSafetyZone, // 0 = uninitialized, 1 = has VIP safety zone, 2 = DOES not have VIP safetyzone
m_bMapHasCameras,
m_iC4Timer,
m_iC4Guy, // The current Terrorist who has the C4.
m_iLoserBonus, // the amount of money the losing team gets. This scales up as they lose more rounds in a row
m_iNumConsecutiveCTLoses, // the number of rounds the CTs have lost in a row.
m_iC4Guy, // The current Terrorist who has the C4.
m_iLoserBonus, // the amount of money the losing team gets. This scales up as they lose more rounds in a row
m_iNumConsecutiveCTLoses, // the number of rounds the CTs have lost in a row.
m_iNumConsecutiveTerroristLoses, // the number of rounds the Terrorists have lost in a row.
m_fMaxIdlePeriod, // For the idle kick functionality. This is tha max amount of time that the player has to be idle before being kicked
m_fMaxIdlePeriod, // For the idle kick functionality. This is tha max amount of time that the player has to be idle before being kicked
m_iLimitTeams,
m_bLevelInitialized,
m_bRoundTerminating,
@ -158,7 +191,7 @@ enum CSGameRules_Members
m_iTotalGunCount,
m_iTotalGrenadeCount,
m_iTotalArmourCount,
m_iUnBalancedRounds, // keeps track of the # of consecutive rounds that have gone by where one team outnumbers the other team by more than 2
m_iUnBalancedRounds, // keeps track of the # of consecutive rounds that have gone by where one team outnumbers the other team by more than 2
m_iNumEscapeRounds, // keeps track of the # of consecutive rounds of escape played.. Teams will be swapped after 8 rounds
m_iMapVotes,
m_iLastPick,
@ -629,9 +662,9 @@ enum PlayerMove
pm_numphysent,
/* physent_t physents[MAX_PHYSENTS];
pm_nummoveent; // Number of momvement entities (ladders)
pm_nummoveent; // Number of momvement entities (ladders)
physent_t moveents[MAX_MOVEENTS]; // just a list of ladders
pm_numvisent; // All things being rendered, for tracing against things you don't actually collide with
pm_numvisent; // All things being rendered, for tracing against things you don't actually collide with
physent_t visents[MAX_PHYSENTS];*/
pm_cmd,
@ -771,3 +804,239 @@ enum CArmoury_Members
m_Armoury_iInitialCount,
m_Armoury_bAlreadyCounted,
};
enum CGrenade_Members
{
m_Grenade_bStartDefuse = BEGIN_MEMBER_REGION(grenade),
m_Grenade_bIsC4,
m_Grenade_pBombDefuser,
m_Grenade_flDefuseCountDown,
m_Grenade_flC4Blow,
m_Grenade_flNextFreqInterval,
m_Grenade_flNextBeep,
m_Grenade_flNextFreq,
m_Grenade_sBeepName,
m_Grenade_fAttenu,
m_Grenade_flNextBlink,
m_Grenade_fNextDefuse,
m_Grenade_bJustBlew,
m_Grenade_iTeam,
m_Grenade_iCurWave,
m_Grenade_pentCurBombTarget,
m_Grenade_SGSmoke,
m_Grenade_angle,
m_Grenade_usEvent,
m_Grenade_bLightSmoke,
m_Grenade_bDetonated,
m_Grenade_vSmokeDetonate,
m_Grenade_iBounceCount,
m_Grenade_fRegisteredSound,
};
enum CP228_Members
{
m_P228_iShell = BEGIN_MEMBER_REGION(p228),
m_P228_usFire,
};
enum CSCOUT_Members
{
m_SCOUT_iShell = BEGIN_MEMBER_REGION(scout),
m_SCOUT_usFire,
};
enum CHEGrenade_Members
{
m_HEGrenade_usCreate = BEGIN_MEMBER_REGION(hegrenade),
};
enum CXM1014_Members
{
m_XM1014_iShell = BEGIN_MEMBER_REGION(xm1014),
m_XM1014_flPumpTime,
m_XM1014_usFire,
};
enum CC4_Members
{
m_C4_bStartedArming = BEGIN_MEMBER_REGION(c4),
m_C4_bBombPlacedAnimation,
m_C4_fArmedTime,
m_C4_bHasShield,
};
enum CMAC10_Members
{
m_MAC10_iShell = BEGIN_MEMBER_REGION(mac10),
m_MAC10_iShellOn,
m_MAC10_usFire,
};
enum CAUG_Members
{
m_AUG_iShell = BEGIN_MEMBER_REGION(aug),
m_AUG_iShellOn,
m_AUG_usFire,
};
enum CSmokeGrenade_Members
{
m_SmokeGrenade_usCreate = BEGIN_MEMBER_REGION(smokegrenade),
};
enum CELITE_Members
{
m_ELITE_iShell = BEGIN_MEMBER_REGION(elite),
m_ELITE_usFire_LEFT,
m_ELITE_usFire_RIGHT,
};
enum CFiveSeven_Members
{
m_FiveSeven_iShell = BEGIN_MEMBER_REGION(fiveseven),
m_FiveSeven_usFire,
};
enum CUMP45_Members
{
m_UMP45_iShell = BEGIN_MEMBER_REGION(ump45),
m_UMP45_iShellOn,
m_UMP45_usFire,
};
enum CSG550_Members
{
m_SG550_iShell = BEGIN_MEMBER_REGION(sg550),
m_SG550_usFire,
};
enum CGalil_Members
{
m_Galil_iShell = BEGIN_MEMBER_REGION(galil),
m_Galil_iShellOn,
m_Galil_usFire,
};
enum CFamas_Members
{
m_Famas_iShell = BEGIN_MEMBER_REGION(famas),
m_Famas_iShellOn,
};
enum CUSP_Members
{
m_USP_iShell = BEGIN_MEMBER_REGION(usp),
m_USP_usFire,
};
enum CGLOCK18_Members
{
m_GLOCK18_iShell = BEGIN_MEMBER_REGION(glock18),
m_GLOCK18_bBurstFire,
};
enum CAWP_Members
{
m_AWP_iShell = BEGIN_MEMBER_REGION(awp),
m_AWP_usFire,
};
enum CMP5N_Members
{
m_MP5N_iShell = BEGIN_MEMBER_REGION(mp5n),
m_MP5N_iShellOn,
m_MP5N_usFire,
};
enum CM249_Members
{
m_M249_iShell = BEGIN_MEMBER_REGION(m249),
m_M249_iShellOn,
m_M249_usFire,
};
enum CM3_Members
{
m_M3_iShell = BEGIN_MEMBER_REGION(m3),
m_M3_flPumpTime,
m_M3_usFire,
};
enum CM4A1_Members
{
m_M4A1_iShell = BEGIN_MEMBER_REGION(m4a1),
m_M4A1_iShellOn,
m_M4A1_usFire,
};
enum CTMP_Members
{
m_TMP_iShell = BEGIN_MEMBER_REGION(tmp),
m_TMP_iShellOn,
m_TMP_usFire,
};
enum CG3SG1_Members
{
m_G3SG1_iShell = BEGIN_MEMBER_REGION(g3sg1),
m_G3SG1_usFire,
};
enum CDEAGLE_Members
{
m_DEAGLE_iShell = BEGIN_MEMBER_REGION(deagle),
m_DEAGLE_usFire,
};
enum CSG552_Members
{
m_SG552_iShell = BEGIN_MEMBER_REGION(sg552),
m_SG552_iShellOn,
m_SG552_usFire,
};
enum CAK47_Members
{
m_AK47_iShell = BEGIN_MEMBER_REGION(ak47),
m_AK47_iShellOn,
m_AK47_usFire,
};
enum CKnife_Members
{
m_Knife_trHit = BEGIN_MEMBER_REGION(knife),
m_Knife_usKnife,
};
enum CP90_Members
{
m_P90_iShell = BEGIN_MEMBER_REGION(p90),
m_P90_iShellOn,
m_P90_usFire,
};
enum CShield_Members
{
m_Shield_hEntToIgnoreTouchesFrom = BEGIN_MEMBER_REGION(shield),
m_Shield_flTimeToIgnoreTouches,
};
enum RebuyStruct_Members
{
m_primaryWeapon = BEGIN_MEMBER_REGION(rebuystruct),
m_primaryAmmo,
m_secondaryWeapon,
m_secondaryAmmo,
m_heGrenade,
m_flashbang,
m_smokeGrenade,
m_defuser,
m_nightVision,
m_armor,
};
enum MapInfo_Members
{
m_MapInfo_iBuyingStatus = BEGIN_MEMBER_REGION(mapinfo),
m_MapInfo_flBombRadius,
};

View File

@ -4,7 +4,7 @@
* Compares the entity to specified a classname.
* @note This native also checks the validity of an entity.
*
* @return true/false
* @return true/false
*
* native bool:FClassnameIs(const entityIndex, const className[]);
*/
@ -196,7 +196,7 @@ AMX_NATIVE_INFO Natives_Common[] =
/*
* Check if the entity is valid
*
* @return true/false
* @return true/false
*
* native bool:is_entity(const entityIndex);
*/
@ -225,7 +225,7 @@ cell AMX_NATIVE_CALL is_entity(AMX *amx, cell *params)
/*
* Check if the rehlds is available
*
* @return true/false
* @return true/false
*
* native bool:is_rehlds();
*/
@ -237,7 +237,7 @@ cell AMX_NATIVE_CALL is_rehlds(AMX *amx, cell *params)
/*
* Check if the regamedll is available
*
* @return true/false
* @return true/false
*
* native bool:is_regamedll();
*/
@ -249,7 +249,7 @@ cell AMX_NATIVE_CALL is_regamedll(AMX *amx, cell *params)
/*
* Check if the reunion is available
*
* @return true/false
* @return true/false
*
* native bool:has_reunion();
*/
@ -261,7 +261,7 @@ cell AMX_NATIVE_CALL has_reunion(AMX *amx, cell *params)
/*
* Check if the vtc is available
*
* @return true/false
* @return true/false
*
* native bool:has_vtc();
*/
@ -273,7 +273,7 @@ cell AMX_NATIVE_CALL has_vtc(AMX *amx, cell *params)
/*
* Check if the rechecker is available
*
* @return true/false
* @return true/false
*
* native bool:has_rechecker();
*/

View File

@ -1,15 +1,16 @@
#include "precompiled.h"
/*
* Hook API function that are available into enum
* Look at the enum's for parameter lists.
* Hook API function that are available into enum.
* Look at the enums for parameter lists.
*
* @param function The function to hook.
* @param callback The forward to call.
* @param post Whether or not to forward this in post.
* @return Returns a handle to the hook. Use EnableHookChain/DisableHookChain to toggle the forward on or off.
* @param function The function to hook
* @param callback The forward to call
* @param post Whether or not to forward this in post
*
* native RegisterHookChain(any:function_id, const callback[], post = 0);
* @return Returns a hook handle. Use EnableHookChain/DisableHookChain to toggle the forward on or off
*
* native HookChain:RegisterHookChain(any:function_id, const callback[], post = 0);
*/
cell AMX_NATIVE_CALL RegisterHookChain(AMX *amx, cell *params)
{
@ -50,13 +51,14 @@ cell AMX_NATIVE_CALL RegisterHookChain(AMX *amx, cell *params)
}
/*
* Enable hook by handle.
* Starts a hook back up.
* Use the return value from RegisterHookChain as the parameter here!
*
* @param fwd The hook to re-enable.
* @return Returns if the function is successful executed true otherwise false
* @param hook The hook to re-enable
*
* native bool:EnableHookChain(any:fwd);
* @return Returns true if the function is successfully executed, otherwise false
*
* native bool:EnableHookChain(HookChain:hook);
*/
cell AMX_NATIVE_CALL EnableHookChain(AMX *amx, cell *params)
{
@ -75,12 +77,12 @@ cell AMX_NATIVE_CALL EnableHookChain(AMX *amx, cell *params)
}
/*
* Disable hook by handle.
* Stops a hook from triggering.
* Use the return value from RegisterHookChain as the parameter here!
*
* @param fwd The hook to stop.
* @param hook The hook to stop
*
* native bool:DisableHookChain(any:fwd);
* native bool:DisableHookChain(HookChain:hook);
*/
cell AMX_NATIVE_CALL DisableHookChain(AMX *amx, cell *params)
{
@ -101,8 +103,8 @@ cell AMX_NATIVE_CALL DisableHookChain(AMX *amx, cell *params)
/*
* Sets the return value of a hookchain.
*
* @param type To specify the type ATYPE_*, look at the enum AType
* @param value The value to set the return to.
* @param type To specify the ATYPE_* parameter, look at the enum AType
* @param value The value to set the return to
*
* native SetHookChainReturn(AType:type, any:...);
*/
@ -163,9 +165,10 @@ cell AMX_NATIVE_CALL SetHookChainReturn(AMX *amx, cell *params)
* Gets the return value of the current hookchain.
* This has no effect in pre hookchain.
*
* @param type To specify the type ATYPE_*, look at the enum AType
* @param [maxlen] Max length of string (optional)
* @return If an integer or boolean or one byte or float, array or everything else is passed via 1rd argument and more
* @param type To specify the ATYPE_* parameter, look at the enum AType
* @param [maxlen] Max length of string (optional)
*
* @return If an integer or boolean or one byte or float, array or everything else is passed via 1st argument and more
*
* native any:GetHookChainReturn(AType:type, any:...);
*/
@ -224,10 +227,11 @@ cell AMX_NATIVE_CALL GetHookChainReturn(AMX *amx, cell *params)
* Set hookchain argument.
* This has no effect in post hookchain.
*
* @param number Number of argument
* @param value New value
* @param [maxlen] Max length of string (optional)
* @return Returns if the function is successful executed true otherwise false
* @param number Number of argument
* @param value New value
* @param [maxlen] Max length of string (optional)
*
* @return Returns true if the function is successfully executed, otherwise false
*
* native SetHookChainArg(number, AType:type, any:...);
*/

View File

@ -1,6 +1,14 @@
#include "precompiled.h"
// native set_member(_index, any:_member, any:...);
/*
* Sets a value to an entity's member.
*
* @param index Entity index
* @param member The specified member, look at the enums with name *_Members
*
* @return 1 on success.
* native set_member(const index, any:member, any:...);
*/
cell AMX_NATIVE_CALL set_member(AMX *amx, cell *params)
{
enum args_e { arg_count, arg_index, arg_member, arg_value, arg_elem };
@ -32,7 +40,16 @@ cell AMX_NATIVE_CALL set_member(AMX *amx, cell *params)
return set_member(pEdict->pvPrivateData, member, value, element);
}
// native any:get_member(_index, any:_member, any:...);
/*
* Returns a value from an entity's member.
*
* @param index Entity index
* @param member The specified member, look at the enums with name *_Members
*
* @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
*
* native any:get_member(const index, any:member, any:...);
*/
cell AMX_NATIVE_CALL get_member(AMX *amx, cell *params)
{
enum args_e { arg_count, arg_index, arg_member, arg_3, arg_4, arg_5 };
@ -98,7 +115,15 @@ cell AMX_NATIVE_CALL get_member(AMX *amx, cell *params)
return get_member(pEdict->pvPrivateData, member, dest, element, length);
}
// native set_member_game(any:_member, any:...);
/*
* Sets a value to CSGameRules_Members members.
*
* @param member The specified member, look at the enums with name CSGameRules_Members
*
* @return 1 on success.
*
* native set_member_game(CSGameRules_Members:member, any:...);
*/
cell AMX_NATIVE_CALL set_member_game(AMX *amx, cell *params)
{
enum args_e { arg_count, arg_member, arg_value, arg_elem };
@ -117,7 +142,15 @@ cell AMX_NATIVE_CALL set_member_game(AMX *amx, cell *params)
return set_member(g_pGameRules, member, value, element);
}
// native get_member_game(any:_member, any:...);
/*
* Returns a value from CSGameRules_Members members
*
* @param member The specified member, look at the enums with name CSGameRules_Members
*
* @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
*
* native any:get_member_game(CSGameRules_Members:member, any:...);
*/
cell AMX_NATIVE_CALL get_member_game(AMX *amx, cell *params)
{
enum args_e { arg_count, arg_member, arg_2 };
@ -155,7 +188,12 @@ cell AMX_NATIVE_CALL get_member_game(AMX *amx, cell *params)
return get_member(g_pGameRules, member, dest, element, length);
}
// native set_entvar(const index, const EntVars:var, any:...);
/*
* Sets entvars data for an entity.
* Use the var_* EntVars enum
*
* native set_entvar(const index, const EntVars:var, any:...);
*/
cell AMX_NATIVE_CALL set_entvar(AMX *amx, cell *params)
{
enum args_e { arg_count, arg_index, arg_var, arg_value, arg_elem };
@ -179,7 +217,12 @@ cell AMX_NATIVE_CALL set_entvar(AMX *amx, cell *params)
return set_member(&pEdict->v, member, value, element);
}
// native any:get_entvar(const index, const EntVars:var, any:...);
/*
* Returns entvar data from an entity.
* Use the var_* EntVars enum
*
* native any:get_entvar(const index, const EntVars:var, any:...);
*/
cell AMX_NATIVE_CALL get_entvar(AMX *amx, cell *params)
{
enum args_e { arg_count, arg_index, arg_var, arg_3, arg_4 };
@ -236,7 +279,15 @@ cell AMX_NATIVE_CALL get_entvar(AMX *amx, cell *params)
return get_member(&pEdict->v, member, dest, element, length);
}
// native set_pmove(const PlayerMove:pmove, any:...);
/*
* Sets playermove var.
*
* @param var The specified playermove, look at the enum PlayerMove
*
* @return 1 on success.
*
* native set_pmove(const PlayerMove:var, any:...);
*/
cell AMX_NATIVE_CALL set_pmove(AMX *amx, cell *params)
{
enum args_e { arg_count, arg_var, arg_value, arg_elem };
@ -253,7 +304,15 @@ cell AMX_NATIVE_CALL set_pmove(AMX *amx, cell *params)
return set_member(g_pMove, member, value, element);
}
// native any:get_pmove(const PlayerMove:pmove, any:...);
/*
* Returns a playermove var.
*
* @param var The specified playermove var, look at the enums PlayerMove
*
* @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
*
* native any:get_pmove(const PlayerMove:var, any:...);
*/
cell AMX_NATIVE_CALL get_pmove(AMX *amx, cell *params)
{
enum args_e { arg_count, arg_var, arg_2, arg_3 };
@ -288,7 +347,15 @@ cell AMX_NATIVE_CALL get_pmove(AMX *amx, cell *params)
return get_member(g_pMove, member, dest, element, length);
}
// native set_movevar(const MoveVars:var, any:...);
/*
* Sets a movevar value to a playermove.
*
* @param var The specified mvar, look at the enum MoveVars
*
* @return 1 on success.
*
* native set_movevar(const MoveVars:var, any:...);
*/
cell AMX_NATIVE_CALL set_movevar(AMX *amx, cell *params)
{
enum args_e { arg_count, arg_var, arg_value };
@ -303,7 +370,15 @@ cell AMX_NATIVE_CALL set_movevar(AMX *amx, cell *params)
return set_member(g_pMove->movevars, member, value, 0);
}
// native any:get_movevar(const MoveVars:var, any:...);
/*
* Returns a movevar value from a playermove.
*
* @param var The specified mvar, look at the enum MoveVars
*
* @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
*
* native any:get_movevar(const MoveVars:var, any:...);
*/
cell AMX_NATIVE_CALL get_movevar(AMX *amx, cell *params)
{
enum args_e { arg_count, arg_var, arg_2, arg_3 };
@ -332,7 +407,12 @@ cell AMX_NATIVE_CALL get_movevar(AMX *amx, cell *params)
return get_member(g_pMove->movevars, member, dest, element, length);
}
// native set_ucmd(const cmd, const UserCmd:var, any:...);
/*
* Sets usercmd data.
* Use the ucmd_* UCmd enum
*
* native set_ucmd(const ucmd, const UCmd:var, any:...);
*/
cell AMX_NATIVE_CALL set_ucmd(AMX *amx, cell *params)
{
enum args_e { arg_count, arg_cmd, arg_var, arg_value };
@ -348,7 +428,12 @@ cell AMX_NATIVE_CALL set_ucmd(AMX *amx, cell *params)
return set_member(cmd, member, value, 0);
}
// native any:get_ucmd(const cmd, const UserCmd:var, any:...);
/*
* Returns entvar data from an entity.
* Use the ucmd_* UCmd enum
*
* native any:get_ucmd(const ucmd, const UCmd:var, any:...);
*/
cell AMX_NATIVE_CALL get_ucmd(AMX *amx, cell *params)
{
enum args_e { arg_count, arg_cmd, arg_var, arg_3, arg_4 };
@ -375,7 +460,15 @@ cell AMX_NATIVE_CALL get_ucmd(AMX *amx, cell *params)
return get_member(cmd, member, dest, element);
}
// native set_pmtrace(const tr, const PMTrace:var, any:...);
/*
* Sets a pmtrace var.
*
* @param var The specified mvar, look at the enum PMTrace
*
* @return 1 on success.
*
* native set_pmtrace(const tracehandle, const PMTrace:var, any:...);
*/
cell AMX_NATIVE_CALL set_pmtrace(AMX *amx, cell *params)
{
enum args_e { arg_count, arg_tr, arg_var, arg_value };
@ -391,7 +484,15 @@ cell AMX_NATIVE_CALL set_pmtrace(AMX *amx, cell *params)
return set_member(tr, member, value, 0);
}
// native any:get_pmtrace(const tr, const PMTrace:var, any:...);
/*
* Returns a pmtrace var
*
* @param var The specified mvar, look at the enum PMTrace
*
* @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
*
* native any:get_pmtrace(const tracehandle, const PMTrace:var, any:...);
*/
cell AMX_NATIVE_CALL get_pmtrace(AMX *amx, cell *params)
{
enum args_e { arg_count, arg_tr, arg_var, arg_3, arg_4 };
@ -418,6 +519,62 @@ cell AMX_NATIVE_CALL get_pmtrace(AMX *amx, cell *params)
return get_member(tr, member, dest, element);
}
/*
* Sets a RebuyStruct member.
*
* @param var The specified RebuyStruct, look at the enum RebuyStruct
*
* @return 1 on success.
*
* native set_rebuy(const rebuyhandle, const RebuyStruct:member, value);
*/
cell AMX_NATIVE_CALL set_rebuy(AMX *amx, cell *params)
{
enum args_e { arg_count, arg_handle, arg_member, arg_value };
member_t *member = memberlist[params[arg_member]];
if (unlikely(member == nullptr)) {
MF_LogError(amx, AMX_ERR_NATIVE, "%s: unknown member id %i", __FUNCTION__, params[arg_member]);
return FALSE;
}
cell *handle = (cell *)params[arg_handle];
if (unlikely(handle == nullptr)) {
MF_LogError(amx, AMX_ERR_NATIVE, "%s: invalid rebuy handle", __FUNCTION__);
return FALSE;
}
return set_member(handle, member, &params[arg_value], 0);
}
/*
* Returns a RebuyStruct member
*
* @param var The specified RebuyStruct, look at the enum RebuyStruct
*
* @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
*
* native get_rebuy(const rebuyhandle, RebuyStruct:member);
*/
cell AMX_NATIVE_CALL get_rebuy(AMX *amx, cell *params)
{
enum args_e { arg_count, arg_handle, arg_member };
member_t *member = memberlist[params[arg_member]];
if (unlikely(member == nullptr)) {
MF_LogError(amx, AMX_ERR_NATIVE, "%s: unknown member id %i", __FUNCTION__, params[arg_member]);
return FALSE;
}
cell *handle = (cell *)params[arg_handle];
if (unlikely(handle == nullptr)) {
MF_LogError(amx, AMX_ERR_NATIVE, "%s: invalid rebuy handle", __FUNCTION__);
return FALSE;
}
return get_member(handle, member, nullptr, 0);
}
AMX_NATIVE_INFO EngineVars_Natives[] =
{
{ "set_entvar", set_entvar },
@ -426,6 +583,9 @@ AMX_NATIVE_INFO EngineVars_Natives[] =
{ "set_ucmd", set_ucmd },
{ "get_ucmd", get_ucmd },
{ "set_rebuy", set_rebuy },
{ "get_rebuy", get_rebuy },
{ nullptr, nullptr }
};
@ -560,6 +720,12 @@ BOOL set_member(void* pdata, const member_t *member, cell* value, size_t element
set_member<double>(pdata, member->offset, *(float *)value, element);
return TRUE;
}
case MEMBER_TRACERESULT:
{
// native set_member(_index, any:_member, any:_value, _elem);
set_member<TraceResult>(pdata, member->offset, *(TraceResult *)value, element);
return TRUE;
}
case MEMBER_ENTITY:
case MEMBER_EVARS:
@ -582,20 +748,20 @@ cell get_member(void* pdata, const member_t *member, cell* dest, size_t element,
{
// native any:get_member(_index, any:_member, element);
auto& pEntity = get_member<CBaseEntity *>(pdata, member->offset, element);
return pEntity ? indexOfEdict(pEntity->pev) : -1;
return pEntity ? indexOfEdict(pEntity->pev) : AMX_NULLENT;
}
case MEMBER_EHANDLE:
{
// native any:get_member(_index, any:_member, element);
EHANDLE ehandle = get_member<EHANDLE>(pdata, member->offset, element);
edict_t *pEntity = ehandle.Get();
return pEntity ? indexOfEdict(pEntity) : -1;
return pEntity ? indexOfEdict(pEntity) : AMX_NULLENT;
}
case MEMBER_EDICT:
{
// native any:get_member(_index, any:_member, element);
edict_t *pEntity = get_member<edict_t *>(pdata, member->offset, element);
return pEntity ? indexOfEdict(pEntity) : -1;
return pEntity ? indexOfEdict(pEntity) : AMX_NULLENT;
}
case MEMBER_VECTOR:
{
@ -684,16 +850,15 @@ cell get_member(void* pdata, const member_t *member, cell* dest, size_t element,
case MEMBER_ENTITY:
case MEMBER_EVARS:
case MEBMER_REBUYSTRUCT:
return 0;
case MEMBER_TRACERESULT:
return (cell)get_member_direct<TraceResult>(pdata, member->offset, element);
case MEBMER_REBUYSTRUCT:
return (cell)get_member_direct<RebuyStruct>(pdata, member->offset, element);
case MEMBER_PMTRACE:
// native any:get_member(_index, any:_member, element);
return (cell)get_member_direct<pmtrace_s>(pdata, member->offset, element);
case MEBMER_USERCMD:
// native any:get_member(_index, any:_member, element);
return (cell)get_member_direct<usercmd_s>(pdata, member->offset, element);
default: break;
}

File diff suppressed because it is too large Load Diff

View File

@ -3,8 +3,9 @@
/*
* Get client protocol
*
* @param index Client index
* @return client protocol
* @param index Client index
*
* @return Client protocol
*
* native REU_GetProtocol(const index);
*/
@ -20,8 +21,9 @@ cell AMX_NATIVE_CALL REU_GetProtocol(AMX *amx, cell *params)
/*
* Get client auth type
*
* @param index Client index
* @return client auth type
* @param index Client index
*
* @return Client auth type
*
* native REU_GetAuthtype(const index);
*/
@ -35,10 +37,11 @@ cell AMX_NATIVE_CALL REU_GetAuthtype(AMX *amx, cell *params)
}
/*
* Check if client running RevEmu with limited user rights
* Check if the client is running RevEmu with limited user rights.
*
* @param index Client index
* @return 1/0
* @param index Client index
*
* @return 1/0
*
* native REU_IsRevemuWithoutAdminRights(const index);
*/

View File

@ -1,10 +1,11 @@
#include "precompiled.h"
/*
* Checks whether the player is talking at this moment
* Checks whether the player is talking at the moment.
*
* @param index Client index
* @return true if client is speaking, false otherwise
* @param index Client index
*
* @return true if client is speaking, false otherwise
*
* native bool:VTC_IsClientSpeaking(const index);
*/
@ -18,9 +19,10 @@ cell AMX_NATIVE_CALL VTC_IsClientSpeaking(AMX *amx, cell *params)
}
/*
* Mutes this player
* Mutes the player.
*
* @param index Client index
*
* @param index Client index
* @noreturn
*
* native VTC_MuteClient(const index);
@ -36,9 +38,10 @@ cell AMX_NATIVE_CALL VTC_MuteClient(AMX *amx, cell *params)
}
/*
* Unmutes this player
* Unmutes the player.
*
* @param index Client index
*
* @param index Client index
* @noreturn
*
* native VTC_UnmuteClient(const index);
@ -54,10 +57,11 @@ cell AMX_NATIVE_CALL VTC_UnmuteClient(AMX *amx, cell *params)
}
/*
* Checks whether the player is muted at this moment
* Checks whether the player is muted at the moment.
*
* @param index Client index
* @return true if client is muted, false otherwise
* @param index Client index
*
* @return true if client is muted, false otherwise
*
* native bool:VTC_IsClientMuted(const index);
*/
@ -71,10 +75,10 @@ cell AMX_NATIVE_CALL VTC_IsClientMuted(AMX *amx, cell *params)
}
/*
* To play the audio file via the voice stream.
* Play the audio file via the voice stream.
*
* @param receiver Receiver index
* @param soundFilePath The path to the sound file.
* @param soundFilePath The path to the sound file
*
* @note Usage example:
* VTC_PlaySound(id, "sound/ambience/Opera.wav");

View File

@ -25,6 +25,7 @@
#include <pm_movevars.h>
#include <com_progdefs.h>
#include <gamerules.h>
#include <mapinfo.h>
// metamod SDK
#include <meta_api.h>

View File

@ -63,3 +63,32 @@ void CTempStrings::pop(size_t count)
{
m_current -= count;
}
CBaseEntity *GiveNamedItemInternal(AMX *amx, CBasePlayer *pPlayer, const char *pszItemName)
{
edict_t *pEdict = CREATE_NAMED_ENTITY(ALLOC_STRING(pszItemName));
if (FNullEnt(pEdict))
{
MF_LogError(amx, AMX_ERR_NATIVE, "%s: Item \"%s\" failed to create!\n", __FUNCTION__, pszItemName);
return nullptr;
}
pEdict->v.origin = pPlayer->pev->origin;
pEdict->v.spawnflags |= SF_NORESPAWN;
MDLL_Spawn(pEdict);
MDLL_Touch(pEdict, ENT(pPlayer->pev));
CBaseEntity *pEntity = getPrivate<CBaseEntity>(pEdict);
// not allow the item to fall to the ground.
if (FNullEnt(pEntity->pev->owner) || pEntity->pev->owner != pPlayer->edict())
{
pEntity->pev->targetname = iStringNull;
pEntity->pev->flags |= FL_KILLME;
return nullptr;
}
return pEntity;
}

View File

@ -18,15 +18,11 @@ inline void EWRITE_COORD(float flValue) { (*g_pengfuncsTable->pfnWriteCoord)(flV
inline void EWRITE_STRING(const char *sz) { (*g_pengfuncsTable->pfnWriteString)(sz); }
inline void EWRITE_ENTITY(int iValue) { (*g_pengfuncsTable->pfnWriteEntity)(iValue); }
#ifndef _WIN32
#define _strlwr(p) for (int i = 0; p[i] != 0; i++) p[i] = tolower(p[i]);
#endif
inline bool GetWeaponInfoRange(WeaponIdType wpnid, bool set_info)
inline bool GetWeaponInfoRange(WeaponIdType wpnid, bool set_info = false)
{
if (wpnid == WEAPON_SHIELDGUN)
return true;
if (set_info && (wpnid == WEAPON_KNIFE || wpnid == WEAPON_C4))
return false;
@ -55,5 +51,6 @@ void Broadcast(const char *sentence);
void UpdateTeamScores();
ModelName GetModelAuto(TeamName team);
void UTIL_ServerPrint(const char *fmt, ...);
CBaseEntity *GiveNamedItemInternal(AMX *amx, CBasePlayer *pPlayer, const char *pszItemName);
extern void __declspec(noreturn) UTIL_SysError(const char *fmt, ...);