public TimedEvent TeleportPlayer(int timeoutDelay, Dictionary <string, object> args) { TimedEvent timedEvent = new TimedEvent(timeoutDelay); timedEvent.Args = args; timedEvent.OnFire += CallBack; return(timedEvent); }
public void CallBack(TimedEvent e) { e.Kill(); var dict = e.Args; Player player = (Player)dict["user"]; Vector3 loc = (Vector3)dict["location"]; if (player.IsAlive && player.IsOnline) { player.TeleportTo(loc); Cooldown[player.UID] = TimeSpan.FromTicks(DateTime.Now.Ticks).TotalSeconds; teleporting.Remove(player.UID); } }