ok i get it now, i got a lil post happy and jumpped the gun.. i ended up havin to do a bunch of error handling for it..
i ended up with this:
Code:
public MHO_Damage(id)
{
new damage = read_data(2)
//new attacker = read_data(1)
new szName[32], szAtt[32]
get_user_name(id, szName, 31)
new P_A = get_user_attacker(id)
get_user_name(P_A, szAtt, 31)
//get_user_name(idInflictor, P_A_Name[idInflictor], 31)
//server_print("--MHO MOD-- [DAMAGE] - %s took: %i from: %s", szName, damage, szAtt)
if (P_A >= 32){
server_print("--MHO MOD-- [DAMAGE] - NONE Player Attacker")
} else {
if (P_A == 0){
server_print("--MHO MOD-- [DAMAGE] - NONE Player Attacker")
} else {
PlayerXP[P_A] += damage
server_print("--MHO MOD-- [DAMAGE] - Player Attacker: %s", szAtt)
if(is_user_bot(id) == 1){
} else {
if(is_user_alive(id)){
ShowHUD(P_A)
}
}
}
}
//ShowHUD(attacker)
}
its still throwin me a few index out of bounds in the showhud here n there, but im workin the bugs out, well trying to.
any advice on the out of bounds debugging? all was fine and dandy till i added this in there, now its spittin those index errors at me. i understand that usually it means that im tryin to display a hud to an index of something above 32 or 33, but it doesnt seem like any thing higher than 32 will get passed me here.. atleast id think i handled it all.
//------------------------------------------
edited:
i never hand error handling in the ShowHUD, i needed checks for if user is alive, and all that, with that in there, it solved the index out of bounds issues.
__________________