In OnAttack hook ( i dont' know if it happens even in the other hooks), if i use attacker.setcriminal(1), after running that istruction, the hook function terminates itself without running the rest of code. Moreover it happens something as the hook returned 0, and the pol uses his reputation system code for hook.
I make an example:
Code:
exported function OnAttack(attacker, defender)
if ( attacker.serial == defender.serial )
// Safe to attack.. yourself?
return 1;
elseif ( defender.master )
// Check for the npc's master.
return OnAttack(attacker, defender.master);
elseif ( IsInnocentTo(defender, attacker) )
// Reset the criminal timer for the attacker.
attacker.SetCriminal(1);
endif
PrintTextAbovePrivate( defender, "*"+attacker.name+" is attacking you!*" , defender);
endfunction
if attacker.SetCriminal is called the printtextabove is red as pol default repsys...