Esempio n. 1
0
        [RPC, Autogen, OwnerHidden, GuestEditable] public void PayToll(Player player)
        {
            if (!this.Enabled)
            {
                player.SendTemporaryErrorLoc("Toll is disabled. Check status."); return;
            }
            if (this.Authed(player))
            {
                player.SendTemporaryErrorLoc("Since you're authorized, toll is not required.  Triggered switch."); return;
            }
            if (this.Parent.OwnerUser == null)
            {
                player.SendTemporaryErrorLoc("Object does not have an owner, cannot be used."); return;
            }
            if (this.On)
            {
                player.SendTemporaryErrorLoc("Toll is already activated, wait for it to expire (owner can turn off manually)."); return;
            }

            if (UserCommands.Pay(player.User, this.Parent.OwnerUser, this.Toll, this.Currency))
            {
                this.DoSwitch(player);
            }
        }