Quote:
Originally Posted by BReeZ
Hello, today someone pointed out a bug to me i was not aware of (which isn't really a bug, but a lacking fix)
the spawn protection protects player on spawn (Check).
I have join grace time enabled, so if someone joins into the round 15 seconds after the round have started, that player will be protected, while others spawnprotection is over.
that player, is then able to kill other players - which should not really be a thing.
Are you able to add a code to fix such situation for other servers that allow join grace time?
|
Here's an example you can implement
Code:
#include <sdktools>
public void OnPluginStart()
{
//loop all players
OnClientPutInServer(i);
}
public void OnClientPutInServer(int client)
{
SDKHook(client, SDKHook_TraceAttack, OnTraceAttack);
}
public void OnClientDisconnect(int client)
{
SDKUnhook(client, SDKHook_TraceAttack, OnTraceAttack);
}
public Action OnTraceAttack(int victim, int &attacker, int &inflictor, float &damage, int &damagetype, int &ammotype, int hitbox, int hitgroup)
{
if ((victim != attacker) && IsClientSpawnProtected(attacker))
{
return Plugin_Handled;
}
return Plugin_Continue;
}
__________________