Написал мини-плагин, изредка лупит ошибку в логи.
Ошибка
Как исправить?
PHP:
#include <sourcemod>
#include <zombiereloaded>
public OnPluginStart()
{
HookEvent("player_hurt", Event_OnPlayerHurt);
}
public Event_OnPlayerHurt(Handle:event, const String:name[], bool:silent)
{
new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
if (ZR_IsClientHuman(attacker) && attacker > 0)
{
PrintHintText(attacker, "Осталось хп: %d", GetEventInt(event, "health"));
}
}
Ошибка
PHP:
L 10/12/2014 - 13:59:47: [SM] Native "ZR_IsClientHuman" reported: Invalid client index. (0)
L 10/12/2014 - 13:59:47: [SM] Displaying call stack trace for plugin "showdamage.smx":
L 10/12/2014 - 13:59:47: [SM] [0] Line 13, D:\scripting\showdamage.sp::Event_OnPlayerHurt()
Как исправить?