/warn

/warn

Postby PlatinumKiller » 24 Jun 2011, 23:37

Code: Select all
using System;

namespace MCDzienny
   public class CmdWarn : Command
   {
      public override string name { get { return "warn"; } }

      public override string shortcut { get { return ""; } }

      public override string type { get { return "mod"; } }

      public override bool museumUsable { get { return true; } }

      public override LevelPermission defaultRank { get { return LevelPermission.Builder; } }

        public override void Use(Player p, string message)
        {
            if (message == "") { Help(p); return; }
            Player who = Player.Find(message.Split(' ')[0]);
            if (who == null)
            {
                Player.SendMessage(p, "Player not found!");
            }
            {
                Player.GlobalMessage(p.color + p.name + " %ewarned " + who.color + who.name + "%e!");
                Player.SendMessage(p, "%eDo it again you could be banned!");
            }
        }

      public override void Help(Player p)
      {
         Player.SendMessage(p, "/warn - Warns a player.");
      }
   }
}
Last edited by PlatinumKiller on 24 Jun 2011, 23:38, edited 1 time in total.
Image
User avatar
PlatinumKiller
 
Posts: 388
Joined: 22 Jun 2011, 22:55
Location: MCDzienny Forums

Re: /warn Hope you like it

Postby PlatinumKiller » 24 Jun 2011, 23:38

Newer Version:

Code: Select all
using System;

namespace MCDzienny
{
   public class CmdWarn : Command
   {
      public override string name { get { return "warn"; } }

      public override string shortcut { get { return ""; } }

      public override string type { get { return "mod"; } }

      public override bool museumUsable { get { return true; } }

      public override LevelPermission defaultRank { get { return LevelPermission.AdvBuilder; } }

        public override void Use(Player p, string message)
        {
            if (message == "") { Help(p); return; }
            Player who = Player.Find(message.Split(' ')[0]);
            if (who == null)
            {
                Player.SendMessage(p, "Player not found!");
            }
            {
                Player.GlobalMessage(p.color + p.name + " %ewarned " + who.color + who.name + " %ebecause : &c" + message.Split(' ')[1]);
                Player.SendMessage(who, "Do it again you may be kicked!");
            }
        }

      public override void Help(Player p)
      {
         Player.SendMessage(p, "/warn - /warn player reason Warns a player for that reason.");
      }
   }
}
Image
User avatar
PlatinumKiller
 
Posts: 388
Joined: 22 Jun 2011, 22:55
Location: MCDzienny Forums

Re: /warn Hope you like it

Postby PlatinumKiller » 26 Jun 2011, 05:34

Newer Version works perfectly.
Image
User avatar
PlatinumKiller
 
Posts: 388
Joined: 22 Jun 2011, 22:55
Location: MCDzienny Forums

Re: /warn Hope you like it

Postby jkl139 » 26 Jun 2011, 16:34

found a little Bug:

If i warn someone it is: jkl139warnednamebecause: instead of jkl139 warned name because: XP i cant code so, :P
Image
Image
User avatar
jkl139
 
Posts: 444
Joined: 13 Jun 2011, 11:46
Location: MCDzienny Forum

Re: /warn Hope you like it

Postby xianos707 » 06 Jul 2011, 17:56

the code isnt quite right when you warn em it doesnt have spaces in it, oh well ty
Image
User avatar
xianos707
 
Posts: 25
Joined: 13 Apr 2011, 05:16

Re: /warn Hope you like it

Postby dzienny » 06 Jul 2011, 21:57

I fixed the problem with no-spaces. I've changed the first post, you can recompile it now and it should work. It just required to change "%ewarned" to " %ewarned " ;)
User avatar
dzienny
Administrator
 
Posts: 1181
Joined: 23 Jan 2011, 14:27

Re: /warn Hope you like it

Postby GameMaster » 06 Jul 2011, 22:21

You know, I to have my own warn command. But mine, You type /warn (player) (Rule Number) It warns (player) for (rule) and send's them back to spawn
GameMaster
 
Posts: 16
Joined: 26 Mar 2011, 03:17

Re: /warn Hope you like it

Postby PlatinumKiller » 07 Jul 2011, 03:26

dzienny wrote:I fixed the problem with no-spaces. I've changed the first post, you can recompile it now and it should work. It just required to change "%ewarned" to " %ewarned " ;)


do you mean, (that wried thing)warned to %ewarned?
Image
User avatar
PlatinumKiller
 
Posts: 388
Joined: 22 Jun 2011, 22:55
Location: MCDzienny Forums

Re: /warn Hope you like it

Postby g0d01w4r99 » 07 Jul 2011, 10:57

I have a custom warn too, its similiar to Blocktopia. Pays off to have.. ekhm.. connections.
Image
User avatar
g0d01w4r99
 
Posts: 453
Joined: 09 May 2011, 13:05
Location: Behind you.

Re: /warn Hope you like it

Postby GameMaster » 07 Jul 2011, 21:04

God,
You know WInX64 from Blocktopia lava survival? Me and him are good buddys, He made me the warn command for MCdzienny
GameMaster
 
Posts: 16
Joined: 26 Mar 2011, 03:17

Next

Return to Custom Commands

Who is online

Users browsing this forum: No registered users and 3 guests

cron