mirror of
https://github.com/rehlds/reapi.git
synced 2025-01-16 00:28:17 +03:00
Added hook CBasePlayer::HasRestrictItem
This commit is contained in:
parent
af1a542b45
commit
272b2fc709
@ -682,17 +682,6 @@ enum ArmouryItemPack
|
||||
ARMOURY_SMOKEGRENADE
|
||||
};
|
||||
|
||||
enum BuyItemID
|
||||
{
|
||||
BUY_ITEM_VEST = 1,
|
||||
BUY_ITEM_VESTHELM,
|
||||
BUY_ITEM_FLASHGREN,
|
||||
BUY_ITEM_HEGREN,
|
||||
BUY_ITEM_SMOKEGREN,
|
||||
BUY_ITEM_NVG,
|
||||
BUY_ITEM_DEFUSEKIT
|
||||
};
|
||||
|
||||
enum RewardType
|
||||
{
|
||||
RT_NONE,
|
||||
@ -1093,3 +1082,58 @@ enum RewardRules
|
||||
RR_TOOK_HOSTAGE,
|
||||
RR_END
|
||||
};
|
||||
|
||||
enum ItemRestType
|
||||
{
|
||||
ITEM_TYPE_BUYING, // when a player buying items
|
||||
ITEM_TYPE_TOUCHED, // when the player touches with a weaponbox or armoury_entity
|
||||
ITEM_TYPE_EQUIPPED // when a entity game_player_equip to player gives item
|
||||
};
|
||||
|
||||
// constant items
|
||||
enum ItemID
|
||||
{
|
||||
ITEM_NONE = -1,
|
||||
ITEM_SHIELDGUN,
|
||||
ITEM_P228,
|
||||
ITEM_GLOCK,
|
||||
ITEM_SCOUT,
|
||||
ITEM_HEGRENADE,
|
||||
ITEM_XM1014,
|
||||
ITEM_C4,
|
||||
ITEM_MAC10,
|
||||
ITEM_AUG,
|
||||
ITEM_SMOKEGRENADE,
|
||||
ITEM_ELITE,
|
||||
ITEM_FIVESEVEN,
|
||||
ITEM_UMP45,
|
||||
ITEM_SG550,
|
||||
ITEM_GALIL,
|
||||
ITEM_FAMAS,
|
||||
ITEM_USP,
|
||||
ITEM_GLOCK18,
|
||||
ITEM_AWP,
|
||||
ITEM_MP5N,
|
||||
ITEM_M249,
|
||||
ITEM_M3,
|
||||
ITEM_M4A1,
|
||||
ITEM_TMP,
|
||||
ITEM_G3SG1,
|
||||
ITEM_FLASHBANG,
|
||||
ITEM_DEAGLE,
|
||||
ITEM_SG552,
|
||||
ITEM_AK47,
|
||||
ITEM_KNIFE,
|
||||
ITEM_P90,
|
||||
ITEM_NVG,
|
||||
ITEM_DEFUSEKIT,
|
||||
ITEM_KEVLAR,
|
||||
ITEM_ASSAULT,
|
||||
ITEM_LONGJUMP,
|
||||
ITEM_SODACAN,
|
||||
ITEM_HEALTHKIT,
|
||||
ITEM_ANTIDOTE,
|
||||
ITEM_SECURITY,
|
||||
ITEM_BATTERY,
|
||||
ITEM_SUIT
|
||||
};
|
||||
|
@ -158,12 +158,6 @@ enum GamedllFunc
|
||||
*/
|
||||
RG_RoundEnd,
|
||||
|
||||
/*
|
||||
* Description: -
|
||||
* Params: (const index, const WeaponIdType:iWeapon)
|
||||
*/
|
||||
RG_CanBuyThis,
|
||||
|
||||
/*
|
||||
* Description: -
|
||||
* Params: (const PlayerMove:ppmove, const server)
|
||||
@ -198,13 +192,7 @@ enum GamedllFunc
|
||||
* Description: -
|
||||
* Params: (const index, VGUIMenu:menuType, const bitsSlots, szOldMenu[], bool:bForceOldMenu)
|
||||
*/
|
||||
RG_ShowVGUIMenu,
|
||||
|
||||
/*
|
||||
* Description: -
|
||||
* Params: (const index, BuyItemID:item)
|
||||
*/
|
||||
RG_CanBuyThisItem
|
||||
RG_ShowVGUIMenu
|
||||
};
|
||||
|
||||
enum GamedllFunc_CBaseAnimating
|
||||
@ -408,7 +396,14 @@ enum GamedllFunc_CBasePlayer
|
||||
* Description: -
|
||||
* Params: (const this, const pszItemName[])
|
||||
*/
|
||||
RG_CBasePlayer_DropPlayerItem
|
||||
RG_CBasePlayer_DropPlayerItem,
|
||||
|
||||
/*
|
||||
* Description: -
|
||||
* Params: (const this, ItemID:item, ItemRestType:type)
|
||||
*/
|
||||
RG_CBasePlayer_HasRestrictItem
|
||||
|
||||
};
|
||||
|
||||
enum GamedllFunc_CSGameRules
|
||||
@ -1730,7 +1725,7 @@ enum CBasePlayer_Members
|
||||
|
||||
/*
|
||||
* Description: -
|
||||
* Member type: int
|
||||
* Member type: enum ArmorType
|
||||
* Get params: get_member(index, member);
|
||||
* Set params: set_member(index, member, value);
|
||||
*/
|
||||
@ -4239,7 +4234,7 @@ enum CArmoury_Members
|
||||
{
|
||||
/*
|
||||
* Description: -
|
||||
* Member type: int (or enum's ArmouryItemPack)
|
||||
* Member type: enum ArmouryItemPack
|
||||
* Get params: ArmouryItemPack:get_member(index, member);
|
||||
* Set params: set_member(index, member, ArmouryItemPack:value);
|
||||
*/
|
||||
|
@ -53,17 +53,6 @@ enum BuyItemMenuSlot
|
||||
MENU_SLOT_ITEM_SHIELD,
|
||||
};
|
||||
|
||||
enum BuyItemID
|
||||
{
|
||||
BUY_ITEM_VEST = 1,
|
||||
BUY_ITEM_VESTHELM,
|
||||
BUY_ITEM_FLASHGREN,
|
||||
BUY_ITEM_HEGREN,
|
||||
BUY_ITEM_SMOKEGREN,
|
||||
BUY_ITEM_NVG,
|
||||
BUY_ITEM_DEFUSEKIT
|
||||
};
|
||||
|
||||
#define CS_NUM_SKIN 4
|
||||
#define CZ_NUM_SKIN 5
|
||||
|
||||
|
@ -27,22 +27,66 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
enum ItemRestType
|
||||
{
|
||||
ITEM_TYPE_BUYING, // when a player buying items
|
||||
ITEM_TYPE_TOUCHED, // when the player touches with a weaponbox or armoury_entity
|
||||
ITEM_TYPE_EQUIPPED // when a entity game_player_equip to player gives item
|
||||
};
|
||||
|
||||
// constant items
|
||||
#define ITEM_HEALTHKIT 1
|
||||
#define ITEM_ANTIDOTE 2
|
||||
#define ITEM_SECURITY 3
|
||||
#define ITEM_BATTERY 4
|
||||
#define ITEM_SUIT 5
|
||||
enum ItemID
|
||||
{
|
||||
ITEM_NONE = -1,
|
||||
ITEM_SHIELDGUN,
|
||||
ITEM_P228,
|
||||
ITEM_GLOCK,
|
||||
ITEM_SCOUT,
|
||||
ITEM_HEGRENADE,
|
||||
ITEM_XM1014,
|
||||
ITEM_C4,
|
||||
ITEM_MAC10,
|
||||
ITEM_AUG,
|
||||
ITEM_SMOKEGRENADE,
|
||||
ITEM_ELITE,
|
||||
ITEM_FIVESEVEN,
|
||||
ITEM_UMP45,
|
||||
ITEM_SG550,
|
||||
ITEM_GALIL,
|
||||
ITEM_FAMAS,
|
||||
ITEM_USP,
|
||||
ITEM_GLOCK18,
|
||||
ITEM_AWP,
|
||||
ITEM_MP5N,
|
||||
ITEM_M249,
|
||||
ITEM_M3,
|
||||
ITEM_M4A1,
|
||||
ITEM_TMP,
|
||||
ITEM_G3SG1,
|
||||
ITEM_FLASHBANG,
|
||||
ITEM_DEAGLE,
|
||||
ITEM_SG552,
|
||||
ITEM_AK47,
|
||||
ITEM_KNIFE,
|
||||
ITEM_P90,
|
||||
ITEM_NVG,
|
||||
ITEM_DEFUSEKIT,
|
||||
ITEM_KEVLAR,
|
||||
ITEM_ASSAULT,
|
||||
ITEM_LONGJUMP,
|
||||
ITEM_SODACAN,
|
||||
ITEM_HEALTHKIT,
|
||||
ITEM_ANTIDOTE,
|
||||
ITEM_SECURITY,
|
||||
ITEM_BATTERY,
|
||||
ITEM_SUIT
|
||||
};
|
||||
|
||||
class CItem: public CBaseEntity {
|
||||
public:
|
||||
virtual void Spawn() = 0;
|
||||
virtual CBaseEntity *Respawn() = 0;
|
||||
virtual BOOL MyTouch(CBasePlayer *pPlayer) = 0;
|
||||
|
||||
public:
|
||||
void EXPORT ItemTouch(CBaseEntity *pOther) = 0;
|
||||
void EXPORT Materialize() = 0;
|
||||
};
|
||||
|
||||
class CWorldItem: public CBaseEntity {
|
||||
@ -50,7 +94,7 @@ public:
|
||||
virtual void Spawn() = 0;
|
||||
virtual void KeyValue(KeyValueData *pkvd) = 0;
|
||||
public:
|
||||
int m_iType;
|
||||
ItemID m_iType;
|
||||
};
|
||||
|
||||
class CItemSuit: public CItem {
|
||||
|
@ -243,7 +243,7 @@ struct RebuyStruct
|
||||
int m_smokeGrenade;
|
||||
int m_defuser;
|
||||
int m_nightVision;
|
||||
int m_armor;
|
||||
ArmorType m_armor;
|
||||
};
|
||||
|
||||
enum ThrowDirection
|
||||
@ -375,7 +375,7 @@ public:
|
||||
int m_iLastZoom;
|
||||
bool m_bResumeZoom;
|
||||
float m_flEjectBrass;
|
||||
int m_iKevlar;
|
||||
ArmorType m_iKevlar;
|
||||
bool m_bNotKilled;
|
||||
TeamName m_iTeam;
|
||||
int m_iAccount;
|
||||
|
@ -33,8 +33,9 @@
|
||||
#include "player.h"
|
||||
#include "gamerules.h"
|
||||
#include "client.h"
|
||||
#include "items.h"
|
||||
|
||||
#define REGAMEDLL_API_VERSION_MAJOR 3
|
||||
#define REGAMEDLL_API_VERSION_MAJOR 4
|
||||
#define REGAMEDLL_API_VERSION_MINOR 1
|
||||
|
||||
// CBasePlayer::Spawn hook
|
||||
@ -157,6 +158,14 @@ typedef IVoidHookChainRegistryClass<class CBasePlayer, char *, char *> IReGameHo
|
||||
typedef IVoidHookChainClass<class CBasePlayer, char *, char *> IReGameHook_CBasePlayer_SetClientUserInfoName;
|
||||
typedef IVoidHookChainRegistryClass<class CBasePlayer, char *, char *> IReGameHookRegistry_CBasePlayer_SetClientUserInfoName;
|
||||
|
||||
// CBasePlayer::HasRestrictItem hook
|
||||
typedef IHookChainClass<bool, class CBasePlayer, ItemID, ItemRestType> IReGameHook_CBasePlayer_HasRestrictItem;
|
||||
typedef IHookChainRegistryClass<bool, class CBasePlayer, ItemID, ItemRestType> IReGameHookRegistry_CBasePlayer_HasRestrictItem;
|
||||
|
||||
// CBasePlayer::DropPlayerItem hook
|
||||
typedef IVoidHookChainClass<class CBasePlayer, const char *> IReGameHook_CBasePlayer_DropPlayerItem;
|
||||
typedef IVoidHookChainRegistryClass<class CBasePlayer, const char *> IReGameHookRegistry_CBasePlayer_DropPlayerItem;
|
||||
|
||||
// CBaseAnimating::ResetSequenceInfo hook
|
||||
typedef IVoidHookChainClass<class CBaseAnimating> IReGameHook_CBaseAnimating_ResetSequenceInfo;
|
||||
typedef IVoidHookChainRegistryClass<class CBaseAnimating> IReGameHookRegistry_CBaseAnimating_ResetSequenceInfo;
|
||||
@ -177,10 +186,6 @@ typedef IVoidHookChainRegistry<class CBasePlayer *, struct entvars_s *, struct e
|
||||
typedef IHookChain<bool, int, ScenarioEventEndRound, float> IReGameHook_RoundEnd;
|
||||
typedef IHookChainRegistry<bool, int, ScenarioEventEndRound, float> IReGameHookRegistry_RoundEnd;
|
||||
|
||||
// CanBuyThis hook
|
||||
typedef IHookChain<bool, class CBasePlayer *, int> IReGameHook_CanBuyThis;
|
||||
typedef IHookChainRegistry<bool, class CBasePlayer *, int> IReGameHookRegistry_CanBuyThis;
|
||||
|
||||
// InstallGameRules hook
|
||||
typedef IHookChain<class CGameRules *> IReGameHook_InstallGameRules;
|
||||
typedef IHookChainRegistry<class CGameRules *> IReGameHookRegistry_InstallGameRules;
|
||||
@ -301,14 +306,6 @@ typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_GoToIntermissio
|
||||
typedef IVoidHookChain<> IReGameHook_CSGameRules_BalanceTeams;
|
||||
typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_BalanceTeams;
|
||||
|
||||
// CanBuyThisItem hook
|
||||
typedef IHookChain<bool, class CBasePlayer *, BuyItemID> IReGameHook_CanBuyThisItem;
|
||||
typedef IHookChainRegistry<bool, class CBasePlayer *, BuyItemID> IReGameHookRegistry_CanBuyThisItem;
|
||||
|
||||
// CBasePlayer::DropPlayerItem hook
|
||||
typedef IVoidHookChainClass<class CBasePlayer, const char *> IReGameHook_CBasePlayer_DropPlayerItem;
|
||||
typedef IVoidHookChainRegistryClass<class CBasePlayer, const char *> IReGameHookRegistry_CBasePlayer_DropPlayerItem;
|
||||
|
||||
class IReGameHookchains {
|
||||
public:
|
||||
virtual ~IReGameHookchains() {}
|
||||
@ -344,13 +341,14 @@ public:
|
||||
virtual IReGameHookRegistry_CBasePlayer_GiveShield* CBasePlayer_GiveShield() = 0;
|
||||
virtual IReGameHookRegistry_CBasePlayer_SetClientUserInfoModel* CBasePlayer_SetClientUserInfoModel() = 0;
|
||||
virtual IReGameHookRegistry_CBasePlayer_SetClientUserInfoName* CBasePlayer_SetClientUserInfoName() = 0;
|
||||
virtual IReGameHookRegistry_CBasePlayer_HasRestrictItem* CBasePlayer_HasRestrictItem() = 0;
|
||||
virtual IReGameHookRegistry_CBasePlayer_DropPlayerItem* CBasePlayer_DropPlayerItem() = 0;
|
||||
virtual IReGameHookRegistry_CBaseAnimating_ResetSequenceInfo* CBaseAnimating_ResetSequenceInfo() = 0;
|
||||
|
||||
virtual IReGameHookRegistry_GetForceCamera* GetForceCamera() = 0;
|
||||
virtual IReGameHookRegistry_PlayerBlind* PlayerBlind() = 0;
|
||||
virtual IReGameHookRegistry_RadiusFlash_TraceLine* RadiusFlash_TraceLine() = 0;
|
||||
virtual IReGameHookRegistry_RoundEnd* RoundEnd() = 0;
|
||||
virtual IReGameHookRegistry_CanBuyThis* CanBuyThis() = 0;
|
||||
virtual IReGameHookRegistry_InstallGameRules* InstallGameRules() = 0;
|
||||
virtual IReGameHookRegistry_PM_Init* PM_Init() = 0;
|
||||
virtual IReGameHookRegistry_PM_Move* PM_Move() = 0;
|
||||
@ -382,9 +380,6 @@ public:
|
||||
virtual IReGameHookRegistry_CSGameRules_ChangeLevel* CSGameRules_ChangeLevel() = 0;
|
||||
virtual IReGameHookRegistry_CSGameRules_GoToIntermission* CSGameRules_GoToIntermission() = 0;
|
||||
virtual IReGameHookRegistry_CSGameRules_BalanceTeams* CSGameRules_BalanceTeams() = 0;
|
||||
|
||||
virtual IReGameHookRegistry_CanBuyThisItem* CanBuyThisItem() = 0;
|
||||
virtual IReGameHookRegistry_CBasePlayer_DropPlayerItem* CBasePlayer_DropPlayerItem() = 0;
|
||||
};
|
||||
|
||||
struct ReGameFuncs_t {
|
||||
|
@ -92,8 +92,7 @@ enum ArmouryItemPack
|
||||
ARMOURY_HEGRENADE,
|
||||
ARMOURY_KEVLAR,
|
||||
ARMOURY_ASSAULT,
|
||||
ARMOURY_SMOKEGRENADE,
|
||||
ARMOURY_END
|
||||
ARMOURY_SMOKEGRENADE
|
||||
};
|
||||
|
||||
struct ItemInfo
|
||||
@ -131,7 +130,7 @@ public:
|
||||
virtual void Restart() = 0;
|
||||
virtual void KeyValue(KeyValueData *pkvd) = 0;
|
||||
public:
|
||||
int m_iItem;
|
||||
ArmouryItemPack m_iItem;
|
||||
int m_iCount;
|
||||
int m_iInitialCount;
|
||||
bool m_bAlreadyCounted;
|
||||
|
@ -274,7 +274,8 @@ CBasePlayer *CBasePlayer_Observer_IsValidTarget(IReGameHook_CBasePlayer_Observer
|
||||
{
|
||||
auto original = [chain](int _pthis, int _iPlayerIndex, bool _bSameTeam)
|
||||
{
|
||||
return indexOfEdict(chain->callNext(getPrivate<CBasePlayer>(_pthis), _iPlayerIndex, _bSameTeam)->pev);
|
||||
auto pPlayer = chain->callNext(getPrivate<CBasePlayer>(_pthis), _iPlayerIndex, _bSameTeam);
|
||||
return pPlayer ? indexOfEdict(pPlayer->pev) : 0;
|
||||
};
|
||||
|
||||
return getPrivate<CBasePlayer>(callForward<size_t>(RG_CBasePlayer_Observer_IsValidTarget, original, indexOfEdict(pthis->pev), iPlayerIndex, bSameTeam));
|
||||
@ -330,6 +331,36 @@ void CBasePlayer_GiveShield(IReGameHook_CBasePlayer_GiveShield *chain, CBasePlay
|
||||
callVoidForward(RG_CBasePlayer_GiveShield, original, indexOfEdict(pthis->pev), bDeploy);
|
||||
}
|
||||
|
||||
void CBasePlayer_SetClientUserInfoModel(IReGameHook_CBasePlayer_SetClientUserInfoModel *chain, CBasePlayer *pthis, char *infobuffer, char *szNewModel)
|
||||
{
|
||||
auto original = [chain](int _pthis, char *_infobuffer, char *_szNewModel)
|
||||
{
|
||||
chain->callNext(getPrivate<CBasePlayer>(_pthis), _infobuffer, _szNewModel);
|
||||
};
|
||||
|
||||
callVoidForward(RG_CBasePlayer_SetClientUserInfoModel, original, indexOfEdict(pthis->pev), infobuffer, szNewModel);
|
||||
}
|
||||
|
||||
void CBasePlayer_SetClientUserInfoName(IReGameHook_CBasePlayer_SetClientUserInfoName *chain, CBasePlayer *pthis, char *infobuffer, char *szNewName)
|
||||
{
|
||||
auto original = [chain](int _pthis, char *_infobuffer, char *_szNewName)
|
||||
{
|
||||
chain->callNext(getPrivate<CBasePlayer>(_pthis), _infobuffer, _szNewName);
|
||||
};
|
||||
|
||||
callVoidForward(RG_CBasePlayer_SetClientUserInfoName, original, indexOfEdict(pthis->pev), infobuffer, szNewName);
|
||||
}
|
||||
|
||||
bool CBasePlayer_HasRestrictItem(IReGameHook_CBasePlayer_HasRestrictItem *chain, CBasePlayer *pthis, ItemID item, ItemRestType type)
|
||||
{
|
||||
auto original = [chain](int _pthis, ItemID _item, ItemRestType _type)
|
||||
{
|
||||
return chain->callNext(getPrivate<CBasePlayer>(_pthis), _item, _type);
|
||||
};
|
||||
|
||||
return callForward<bool>(RG_CBasePlayer_HasRestrictItem, original, indexOfEdict(pthis->pev), item, type);
|
||||
}
|
||||
|
||||
void CBasePlayer_DropPlayerItem(IReGameHook_CBasePlayer_DropPlayerItem *chain, CBasePlayer *pthis, const char *pszItemName)
|
||||
{
|
||||
auto original = [chain](int _pthis, const char *_pszItemName)
|
||||
@ -394,26 +425,6 @@ bool RoundEnd(IReGameHook_RoundEnd *chain, int winStatus, ScenarioEventEndRound
|
||||
return callForward<bool>(RG_RoundEnd, original, winStatus, event, tmDelay);
|
||||
}
|
||||
|
||||
bool CanBuyThis(IReGameHook_CanBuyThis *chain, CBasePlayer *pPlayer, int iWeapon)
|
||||
{
|
||||
auto original = [chain](int _pPlayer, int _iWeapon)
|
||||
{
|
||||
return chain->callNext(getPrivate<CBasePlayer>(_pPlayer), _iWeapon);
|
||||
};
|
||||
|
||||
return callForward<bool>(RG_CanBuyThis, original, indexOfEdict(pPlayer->pev), iWeapon);
|
||||
}
|
||||
|
||||
bool CanBuyThisItem(IReGameHook_CanBuyThisItem *chain, CBasePlayer *pPlayer, BuyItemID item)
|
||||
{
|
||||
auto original = [chain](int _pPlayer, BuyItemID _item)
|
||||
{
|
||||
return chain->callNext(getPrivate<CBasePlayer>(_pPlayer), _item);
|
||||
};
|
||||
|
||||
return callForward<bool>(RG_CanBuyThisItem, original, indexOfEdict(pPlayer->pev), item);
|
||||
}
|
||||
|
||||
void PM_Move(IReGameHook_PM_Move *chain, playermove_t *ppmove, int server)
|
||||
{
|
||||
auto original = [chain](playermove_t *_ppmove, int _server)
|
||||
@ -654,26 +665,6 @@ void CSGameRules_BalanceTeams(IReGameHook_CSGameRules_BalanceTeams *chain)
|
||||
callVoidForward(RG_CSGameRules_BalanceTeams, original);
|
||||
}
|
||||
|
||||
void CBasePlayer_SetClientUserInfoModel(IReGameHook_CBasePlayer_SetClientUserInfoModel *chain, CBasePlayer *pthis, char *infobuffer, char *szNewModel)
|
||||
{
|
||||
auto original = [chain](int _pthis, char *_infobuffer, char *_szNewModel)
|
||||
{
|
||||
chain->callNext(getPrivate<CBasePlayer>(_pthis), _infobuffer, _szNewModel);
|
||||
};
|
||||
|
||||
callVoidForward(RG_CBasePlayer_SetClientUserInfoModel, original, indexOfEdict(pthis->pev), infobuffer, szNewModel);
|
||||
}
|
||||
|
||||
void CBasePlayer_SetClientUserInfoName(IReGameHook_CBasePlayer_SetClientUserInfoName *chain, CBasePlayer *pthis, char *infobuffer, char *szNewName)
|
||||
{
|
||||
auto original = [chain](int _pthis, char *_infobuffer, char *_szNewName)
|
||||
{
|
||||
chain->callNext(getPrivate<CBasePlayer>(_pthis), _infobuffer, _szNewName);
|
||||
};
|
||||
|
||||
callVoidForward(RG_CBasePlayer_SetClientUserInfoName, original, indexOfEdict(pthis->pev), infobuffer, szNewName);
|
||||
}
|
||||
|
||||
void HandleMenu_ChooseAppearance(IReGameHook_HandleMenu_ChooseAppearance *chain, CBasePlayer *pPlayer, int slot)
|
||||
{
|
||||
auto original = [chain](int _pPlayer, int _slot)
|
||||
|
@ -42,7 +42,7 @@ inline AType getApiType(float) { return ATYPE_FLOAT; }
|
||||
inline AType getApiType(const char *) { return ATYPE_STRING; }
|
||||
inline AType getApiType(char []) { return ATYPE_STRING; }
|
||||
inline AType getApiType(CBaseEntity *) { return ATYPE_CLASSPTR; }
|
||||
inline AType getApiType(edict_t *) { return ATYPE_CLASSPTR; }
|
||||
inline AType getApiType(edict_t *) { return ATYPE_EDICT; }
|
||||
inline AType getApiType(entvars_t *) { return ATYPE_EVARS; }
|
||||
|
||||
template<typename T>
|
||||
@ -239,8 +239,6 @@ int GetForceCamera(IReGameHook_GetForceCamera *chain, CBasePlayer *pObserver);
|
||||
void PlayerBlind(IReGameHook_PlayerBlind *chain, CBasePlayer *pPlayer, entvars_t *pevInflictor, entvars_t *pevAttacker, float fadeTime, float fadeHold, int alpha, Vector& color);
|
||||
void RadiusFlash_TraceLine(IReGameHook_RadiusFlash_TraceLine *chain, CBasePlayer *pPlayer, entvars_t *pevInflictor, entvars_t *pevAttacker, Vector& vecSrc, Vector& vecSpot, TraceResult *ptr);
|
||||
bool RoundEnd(IReGameHook_RoundEnd *chain, int winStatus, ScenarioEventEndRound event, float tmDelay);
|
||||
bool CanBuyThis(IReGameHook_CanBuyThis *chain, CBasePlayer *pPlayer, int iWeapon);
|
||||
bool CanBuyThisItem(IReGameHook_CanBuyThisItem *chain, CBasePlayer *pPlayer, BuyItemID item);
|
||||
void PM_Move(IReGameHook_PM_Move *chain, playermove_t *ppmove, int server);
|
||||
void PM_AirMove(IReGameHook_PM_AirMove *chain, int playerIndex);
|
||||
void HandleMenu_ChooseAppearance(IReGameHook_HandleMenu_ChooseAppearance *chain, CBasePlayer *pPlayer, int slot);
|
||||
@ -278,6 +276,9 @@ void CBasePlayer_GiveDefaultItems(IReGameHook_CBasePlayer_GiveDefaultItems *chai
|
||||
void CBasePlayer_GiveNamedItem(IReGameHook_CBasePlayer_GiveNamedItem *chain, CBasePlayer *pthis, const char *pszName);
|
||||
void CBasePlayer_AddAccount(IReGameHook_CBasePlayer_AddAccount *chain, CBasePlayer *pthis, int amount, RewardType type, bool bTrackChange);
|
||||
void CBasePlayer_GiveShield(IReGameHook_CBasePlayer_GiveShield *chain, CBasePlayer *pthis, bool bDeploy);
|
||||
void CBasePlayer_SetClientUserInfoModel(IReGameHook_CBasePlayer_SetClientUserInfoModel *chain, CBasePlayer *pthis, char *infobuffer, char *szNewModel);
|
||||
void CBasePlayer_SetClientUserInfoName(IReGameHook_CBasePlayer_SetClientUserInfoName *chain, CBasePlayer *pthis, char *infobuffer, char *szNewName);
|
||||
bool CBasePlayer_HasRestrictItem(IReGameHook_CBasePlayer_HasRestrictItem *chain, CBasePlayer *pthis, ItemID item, ItemRestType type);
|
||||
void CBasePlayer_DropPlayerItem(IReGameHook_CBasePlayer_DropPlayerItem *chain, CBasePlayer *pthis, const char *pszItemName);
|
||||
|
||||
void CBaseAnimating_ResetSequenceInfo(IReGameHook_CBaseAnimating_ResetSequenceInfo *chain, CBaseAnimating *pthis);
|
||||
@ -305,9 +306,6 @@ void CSGameRules_ChangeLevel(IReGameHook_CSGameRules_ChangeLevel *chain);
|
||||
void CSGameRules_GoToIntermission(IReGameHook_CSGameRules_GoToIntermission *chain);
|
||||
void CSGameRules_BalanceTeams(IReGameHook_CSGameRules_BalanceTeams *chain);
|
||||
|
||||
void CBasePlayer_SetClientUserInfoModel(IReGameHook_CBasePlayer_SetClientUserInfoModel *chain, CBasePlayer *pthis, char *infobuffer, char *szNewModel);
|
||||
void CBasePlayer_SetClientUserInfoName(IReGameHook_CBasePlayer_SetClientUserInfoName *chain, CBasePlayer *pthis, char *infobuffer, char *szNewName);
|
||||
|
||||
extern int g_iClientStartSpeak;
|
||||
extern int g_iClientStopSpeak;
|
||||
|
||||
|
@ -6,7 +6,8 @@ inline size_t getFwdParamType(void(*)(Vector&)) { return FP_ARRAY; }
|
||||
inline size_t getFwdParamType(void(*)(PLAYER_ANIM)) { 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(*)(BuyItemID)) { 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(*)(float)) { return FP_FLOAT; }
|
||||
inline size_t getFwdParamType(void(*)(float&)) { return FP_FLOAT; }
|
||||
inline size_t getFwdParamType(void(*)(const char *)) { return FP_STRING; }
|
||||
@ -77,14 +78,12 @@ hook_t hooklist_gamedll[] = {
|
||||
DLL(PlayerBlind),
|
||||
DLL(RadiusFlash_TraceLine),
|
||||
DLL(RoundEnd),
|
||||
DLL(CanBuyThis),
|
||||
DLL(PM_Move),
|
||||
DLL(PM_AirMove),
|
||||
DLL(HandleMenu_ChooseAppearance),
|
||||
DLL(HandleMenu_ChooseTeam),
|
||||
DLL(ShowMenu),
|
||||
DLL(ShowVGUIMenu),
|
||||
DLL(CanBuyThisItem),
|
||||
};
|
||||
|
||||
hook_t hooklist_animating[] = {
|
||||
@ -124,6 +123,7 @@ hook_t hooklist_player[] = {
|
||||
DLL(CBasePlayer_AddAccount),
|
||||
DLL(CBasePlayer_GiveShield),
|
||||
DLL(CBasePlayer_DropPlayerItem),
|
||||
DLL(CBasePlayer_HasRestrictItem),
|
||||
};
|
||||
|
||||
hook_t hooklist_gamerules[] = {
|
||||
|
@ -74,7 +74,6 @@ enum EngineFunc
|
||||
RH_Cvar_DirectSet,
|
||||
|
||||
// [...]
|
||||
RH_EngineFunc_End
|
||||
};
|
||||
|
||||
enum GamedllFunc
|
||||
@ -83,7 +82,6 @@ enum GamedllFunc
|
||||
RG_PlayerBlind,
|
||||
RG_RadiusFlash_TraceLine,
|
||||
RG_RoundEnd,
|
||||
RG_CanBuyThis,
|
||||
|
||||
RG_PM_Move,
|
||||
RG_PM_AirMove,
|
||||
@ -91,10 +89,8 @@ enum GamedllFunc
|
||||
RG_HandleMenu_ChooseTeam,
|
||||
RG_ShowMenu,
|
||||
RG_ShowVGUIMenu,
|
||||
RG_CanBuyThisItem,
|
||||
|
||||
// [...]
|
||||
RG_End
|
||||
};
|
||||
|
||||
enum GamedllFunc_CBaseAnimating
|
||||
@ -102,7 +98,6 @@ enum GamedllFunc_CBaseAnimating
|
||||
RG_CBaseAnimating_ResetSequenceInfo = BEGIN_FUNC_REGION(animating),
|
||||
|
||||
// [...]
|
||||
RG_CBaseAnimating_End
|
||||
};
|
||||
|
||||
enum GamedllFunc_CBasePlayer
|
||||
@ -140,9 +135,9 @@ enum GamedllFunc_CBasePlayer
|
||||
RG_CBasePlayer_AddAccount,
|
||||
RG_CBasePlayer_GiveShield,
|
||||
RG_CBasePlayer_DropPlayerItem,
|
||||
RG_CBasePlayer_HasRestrictItem,
|
||||
|
||||
// [...]
|
||||
RG_CBasePlayer_End
|
||||
};
|
||||
|
||||
enum GamedllFunc_CSGameRules
|
||||
@ -173,5 +168,4 @@ enum GamedllFunc_CSGameRules
|
||||
RG_CSGameRules_BalanceTeams,
|
||||
|
||||
// [...]
|
||||
RG_CSGameRules_End
|
||||
};
|
||||
|
@ -55,6 +55,8 @@ 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(short) { return MEMBER_SHORT; }
|
||||
inline MType getMemberType(unsigned short) { return MEMBER_SHORT; }
|
||||
|
@ -950,7 +950,7 @@ cell AMX_NATIVE_CALL rg_set_user_armor(AMX *amx, cell *params)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int armorType = params[arg_armortype];
|
||||
ArmorType armorType = static_cast<ArmorType>(params[arg_armortype]);
|
||||
|
||||
pPlayer->pev->armorvalue = params[arg_armorvalue];
|
||||
pPlayer->m_iKevlar = armorType;
|
||||
|
@ -4,5 +4,5 @@
|
||||
#define _reapi_version_included
|
||||
|
||||
// reapi version
|
||||
#define REAPI_VERSION_MAJOR 3
|
||||
#define REAPI_VERSION_MAJOR 4
|
||||
#define REAPI_VERSION_MINOR 2
|
||||
|
Loading…
x
Reference in New Issue
Block a user