-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExtraEffects.cs
45 lines (39 loc) · 1.33 KB
/
ExtraEffects.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
39
40
41
42
43
44
45
using Rocket.Core.Plugins;
using com.aviadmini.rocketmod.AviEconomy;
using com.aviadmini.rocketmod.AviRockets;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Rocket.Unturned;
using Rocket.Unturned.Player;
using SDG.Unturned;
namespace ExtraConcentratedJuice.ExtraEffects
{
public class ExtraEffects : RocketPlugin<ExtraEffectsConfig>
{
private static DateTime lastUpdated;
public static ExtraEffects Instance;
protected override void Load()
{
Instance = this;
lastUpdated = DateTime.Now;
PlayerEvents.OnPlayerRepUpd += UIManager.UpdateReputation;
U.Events.OnPlayerConnected += OnConnection;
}
private void FixedUpdate()
{
// "Public Developer API" without events ok AviRocket
if ((DateTime.Now - lastUpdated).Seconds > Util.getConfig().updateInterval)
for (int i = 0; i < Provider.clients.Count; i++)
{
UIManager.UpdateBalance(UPlayer.From(Provider.clients[i]));
}
}
private void OnConnection(UnturnedPlayer player)
{
UIManager.UpdateBalance(UPlayer.From(player));
UIManager.UpdateReputation(UPlayer.From(player), player.Reputation);
}
}
}