-
Notifications
You must be signed in to change notification settings - Fork 2
/
CommandIncrement.cs
38 lines (30 loc) · 1.3 KB
/
CommandIncrement.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using Rocket.API;
using Rocket.Unturned.Chat;
using Rocket.Unturned.Player;
using System.Collections.Generic;
namespace ExtraConcentratedJuice.KillStreaks
{
public class CommandIncrement : IRocketCommand
{
public AllowedCaller AllowedCaller => AllowedCaller.Player;
public string Name => "increment";
public string Help => "Increment your kills.";
public string Syntax => "";
public List<string> Aliases => new List<string>();
public List<string> Permissions => new List<string> { "killstreaks.increment" };
public void Execute(IRocketPlayer caller, string[] args)
{
UnturnedPlayer uPlayer = (UnturnedPlayer)caller;
if (KillStreaks.instance.killCount.TryGetValue(uPlayer.Id, out int killerKillCount))
{
KillStreaks.instance.killCount[uPlayer.Id] = killerKillCount + 1;
UnturnedChat.Say(caller, KillStreaks.instance.Translations.Instance.Translate("killstreak_increment"), UnityEngine.Color.green);
}
else
{
KillStreaks.instance.killCount[uPlayer.Id] = 1;
UnturnedChat.Say(caller, KillStreaks.instance.Translations.Instance.Translate("killstreak_increment"), UnityEngine.Color.red);
}
}
}
}