From 8180f860932c3002ac19a6d2a00a31afeea9b195 Mon Sep 17 00:00:00 2001 From: 20223 <75004620+JUNESYNGOTOFLEX@users.noreply.github.com> Date: Tue, 10 Jun 2025 22:39:27 +0300 Subject: [PATCH 1/7] Update version.h --- reapi/version/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reapi/version/version.h b/reapi/version/version.h index d3e8b9db..3838a2f8 100644 --- a/reapi/version/version.h +++ b/reapi/version/version.h @@ -6,5 +6,5 @@ #pragma once #define VERSION_MAJOR 5 -#define VERSION_MINOR 29 +#define VERSION_MINOR 30 #define VERSION_MAINTENANCE 0 From 62b0b7a3ebb3107ffc6ee2a8adad17f8c13d7036 Mon Sep 17 00:00:00 2001 From: 20223 <75004620+JUNESYNGOTOFLEX@users.noreply.github.com> Date: Tue, 10 Jun 2025 22:43:03 +0300 Subject: [PATCH 2/7] Update reapi_gamedll_const.inc --- .../amxmodx/scripting/include/reapi_gamedll_const.inc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc b/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc index 82749cb4..a20fc927 100644 --- a/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc +++ b/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc @@ -39,6 +39,7 @@ #define RG_CBasePlayerWeapon_DefaultShotgunReload RG_CBaseWeapon_DefShotgunReload #define RG_CBasePlayer_Observer_SetMode RG_CBasePlayer_Observer_SetMod #define RG_CBasePlayer_Observer_FindNextPlayer RG_CBasePlayer_Observer_FindNxt + #define RG_CSGameRules_PlayerRelationship RG_CSGameRules_PlayerRelation #endif /** @@ -1272,6 +1273,13 @@ enum GamedllFunc_CSGameRules * Params: (const pKiller, const pVictim, const pAssister, const pevInflictor, const killerWeaponName[], const DeathMessageFlags:iDeathMessageFlags, const KillRarity:iRarityOfKill) */ RG_CSGameRules_SendDeathMessage, + + /* + * Description: What is the player's relationship with this entity? + * Return type: int + * Params: (const pPlayer, const pEntity) + */ + RG_CSGameRules_PlayerRelationship, }; /** From b5863f0f92580b9c055f881614eb218cab48ab6b Mon Sep 17 00:00:00 2001 From: 20223 <75004620+JUNESYNGOTOFLEX@users.noreply.github.com> Date: Tue, 10 Jun 2025 22:44:14 +0300 Subject: [PATCH 3/7] Update hook_callback.h --- reapi/src/hook_callback.h | 1 + 1 file changed, 1 insertion(+) diff --git a/reapi/src/hook_callback.h b/reapi/src/hook_callback.h index 1065997a..1d7e7a4c 100644 --- a/reapi/src/hook_callback.h +++ b/reapi/src/hook_callback.h @@ -576,6 +576,7 @@ void CBasePlayer_RemoveAllItems(IReGameHook_CBasePlayer_RemoveAllItems *chain, C void CSGameRules_SendDeathMessage(IReGameHook_CSGameRules_SendDeathMessage *chain, CBaseEntity *pKiller, CBasePlayer *pVictim, CBasePlayer *pAssister, entvars_t *pevInflictor, const char *killerWeaponName, int iDeathMessageFlags, int iRarityOfKill); void CBasePlayer_UpdateStatusBar(IReGameHook_CBasePlayer_UpdateStatusBar *chain, CBasePlayer *pthis); void CBasePlayer_TakeDamageImpulse(IReGameHook_CBasePlayer_TakeDamageImpulse *chain, CBasePlayer *pthis, CBasePlayer *pAttacker, float flKnockbackForce, float flVelModifier); +int CSGameRules_PlayerRelationship(IReGameHook_CSGameRules_PlayerRelationship *chain, CBasePlayer *pPlayer, CBaseEntity *pEntity); /* * VTC functions From 1c008ada362bc1d8fe386a1995991b4e048f9db1 Mon Sep 17 00:00:00 2001 From: 20223 <75004620+JUNESYNGOTOFLEX@users.noreply.github.com> Date: Tue, 10 Jun 2025 22:47:15 +0300 Subject: [PATCH 4/7] Update hook_callback.cpp --- reapi/src/hook_callback.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/reapi/src/hook_callback.cpp b/reapi/src/hook_callback.cpp index fdb723e4..457069d2 100644 --- a/reapi/src/hook_callback.cpp +++ b/reapi/src/hook_callback.cpp @@ -1786,6 +1786,16 @@ void CBasePlayer_TakeDamageImpulse(IReGameHook_CBasePlayer_TakeDamageImpulse *ch callVoidForward(RG_CBasePlayer_TakeDamageImpulse, original, indexOfEdict(pthis->pev), indexOfEdict(pAttacker->pev), flKnockbackForce, flVelModifier); } +int CSGameRules_PlayerRelationship(IReGameHook_CSGameRules_PlayerRelationship *chain, CBasePlayer *pPlayer, CBaseEntity *pEntity) +{ + auto original = [chain](int _pPlayer, int _pEntity) + { + return chain->callNext(getPrivate(_pPlayer), getPrivate(_pEntity)); + }; + + return callForward(RG_CSGameRules_PlayerRelationship, original, indexOfEdict(pPlayer->pev), indexOfEdict(pEntity->pev)); +} + /* * VTC functions */ From 23d4b0f218fb299ea5343296074455ef37fd6360 Mon Sep 17 00:00:00 2001 From: 20223 <75004620+JUNESYNGOTOFLEX@users.noreply.github.com> Date: Tue, 10 Jun 2025 22:48:27 +0300 Subject: [PATCH 5/7] Update hook_list.cpp --- reapi/src/hook_list.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/reapi/src/hook_list.cpp b/reapi/src/hook_list.cpp index cb8bd17e..64f4b11d 100644 --- a/reapi/src/hook_list.cpp +++ b/reapi/src/hook_list.cpp @@ -250,6 +250,7 @@ hook_t hooklist_gamerules[] = { DLL(CSGameRules_TeamStacked), DLL(CSGameRules_PlayerGotWeapon), DLL(CSGameRules_SendDeathMessage), + DLL(CSGameRules_PlayerRelationship), }; hook_t hooklist_grenade[] = { From fd42bc14c041f87796520d07ecfbec959f5a1e1f Mon Sep 17 00:00:00 2001 From: 20223 <75004620+JUNESYNGOTOFLEX@users.noreply.github.com> Date: Tue, 10 Jun 2025 22:49:02 +0300 Subject: [PATCH 6/7] Update hook_list.h --- reapi/src/hook_list.h | 1 + 1 file changed, 1 insertion(+) diff --git a/reapi/src/hook_list.h b/reapi/src/hook_list.h index 1cdb7bb4..5ea51001 100644 --- a/reapi/src/hook_list.h +++ b/reapi/src/hook_list.h @@ -310,6 +310,7 @@ enum GamedllFunc_CSGameRules RG_CSGameRules_TeamStacked, RG_CSGameRules_PlayerGotWeapon, RG_CSGameRules_SendDeathMessage, + RG_CSGameRules_PlayerRelationship, // [...] }; From e02c4fa4bd4f6302dbb8ba4d9f6510d20d1acd8c Mon Sep 17 00:00:00 2001 From: 20223 <75004620+JUNESYNGOTOFLEX@users.noreply.github.com> Date: Tue, 10 Jun 2025 22:51:59 +0300 Subject: [PATCH 7/7] Update regamedll_api.h --- reapi/include/cssdk/dlls/regamedll_api.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/reapi/include/cssdk/dlls/regamedll_api.h b/reapi/include/cssdk/dlls/regamedll_api.h index 62273fe6..449957ad 100644 --- a/reapi/include/cssdk/dlls/regamedll_api.h +++ b/reapi/include/cssdk/dlls/regamedll_api.h @@ -40,7 +40,7 @@ #include #define REGAMEDLL_API_VERSION_MAJOR 5 -#define REGAMEDLL_API_VERSION_MINOR 30 +#define REGAMEDLL_API_VERSION_MINOR 31 // CBasePlayer::Spawn hook typedef IHookChainClass IReGameHook_CBasePlayer_Spawn; @@ -638,6 +638,10 @@ typedef IHookChainRegistryClass IReGameHookRegistry_CBa typedef IHookChainClass IReGameHook_CBasePlayer_TakeDamageImpulse; typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_TakeDamageImpulse; +// CHalfLifeMultiplay::PlayerRelationship hook +typedef IHookChain IReGameHook_CSGameRules_PlayerRelationship; +typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_PlayerRelationship; + class IReGameHookchains { public: virtual ~IReGameHookchains() {} @@ -802,6 +806,7 @@ class IReGameHookchains { virtual IReGameHookRegistry_CBasePlayer_RemoveAllItems *CBasePlayer_RemoveAllItems() = 0; virtual IReGameHookRegistry_CBasePlayer_UpdateStatusBar *CBasePlayer_UpdateStatusBar() = 0; virtual IReGameHookRegistry_CBasePlayer_TakeDamageImpulse *CBasePlayer_TakeDamageImpulse() = 0; + virtual IReGameHookRegistry_CSGameRules_PlayerRelationship *CSGameRules_PlayerRelationship() = 0; }; struct ReGameFuncs_t {