示例#1
0
        public TimedEvent Jailtimer(int timeoutDelay, Dictionary <string, object> args)
        {
            TimedEvent timedEvent = new TimedEvent(timeoutDelay);

            timedEvent.Args    = args;
            timedEvent.OnFire += CallBack1;
            return(timedEvent);
        }
示例#2
0
        public void CallBack(TimedEvent e)
        {
            var dict = e.Args;

            e.Kill();
            Player  pl  = (Player)dict["user"];
            Vector3 loc = (Vector3)ds.Get("jailloc", "location");

            pl.TeleportTo(loc);
            pl.MessageFrom(Name, "Telported to jail");
        }
示例#3
0
        public void CallBack1(TimedEvent e)
        {
            var dict = e.Args;

            e.Kill();
            Player pl = (Player)dict["inmate"];

            if (ds.ContainsKey("inmates", pl.SteamID))
            {
                Vector3 loc = util.ConvertStringToVector3(list.GetSetting("previouslocations", pl.SteamID));
                pl.TeleportTo(loc);
                list.DeleteSetting("previouslocations", pl.SteamID);
                ds.Remove("inmates", pl.SteamID);
                list.DeleteSetting("inmates", pl.SteamID);
                list.DeleteSetting("jailreasons", pl.SteamID);
                list.Save();
                string message = FreeMessage.Replace("{inmate}", pl.Name);
                server.BroadcastFrom(Name, message);
            }
        }