A few things that could change.
#define IS_CONNECTED_INGAME(%1) (IsClientConnected(%1) && IsClientInGame(%1))
Once a player is in game, you do not need to check if they are also connected. The only way for them to be in game is to be connected.
PHP Code:
// TODO: When the plugin is reloaded, existing clients' hooks are lost
// How can I fix this?
You do that by using OnAllPluginsLoaded.
PHP Code:
// Account for late loading
public OnAllPluginsLoaded()
{
for (new client = 1; client <= MaxClients; client++)
{
if (IsClientInGame(client))
{
SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamageUndoFF);
SDKHook(client, SDKHook_TraceAttack, TraceAttackUndoFF);
}
}
}
Other than that, please notice that OnTraceAttack or OnTakeDamage also fires during god frames. Meaning while the Survivor is getting up after being attacked by SI but take no damage even through OnTakeDamage hook fires.
Good plugin!
Good use of stocks as well ;)