AntiLagSwitch & DamageProxy :D

This commit is contained in:
BotoX
2019-09-27 22:01:42 +02:00
parent 913ecd2228
commit 09945b0801
10 changed files with 388 additions and 211 deletions
+21 -1
View File
@@ -17,6 +17,8 @@ public Plugin myinfo =
Handle g_hProcessUsercmds;
Handle g_hRunNullCommand;
int g_LastProcessed[MAXPLAYERS + 1];
public void OnPluginStart()
{
Handle hGameConf = LoadGameConfigFile("AntiLagSwitch.games");
@@ -59,11 +61,29 @@ public void OnPluginStart()
public void OnClientPutInServer(int client)
{
DHookEntity(g_hProcessUsercmds, true, client);
g_LastProcessed[client] = GetGameTickCount();
}
public void OnClientDisconnect(int client)
{
g_LastProcessed[client] = 0;
}
public void OnGameFrame()
{
int minimum = GetGameTickCount() - 33;
for(int client = 1; client <= MaxClients; client++)
{
if(IsClientInGame(client) && (IsFakeClient(client) || g_LastProcessed[client] < minimum))
{
RunNullCommand(client);
}
}
}
public MRESReturn Hook_ProcessUsercmds(int client, Handle hParams)
{
g_LastProcessed[client] = GetGameTickCount();
}
int RunNullCommand(int client)