Hello i have this code:
Code:
public tracker_damage(id)
{
new victim
victim = id
new attacker
if (get_user_attacker(victim) > 0)
attacker = get_user_attacker(victim)
else
return PLUGIN_CONTINUE
new maxTargets = get_cvar_num("tracker_maxtargets")
if(maxTargets == 0)
maxTargets = 33
if ( attacker <= 0 || attacker > 33 || victim <= 0 || victim > 33)
return PLUGIN_CONTINUE
if (victim==0)
return PLUGIN_CONTINUE
if(attacker > 0 && attacker <= 33 && victim > 0 && victim <= 33 && hasTrackerPowers[attacker] && attacker!=victim && get_user_team(attacker)!=get_user_team(victim) && numTargets[attacker]<maxTargets)
{
isTagged[attacker][victim] = true
numTargets[attacker] = numTargets[attacker]++
timeLeft[attacker][victim] = get_cvar_float("tracker_timetargeted")
if(timeLeft[attacker][victim]==0.0)
timeLeft[attacker][victim] = -1.0
}
else
return PLUGIN_CONTINUE
return PLUGIN_CONTINUE
}
My problem is this error in error log:
Code:
L 07/01/2018 - 12:02:16: Invalid player id 0
L 07/01/2018 - 12:02:16: [AMXX] Displaying debug trace (plugin "sh_tracker.amxx")
L 07/01/2018 - 12:02:16: [AMXX] Run time error 10: native error (native "get_user_attacker")
L 07/01/2018 - 12:02:16: [AMXX] [0] sh_tracker.sma::tracker_damage (line 105)
L 07/01/2018 - 12:04:12: Invalid player id 0
I tried fix it but still im not able to fix. Can somebody help me please?