/// <summary> /// Invoked when the health of the player is modified. /// If their health is not full while their buildmode is on, they get healed to full health. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private static void OnPlayerHP(object sender, PlayerHPEventArgs e) { if ((e.Current < e.Max) && e.Player.IsBuildModeOn()) { e.Player.Heal(e.Player.TPlayer.statLifeMax2); } }
private static bool OnPlayerHP(byte _plr, short _cur, short _max) { if (PlayerHP == null) return false; var args = new PlayerHPEventArgs { PlayerId = _plr, Current = _cur, Max = _max, }; PlayerHP.Invoke(null, args); return args.Handled; }