Fix skill actions on player death and cap RichBoy money
This commit is contained in:
parent
6805eaa746
commit
5ee1764318
3 changed files with 5 additions and 2 deletions
|
|
@ -320,13 +320,16 @@ namespace jRandomSkills
|
|||
|
||||
private static HookResult PlayerDeath(EventPlayerDeath @event, GameEventInfo info)
|
||||
{
|
||||
foreach (var playerSkill in Instance.SkillPlayer)
|
||||
if (!playerSkill.IsDrawing)
|
||||
Instance.SkillAction(playerSkill.Skill.ToString(), "PlayerDeath", [@event]);
|
||||
|
||||
var victim = @event.Userid;
|
||||
var attacker = @event.Attacker;
|
||||
if (victim == null || attacker == null) return HookResult.Continue;
|
||||
|
||||
var playerInfo = Instance.SkillPlayer.FirstOrDefault(p => p.SteamID == victim.SteamID);
|
||||
if (playerInfo == null || playerInfo.IsDrawing) return HookResult.Continue;
|
||||
Instance.SkillAction(playerInfo.Skill.ToString(), "PlayerDeath", [@event]);
|
||||
Instance.SkillAction(playerInfo.Skill.ToString(), "DisableSkill", [victim]);
|
||||
|
||||
if (victim == attacker) return HookResult.Continue;
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ namespace jRandomSkills
|
|||
var moneyServices = player.InGameMoneyServices;
|
||||
if (moneyServices == null) return;
|
||||
|
||||
moneyServices.Account = Math.Max(moneyServices.Account + money, 0);
|
||||
moneyServices.Account = Math.Min(Math.Max(moneyServices.Account + money, 0), 16000);
|
||||
Utilities.SetStateChanged(player, "CCSPlayerController", "m_pInGameMoneyServices");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue