A error.

A error.

Postby lucasds12 » 01 Jun 2013, 02:37

I was trying to compile /permaban in my server and got a error:
Code: Select all

Error CS0115
Message: 'MCDzienny.CmdPermaban.refonly': no suitable method found to override
Line: 13

-Lucas
There is only one thing I do in life, that's contributing here.
lucasds12
 
Posts: 334
Joined: 17 Apr 2013, 16:17
Location: In the deep caves.

Re: A error.

Postby ismellike » 01 Jun 2013, 02:43

What's permaban?

If it's a command from another software, it won't work.
What a beast...
User avatar
ismellike
Coder
 
Posts: 731
Joined: 31 Oct 2012, 04:04
Location: Kansas

Re: A error.

Postby lucasds12 » 01 Jun 2013, 02:48

ismellike wrote:What's permaban?

If it's a command from another software, it won't work.

It's Apocalypse_Demon's command from MCDzienny and I tried to compile it and failed miserably.
-Lucas
There is only one thing I do in life, that's contributing here.
lucasds12
 
Posts: 334
Joined: 17 Apr 2013, 16:17
Location: In the deep caves.

Re: A error.

Postby ismellike » 01 Jun 2013, 03:08

Use this code, the other one had an extra piece of code that stopped it from working.
Code: Select all
using System;
using System.Threading;
using System.IO;

namespace MCDzienny
{
    public class CmdPermaban : Command
    {
        public override string name { get { return "permaban"; } }
        public override string shortcut { get { return "pb"; } }
        public override string type { get { return "mod"; } }
        public override bool museumUsable { get { return true; } }
        public override LevelPermission defaultRank { get { return LevelPermission.Admin; } }

        public override void Use(Player p, string message)
        {
            if (message == "")
            {
                Help(p);
                return;
            }
            string who = message.Split(' ')[0];

            Command.all.Find("ban").Use(p, message.Split(' ')[0]);
            Command.all.Find("kill").Use(p, message);
            Command.all.Find("slap").Use(p, message);
            Command.all.Find("freeze").Use(p, message);
            Command.all.Find("banip").Use(p, message.Split(' ')[0]);
            Command.all.Find("mute").Use(p, message);
            Thread.Sleep(10000);
            Command.all.Find("kick").Use(p, message);
        }

        public override void Help(Player p)
        {
            Player.SendMessage(p, "/Permaban: perma bans a player from your server.");
        }
    }
}
What a beast...
User avatar
ismellike
Coder
 
Posts: 731
Joined: 31 Oct 2012, 04:04
Location: Kansas

Re: A error.

Postby lucasds12 » 01 Jun 2013, 05:03

May I add
Code: Select all
command.all.Find{"jail"}.Use(p. message);

That would be nice to add with the /permaban command as well.
It's good to know that I learned the method as well.
Anyways please answer what I questioned please!
-Lucas
There is only one thing I do in life, that's contributing here.
lucasds12
 
Posts: 334
Joined: 17 Apr 2013, 16:17
Location: In the deep caves.

Re: A error.

Postby ismellike » 01 Jun 2013, 05:05

You don't have to ask.

The source code is for others to develop and learn from.

It's Apoc's anyways lol
What a beast...
User avatar
ismellike
Coder
 
Posts: 731
Joined: 31 Oct 2012, 04:04
Location: Kansas


Return to Help in Coding

Who is online

Users browsing this forum: No registered users and 5 guests

cron