/zexp [player] [value] - Gives Zombie experience to [player]

/zexp [player] [value] - Gives Zombie experience to [player]

Postby Leeizazombie » 22 Feb 2014, 14:12

Hey guys, just another Zombie Survival command, you can give players experience just like the title says. :)

Code: Select all
using System;

namespace MCDzienny
{
    public class CmdZEXP : Command
    {
        public override string name { get { return "zexp"; } }
        public override string shortcut { get { return ""; } }
        public override string type { get { return "mod"; } }
        public override bool museumUsable { get { return false; } }
        public override LevelPermission defaultRank { get { return LevelPermission.Operator; } }
        public override void Use(Player p, string message)
        {
            if (message == "") { Help(p); return; }
            int three = Convert.ToInt32(message.Split(' ')[1]);
            string two = message.Split(' ')[0];
            Player who = Player.Find(two);

            if (who == null)
            {
                Player.SendMessage(p, "Player is not online.");
                return;
            }

            who.PlayerExperienceOnZombie = (who.PlayerExperienceOnZombie + three);
             Player.SendMessage(p, Server.DefaultColor + "%7You gave %a" + three + " %7Experience to " + who.color + who.PublicName);
        }
        public override void Help(Player p)
        {
            Player.SendMessage(p, "/zexp [player] [value] - Gives experience to [player]");
        }
    }
}
Owner of:
LeeIzaZombie Freebuild and Lava Survival V2 (Shut Down and updated)
LeeIzaZombie Survival (Comming back soon)

Contact:
Skype: leeizazombie
IRC: irc.geekshed.net, #leeizazombie, #mcclassichosting
User avatar
Leeizazombie
 
Posts: 536
Joined: 10 Jun 2013, 17:45
Location: Ireland.

Re: /zexp [player] [value] - Gives Zombie experience to [pla

Postby joppiesaus » 09 Apr 2014, 13:45

Awesome! :D
However, if you don't enter a value... the command will crash!
You can fix it with catch blocks.
joppiesaus
 
Posts: 379
Joined: 20 Aug 2012, 07:28
Location: in a obsedian house, with glass in it so i can see the lava!


Return to Custom Commands

Who is online

Users browsing this forum: No registered users and 5 guests

cron