Can somebody help me?
What wrong with this code?
Code:
...
SDKHook(client, SDKHook_OnTakeDamage, TakeDamage);
...
public Action:TakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
{
if ( IsClient(attacker)
&& IsClient(victim)
&& GetClientFrags(attacker) >= GetMaxFrags()
&& GetClientTeam(attacker) != GetClientTeam(victim) )
{
PrintToChat(attacker,MSG,"kill");
ForcePlayerSuicide(attacker);
damage = 0.0;
return Plugin_Changed;
}
return Plugin_Continue;
}
It spam errors like this:
Code:
L 08/05/2011 - 16:22:48: [SM] Native "GetClientFrags" reported: Client index 46 is invalid
L 08/05/2011 - 16:22:48: [SM] Displaying call stack trace for plugin "bonuses.smx":
L 08/05/2011 - 16:22:48: [SM] [0] Line 490, bonuses.sp::TakeDamage()
L 08/05/2011 - 16:22:48: [SM] Native "GetClientFrags" reported: Client index 46 is invalid
L 08/05/2011 - 16:22:48: [SM] Displaying call stack trace for plugin "bonuses.smx":
L 08/05/2011 - 16:22:48: [SM] [0] Line 490, bonuses.sp::TakeDamage()
L 08/05/2011 - 16:22:48: [SM] Native "GetClientFrags" reported: Client index 46 is invalid
L 08/05/2011 - 16:22:48: [SM] Displaying call stack trace for plugin "bonuses.smx":
L 08/05/2011 - 16:22:48: [SM] [0] Line 490, bonuses.sp::TakeDamage()