Beispiel #1
0
 private void OnRecyclerToggle(Recycler recycler, BasePlayer player)
 {
     if (recycler.IsOn())
     {
         recycler.CancelInvoke("RecycleThink");
         return;
     }
     recycler.CancelInvoke("RecycleThink");
     timer.Once(0.1f, () => { recycler.Invoke("RecycleThink", recycleTime); });
 }
Beispiel #2
0
        // actual code
        private object OnRecyclerToggle(Recycler r, BasePlayer p)
        {
            // check permission
            if (!permission.UserHasPermission(p.UserIDString, "recyclerspeed.use"))
            {
                return(null);
            }

            if (r.IsOn() == false)
            {
                timer.Once(0.1f, () => {
                    r.CancelInvoke(new Action(r.RecycleThink));
                    r.InvokeRepeating(new Action(r.RecycleThink), (speed - 0.1f), speed);
                });
            }
            return(null);
        }