forked from abnerfs/cs2-rockthevote
-
Notifications
You must be signed in to change notification settings - Fork 3
/
PluginState.cs
32 lines (27 loc) · 1006 Bytes
/
PluginState.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
using CounterStrikeSharp.API;
namespace cs2_rockthevote
{
public class PluginState : IPluginDependency<Plugin, Config>
{
public bool MapChangeScheduled { get; set; }
public bool EofVoteHappening { get; set; }
public bool ExtendTimeVoteHappening { get; set; }
public bool CommandsDisabled { get; set; }
public int ExtendsLeft { get; set; }
public PluginState()
{
}
public bool DisableCommands => MapChangeScheduled || EofVoteHappening || ExtendTimeVoteHappening || CommandsDisabled;
public void OnMapStart(string map)
{
MapChangeScheduled = false;
EofVoteHappening = false;
ExtendTimeVoteHappening = false;
CommandsDisabled = false;
if (MapChangeScheduled || EofVoteHappening || ExtendTimeVoteHappening || CommandsDisabled)
{
Server.ExecuteCommand("css_plugins reload RockTheVote");
}
}
}
}