OK.. getting spammed with this error:
Quote:
L 04/25/2005 - 17 3 3: [AMXX] Run time error 4 (index out of bounds) on line 20 (file "ma_damageevents.inc").
|
added stuff for player0 to stop this eror:
Quote:
L 04/25/2005 - 17 3:16: [FUN] Player out of range (17)
L 04/25/2005 - 17 3:16: [AMXX] Native error in "set_user_godmode" on line
|
but i think it's checking everytime i move.. because it's checking when noone is shooting.... new code below:
Code:
public client_PreThink(id)
{
if(entity_get_int(id, EV_INT_button) & ~IN_ATTACK)
{
new Victim = read_data(2)
new Enemy = id, BodyPart
new Float: distance = get_user_aiming(id, Enemy, BodyPart)
new EnemyName[34], VictimName[34]
get_user_name(Enemy, EnemyName, 33)
get_user_name(Victim, VictimName, 33)
if (Victim == 0 || Enemy == 0)
{
return PLUGIN_HANDLED
}
//evade
new DodgeChance = random_num(0, 100)
new DodgeMod = (PlayerSkill[Victim][SKILL_DODGE] - PlayerSkill[Enemy][SKILL_TRUESHOT])
if(DodgeMod >= DodgeChance)
{
client_print(Victim, print_chat, "You dodged a shot by %s!", EnemyName)
client_print(0, print_console, "DodgeMod(%i)/DodgeChance(%i) = SUCCESS!", DodgeMod, DodgeChance)
client_print(Enemy, print_chat, "%s dodged your shot!", VictimName)
set_user_godmode (Victim, 1)
return PLUGIN_HANDLED
}
else
{
client_print(0, print_console, "Skill(%i)/DodgeChance(%i) = FAILURE!", PlayerSkill[Victim][SKILL_DODGE], DodgeChance)
set_user_godmode(Victim)
return PLUGIN_HANDLED
}
}
return PLUGIN_HANDLED
}
__________________
"What then is truth? Truths are illusions which we have forgotten are illusions - they are metaphors that have become worn out... this (truth) is the duty to lie according to a fixed convention.
-Friedrich Nietzsche