Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f8f48e6219 | ||
|
|
b68e032cc2 | ||
|
|
d93f6984cc | ||
|
|
207584818f | ||
|
|
7a42d6b564 |
@@ -36,7 +36,11 @@
|
||||
|
||||
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
||||
SH_DECL_HOOK1_void(ICvar, UnregisterConCommand, SH_NOATTRIB, 0, ConCommandBase *);
|
||||
#if SOURCE_ENGINE == SE_CSGO
|
||||
SH_DECL_HOOK2_void(ICvar, RegisterConCommand, SH_NOATTRIB, 0, ConCommandBase *, bool);
|
||||
#else
|
||||
SH_DECL_HOOK1_void(ICvar, RegisterConCommand, SH_NOATTRIB, 0, ConCommandBase *);
|
||||
#endif
|
||||
#else
|
||||
SH_DECL_HOOK1_void(ICvar, RegisterConCommandBase, SH_NOATTRIB, 0, ConCommandBase *);
|
||||
#endif
|
||||
@@ -78,7 +82,11 @@ public:
|
||||
#endif
|
||||
}
|
||||
|
||||
#if SOURCE_ENGINE == SE_CSGO
|
||||
void LinkConCommandBase(ConCommandBase *pBase, bool unknown)
|
||||
#else
|
||||
void LinkConCommandBase(ConCommandBase *pBase)
|
||||
#endif
|
||||
{
|
||||
IConCommandLinkListener *listener = IConCommandLinkListener::head;
|
||||
while (listener)
|
||||
|
||||
@@ -64,10 +64,13 @@ static const int kActivityAdmins = 4; // Show admin activity to admins anonymo
|
||||
static const int kActivityAdminsNames = 8; // If 4 is specified, admin names will be shown.
|
||||
static const int kActivityRootNames = 16; // Always show admin names to root users.
|
||||
|
||||
#define FEATURECAP_MULTITARGETFILTER_CLIENTPARAM "SourceMod MultiTargetFilter ClientParam"
|
||||
|
||||
class PlayerLogicHelpers :
|
||||
public SMGlobalClass,
|
||||
public IPluginsListener,
|
||||
public ICommandTargetProcessor
|
||||
public ICommandTargetProcessor,
|
||||
public IFeatureProvider
|
||||
{
|
||||
struct SimpleMultiTargetFilter
|
||||
{
|
||||
@@ -141,6 +144,7 @@ public: //ICommandTargetProcessor
|
||||
|
||||
smtf->fun->PushString(info->pattern);
|
||||
smtf->fun->PushCell(ahc.getClone());
|
||||
smtf->fun->PushCell(info->admin);
|
||||
cell_t result = 0;
|
||||
if (smtf->fun->Execute(&result) != SP_ERROR_NONE || !result)
|
||||
return false;
|
||||
@@ -185,6 +189,7 @@ public: //SMGlobalClass
|
||||
void OnSourceModAllInitialized()
|
||||
{
|
||||
pluginsys->AddPluginsListener(this);
|
||||
sharesys->AddCapabilityProvider(NULL, this, FEATURECAP_MULTITARGETFILTER_CLIENTPARAM);
|
||||
}
|
||||
|
||||
void OnSourceModShutdown()
|
||||
@@ -194,6 +199,7 @@ public: //SMGlobalClass
|
||||
playerhelpers->UnregisterCommandTargetProcessor(this);
|
||||
filterEnabled = false;
|
||||
}
|
||||
sharesys->DropCapabilityProvider(NULL, this, FEATURECAP_MULTITARGETFILTER_CLIENTPARAM);
|
||||
}
|
||||
|
||||
public: //IPluginsListener
|
||||
@@ -211,6 +217,13 @@ public: //IPluginsListener
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public: //IFeatureProvider
|
||||
|
||||
FeatureStatus GetFeatureStatus(FeatureType type, const char *name)
|
||||
{
|
||||
return FeatureStatus_Available;
|
||||
}
|
||||
} s_PlayerLogicHelpers;
|
||||
|
||||
static cell_t
|
||||
|
||||
@@ -51,6 +51,7 @@ IGameConfig *g_pGameConf = NULL;
|
||||
IGameEventManager2 *gameevents = NULL;
|
||||
bool hooked_everything = false;
|
||||
int g_msgHintText = -1;
|
||||
CGlobalVars *gpGlobals;
|
||||
|
||||
SMEXT_LINK(&g_CStrike);
|
||||
|
||||
@@ -107,6 +108,7 @@ bool CStrike::SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlen, bool
|
||||
{
|
||||
GET_V_IFACE_CURRENT(GetEngineFactory, gameevents, IGameEventManager2, INTERFACEVERSION_GAMEEVENTSMANAGER2);
|
||||
GET_V_IFACE_CURRENT(GetEngineFactory, engine, IVEngineServer, INTERFACEVERSION_VENGINESERVER);
|
||||
gpGlobals = ismm->GetCGlobals();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -166,6 +166,7 @@ private:
|
||||
extern IBinTools *g_pBinTools;
|
||||
extern IGameConfig *g_pGameConf;
|
||||
extern ISDKTools *g_pSDKTools;
|
||||
extern CGlobalVars *gpGlobals;
|
||||
extern int g_msgHintText;
|
||||
extern bool g_pIgnoreTerminateDetour;
|
||||
extern bool g_pIgnoreCSWeaponDropDetour;
|
||||
|
||||
@@ -58,7 +58,19 @@ void TimeLeftEvents::FireGameEvent(IGameEvent *event)
|
||||
if (get_new_timeleft_offset || !round_end_found)
|
||||
{
|
||||
get_new_timeleft_offset = false;
|
||||
timersys->NotifyOfGameStart();
|
||||
|
||||
float flGameStartTime = gpGlobals->curtime;
|
||||
uintptr_t gamerules = (uintptr_t)g_pSDKTools->GetGameRules();
|
||||
if (gamerules)
|
||||
{
|
||||
sm_sendprop_info_t info;
|
||||
if (gamehelpers->FindSendPropInfo("CCSGameRulesProxy", "m_flGameStartTime", &info))
|
||||
{
|
||||
flGameStartTime = *(float *)(gamerules + info.actual_offset);
|
||||
}
|
||||
}
|
||||
|
||||
timersys->NotifyOfGameStart(flGameStartTime - gpGlobals->curtime);
|
||||
timersys->MapTimeLeftChanged();
|
||||
}
|
||||
round_end_found = false;
|
||||
|
||||
@@ -132,16 +132,23 @@ stock void ReplyToTargetError(int client, int reason)
|
||||
}
|
||||
}
|
||||
|
||||
#define FEATURECAP_MULTITARGETFILTER_CLIENTPARAM "SourceMod MultiTargetFilter ClientParam"
|
||||
|
||||
/**
|
||||
* Adds clients to a multi-target filter.
|
||||
*
|
||||
* @param pattern Pattern name.
|
||||
* @param clients Array to fill with unique, valid client indexes.
|
||||
* @param client Client that triggered this filter.
|
||||
* @return True if pattern was recognized, false otherwise.
|
||||
*
|
||||
* @note To see if the client param is available, use FeatureType_Capability and FEATURECAP_MULTITARGETFILTER_CLIENTPARAM.
|
||||
*/
|
||||
typeset MultiTargetFilter {
|
||||
function bool (const char[] pattern, Handle clients);
|
||||
function bool (const char[] pattern, ArrayList clients);
|
||||
function bool (const char[] pattern, Handle clients, int client);
|
||||
function bool (const char[] pattern, ArrayList clients, int client);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -615,7 +615,10 @@ native int FormatNativeString(int out_param,
|
||||
*
|
||||
* @param data Data passed to the RequestFrame native.
|
||||
*/
|
||||
typedef RequestFrameCallback = function void (any data);
|
||||
typeset RequestFrameCallback {
|
||||
function void ();
|
||||
function void (any data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a single use Next Frame hook.
|
||||
|
||||
Reference in New Issue
Block a user