mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-07 10:28:26 +00:00
use eventqueuefix's event pausing when possible
This commit is contained in:
parent
3be13005e6
commit
8f8b29b377
@ -76,6 +76,25 @@ native bool ClearClientEvents(int client);
|
||||
*/
|
||||
native bool SetEventsTimescale(int client, float timescale);
|
||||
|
||||
/*
|
||||
* Pauses or unpauses events for a given client.
|
||||
*
|
||||
* @param client Client index.
|
||||
* @param paused Pause state.
|
||||
*
|
||||
* @return True if action was successful, false otherwise.
|
||||
*/
|
||||
native bool SetClientEventsPaused(int client, bool paused);
|
||||
|
||||
/*
|
||||
* Check if events is paused
|
||||
*
|
||||
* @param client Client index.
|
||||
*
|
||||
* @return True if events are paused for client, false otherwise. Will throw native error if client is invalid.
|
||||
*/
|
||||
native bool IsClientEventsPaused(int client);
|
||||
|
||||
#if !defined REQUIRE_PLUGIN
|
||||
public void __pl_eventqueuefix_SetNTVOptional()
|
||||
{
|
||||
@ -83,5 +102,7 @@ public void __pl_eventqueuefix_SetNTVOptional()
|
||||
MarkNativeAsOptional("SetClientEvents");
|
||||
MarkNativeAsOptional("ClearClientEvents");
|
||||
MarkNativeAsOptional("SetEventsTimescale");
|
||||
MarkNativeAsOptional("SetClientEventsPaused");
|
||||
MarkNativeAsOptional("IsClientEventsPaused");
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -1126,6 +1126,22 @@ void RemoveRagdoll(int client)
|
||||
}
|
||||
}
|
||||
|
||||
public void Shavit_OnPause(int client, int track)
|
||||
{
|
||||
if (gB_Eventqueuefix)
|
||||
{
|
||||
SetClientEventsPaused(client, true);
|
||||
}
|
||||
}
|
||||
|
||||
public void Shavit_OnResume(int client, int track)
|
||||
{
|
||||
if (gB_Eventqueuefix)
|
||||
{
|
||||
SetClientEventsPaused(client, false);
|
||||
}
|
||||
}
|
||||
|
||||
public Action Shavit_OnUserCmdPre(int client, int &buttons, int &impulse, float vel[3], float angles[3], TimerStatus status, int track, int style)
|
||||
{
|
||||
bool bNoclip = (GetEntityMoveType(client) == MOVETYPE_NOCLIP);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user