Skip to content

Commit 1f89102

Browse files
authored
1.1b
1 parent 892ac67 commit 1f89102

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

ChopperDrop/EventHandlers.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,17 @@ public class EventHandlers
1414
public Plugin pl;
1515
public ChopperDrops allowedItems;
1616

17+
public int time;
18+
1719
public List<CoroutineHandle> coroutines = new List<CoroutineHandle>();
1820

1921
public bool roundStarted = false;
2022

21-
public EventHandlers(Plugin plugin, ChopperDrops drops)
23+
public EventHandlers(Plugin plugin, ChopperDrops drops, int tim)
2224
{
2325
pl = plugin;
2426
allowedItems = drops;
27+
time = tim;
2528
}
2629

2730
internal void RoundStart()
@@ -45,7 +48,7 @@ public IEnumerator<float> ChopperThread()
4548
{
4649
// Unity GARBAGE
4750
Plugin.Info("Chopper thread waiting 10 minutes.");
48-
yield return Timing.WaitForSeconds(600); // Wait 600 seconds (10 minutes)
51+
yield return Timing.WaitForSeconds(time); // Wait seconds (10 minutes by defualt)
4952
Plugin.Info("Spawning chopper!");
5053
ChopperAutostart ca = UnityEngine.Object.FindObjectOfType<ChopperAutostart>(); // Call in the chopper
5154
ca.SetState(true);

ChopperDrop/Plugin.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,16 @@ public override void OnEnable()
3030
// We make our own dictionary stuff because the .GetStringDictionary of 'config' me and joker don't know how it works lol.
3131
string[] drops = Config.GetString("chopper_drops", "GrenadeFrag:4,Flashlight:1,GunMP7:4,GunUSP:2,Painkillers:4").Split(',');
3232
ChopperDrops cDrops = new ChopperDrops();
33-
33+
34+
int time = Config.GetInt("chopper_time", 600);
35+
3436
foreach (string drop in drops)
3537
{
3638
string[] d = drop.Split(':'); // d[0] = item, d[1] = amount
3739
cDrops.AddToList(d[0], int.Parse(d[1]));
3840
}
3941

40-
EventHandlers = new EventHandlers(this, cDrops);
42+
EventHandlers = new EventHandlers(this, cDrops, time);
4143
Events.RoundStartEvent += EventHandlers.RoundStart;
4244
Events.WaitingForPlayersEvent += EventHandlers.WaitingForPlayers;
4345

0 commit comments

Comments
 (0)