Help❗ Really need help coding the /godlands command!

Posts 1–9 of 9 · Page 1 of 1
❗ Really need help coding the /godlands command!
Can anyone please help me. I'm new to coding and adding a command to tp to glands isn't easy for me. Please help if you can, thanks. Thats what I have:
Code:
//	class GlandCommand : ICommand
//	{
//		public string Command { get { return "godlands"; } }
//		public int RequiredRank { get { return 0; } }
//
//		public void Execute(Player player, string[] args)
//		{
//			if (args.Length == 0)
//			{
//				player.SendHelp ("Usage: /godlands");
//			}
//			else
//			{
TIP: take a look at /tp command xD
Code:
class GodlandCommand : ICommand
    {
        public string Command { get { return "godland"; } }
        public int RequiredRank { get { return 0; } }


        public void Execute(Player player, string[] args)
        {
            if (args.Length > 0) 
            {
                player.SendHelp("Usage: /godland"); 
            }
            else
            {
                int x, y;
                try
                {
                    x = 1000;
                    y = 1000;
                }
                catch
                {
                    player.SendError("Invalid coordinates!");
                    return; 
                }
                player.Move(x + 0.5f, y + 0.5f);
                player.SetNewbiePeriod();
                player.UpdateCount++;
                player.Owner.BroadcastPacket(new GotoPacket()
                {
                    ObjectId = player.Id,
                    Position = new Position()
                    {
                        X = player.X,
                        Y = player.Y
                    }
                }, null); 
            }
        }
    }
That should work
Quote Originally Posted by ~V~ View Post
Code:
class GodlandCommand : ICommand
    {
        public string Command { get { return "godland"; } }
        public int RequiredRank { get { return 0; } }


        public void Execute(Player player, string[] args)
        {
            if (args.Length > 0) 
            {
                player.SendHelp("Usage: /godland"); 
            }
            else
            {
                int x, y;
                try
                {
                    x = 1000;
                    y = 1000;
                }
                catch
                {
                    player.SendError("Invalid coordinates!");
                    return; 
                }
                player.Move(x + 0.5f, y + 0.5f);
                player.SetNewbiePeriod();
                player.UpdateCount++;
                player.Owner.BroadcastPacket(new GotoPacket()
                {
                    ObjectId = player.Id,
                    Position = new Position()
                    {
                        X = player.X,
                        Y = player.Y
                    }
                }, null); 
            }
        }
    }
That should work
kek

x = 1000;
y = 1000;

you should make it range between 1000 and like 1500
Quote Originally Posted by ~V~ View Post
Code:
class GodlandCommand : ICommand
    {
        public string Command { get { return "godland"; } }
        public int RequiredRank { get { return 0; } }


        public void Execute(Player player, string[] args)
        {
            if (args.Length > 0) 
            {
                player.SendHelp("Usage: /godland"); 
            }
            else
            {
                int x, y;
                try
                {
                    x = 1000;
                    y = 1000;
                }
                catch
                {
                    player.SendError("Invalid coordinates!");
                    return; 
                }
                player.Move(x + 0.5f, y + 0.5f);
                player.SetNewbiePeriod();
                player.UpdateCount++;
                player.Owner.BroadcastPacket(new GotoPacket()
                {
                    ObjectId = player.Id,
                    Position = new Position()
                    {
                        X = player.X,
                        Y = player.Y
                    }
                }, null); 
            }
        }
    }
That should work

Exactly, wasn't much to edit
Quote Originally Posted by ~V~ View Post
Code:
class GodlandCommand : ICommand
    {
        public string Command { get { return "godland"; } }
        public int RequiredRank { get { return 0; } }


        public void Execute(Player player, string[] args)
        {
            if (args.Length > 0) 
            {
                player.SendHelp("Usage: /godland"); 
            }
            else
            {
                int x, y;
                try
                {
                    x = 1000;
                    y = 1000;
                }
                catch
                {
                    player.SendError("Invalid coordinates!");
                    return; 
                }
                player.Move(x + 0.5f, y + 0.5f);
                player.SetNewbiePeriod();
                player.UpdateCount++;
                player.Owner.BroadcastPacket(new GotoPacket()
                {
                    ObjectId = player.Id,
                    Position = new Position()
                    {
                        X = player.X,
                        Y = player.Y
                    }
                }, null); 
            }
        }
    }
That should work
Thanks I'll try it in a bit

- - - Updated - - -

Quote Originally Posted by ~V~ View Post
Code:
class GodlandCommand : ICommand
    {
        public string Command { get { return "godland"; } }
        public int RequiredRank { get { return 0; } }


        public void Execute(Player player, string[] args)
        {
            if (args.Length > 0) 
            {
                player.SendHelp("Usage: /godland"); 
            }
            else
            {
                int x, y;
                try
                {
                    x = 1000;
                    y = 1000;
                }
                catch
                {
                    player.SendError("Invalid coordinates!");
                    return; 
                }
                player.Move(x + 0.5f, y + 0.5f);
                player.SetNewbiePeriod();
                player.UpdateCount++;
                player.Owner.BroadcastPacket(new GotoPacket()
                {
                    ObjectId = player.Id,
                    Position = new Position()
                    {
                        X = player.X,
                        Y = player.Y
                    }
                }, null); 
            }
        }
    }
That should work
Used exact same command and tried editing it a bit to try to fix it but all that happens is it repeats in the chat /godlands after you use the command. What do I do? I knew it wasn't as easy as that. :P

- - - Updated - - -

Quote Originally Posted by ~V~ View Post
Code:
class GodlandCommand : ICommand
    {
        public string Command { get { return "godland"; } }
        public int RequiredRank { get { return 0; } }


        public void Execute(Player player, string[] args)
        {
            if (args.Length > 0) 
            {
                player.SendHelp("Usage: /godland"); 
            }
            else
            {
                int x, y;
                try
                {
                    x = 1000;
                    y = 1000;
                }
                catch
                {
                    player.SendError("Invalid coordinates!");
                    return; 
                }
                player.Move(x + 0.5f, y + 0.5f);
                player.SetNewbiePeriod();
                player.UpdateCount++;
                player.Owner.BroadcastPacket(new GotoPacket()
                {
                    ObjectId = player.Id,
                    Position = new Position()
                    {
                        X = player.X,
                        Y = player.Y
                    }
                }, null); 
            }
        }
    }
That should work
Okay I figured something out. When I do /godland x y with any number it sends me to 1000 1000. But I would rather have it just be /godland and I don't need to type in x and y.
or u can just change the /tp command to only work if u type in /tp 1000 1000 which are the coordinates of middle of glands;p
Code:
class GodlandCommand : ICommand
    {
        public string Command { get { return "godland"; } }
        public int RequiredRank { get { return 0; } }

        public void Execute(Player player, string[] args)
        {
            if (args.Length == 0) 
            {
                player.Move(1000, 1000);
                player.SetNewbiePeriod();
                player.UpdateCount++;
                player.Owner.BroadcastPacket(new GotoPacket()
                {
                    ObjectId = player.Id,
                    Position = new Position()
                    {
                        X = player.X,
                        Y = player.Y
                    }
                }, null); 
                
            }
            else
            {
                player.SendHelp("Usage: /godland"); 
            }
        }
    }
I'm on my phone so i can't help you that much but try that one
Quote Originally Posted by ~V~ View Post
Code:
class GodlandCommand : ICommand
    {
        public string Command { get { return "godland"; } }
        public int RequiredRank { get { return 0; } }

        public void Execute(Player player, string[] args)
        {
            if (args.Length == 0) 
            {
                player.Move(1000, 1000);
                player.SetNewbiePeriod();
                player.UpdateCount++;
                player.Owner.BroadcastPacket(new GotoPacket()
                {
                    ObjectId = player.Id,
                    Position = new Position()
                    {
                        X = player.X,
                        Y = player.Y
                    }
                }, null); 
                
            }
            else
            {
                player.SendHelp("Usage: /godland"); 
            }
        }
    }
I'm on my phone so i can't help you that much but try that one
That worked perfectly! Thanks bro. Perhaps add me on skype? My username is danteventura90.
Posts 1–9 of 9 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us