[Request]Organized chat.cs?

03/06/2013 19:45 nTL3fTy#16
Quote:
Originally Posted by pro4never View Post
One cannot be 'both' a GM and a PM.
You simply add both tags to your name: [GM]Pro4Never[PM]. Common sense. ;)
03/06/2013 19:54 xScylez#17
Quote:
Originally Posted by nTL3fTy View Post
You simply add both tags to your name: [GM]Pro4Never[PM]. Common sense. ;)
Correct me if i'm wrong, but Pro4Never is right! You can't be both GM and PM...
If your in game name was [GM]Pro4Never[PM], the [PM] would be the status "tag?", and the first [GM] would just be a part of your character name. :-)
03/07/2013 00:29 pro4never#18
Quote:
Originally Posted by xScylez View Post
Correct me if i'm wrong, but Pro4Never is right! You can't be both GM and PM...
If your in game name was [GM]Pro4Never[PM], the [PM] would be the status "tag?", and the first [GM] would just be a part of your character name. :-)
He's just joking around.

It's in reference to horribly written sources that check your permission based on a tag in your name versus a proper enumerated value to handle player permissions (banned, player, moderator, gm, pm, donator, etcetc). You can then handle all commands, features and such through a single value.
03/07/2013 00:40 shadowman123#19
you should check players Depending on their Account state not their Name
03/07/2013 09:34 xScylez#20
Well, anyways... I still haven't figured out this error :(

Code:
The name "Cmd" does not exist in the current context

Here is an example where the error comes:
Code:
case "/robot":
                    {
                        string Account = "";
                        string Name = Cmd[1];

                        if (Game.World.CharacterFromName(Name) == null)
                        {
                            Game.Robot R = Database.LoadAsRobot(Name, ref Account);
                            if (R != null)
                                R.Init(Account);
                        }
                        return true;
                    }
On the
Code:
string Name = Cmd[1];
, i have the error on "Cmd" does not exist..
Could someone please help me out? :-)
03/07/2013 14:33 EgyptianMano#21
Quote:
Originally Posted by xScylez View Post
Well, anyways... I still haven't figured out this error :(

Code:
The name "Cmd" does not exist in the current context
On the
Code:
string Name = Cmd[1];
, i have the error on "Cmd" does not exist..
Could someone please help me out? :-)
string[] Cmd = Message.Split(' ');
03/07/2013 18:47 xScylez#22
Quote:
Originally Posted by EgyptianMano View Post
string[] Cmd = Message.Split(' ');
Thanks! Well, it removes the Cmd error, but then i get a error:
Code:
The name 'Message' does not exist in the current context
03/07/2013 19:14 nTL3fTy#23
It's obvious you don't have a clue what you're doing and should not be trying to modify whatever source this is. You need to start a lot smaller than a Conquer server and learn the basics of programming.
03/07/2013 19:51 pro4never#24
Quote:
Originally Posted by nTL3fTy View Post
It's obvious you don't have a clue what you're doing and should not be trying to modify whatever source this is. You need to start a lot smaller than a Conquer server and learn the basics of programming.
+1

I already explained this all to him via PM. Learn the absolute basics of programming before anything else.
03/07/2013 20:02 xScylez#25
well, it may be that is true! But anyways, i am making this for having fun with friends, and see how coding works and stuff..
Had 94 errors, stuck with 4 left, and all of them are this code:
Code:
string[] Cmd = Message.Split(' ');
Code:
The name 'Message' does not exist in the current context
03/07/2013 22:26 Lateralus#26
Quote:
Originally Posted by xScylez View Post
well, it may be that is true! But anyways, i am making this for having fun with friends, and see how coding works and stuff..
Had 94 errors, stuck with 4 left, and all of them are this code:
Code:
string[] Cmd = Message.Split(' ');
Code:
The name 'Message' does not exist in the current context
You aren't really seeing how code works at all, because fixing this teeters on common sense.

You don't have a variable named Message in the scope of where you're using it.
03/07/2013 23:32 xScylez#27
Quote:
Originally Posted by Lateralus View Post
You aren't really seeing how code works at all, because fixing this teeters on common sense.

You don't have a variable named Message in the scope of where you're using it.
Hmm, so in this case:

Code:
case "/robot":
                    {
                        string Account = "";
                        string Name = Cmd[1];

                        if (Game.World.CharacterFromName(Name) == null)
                        {
                            Game.Robot R = Database.LoadAsRobot(Name, ref Account);
                            if (R != null)
                                R.Init(Account);
                        }
                        return true;
                    }
The error is at Cmd, when i add the code, i get error at message..

Should it be like this then:
Code:
case "/robot":
                    {
                        string[] Cmd;
                        string Account = "";
                        string Name = Cmd[1];

                        if (Game.World.CharacterFromName(Name) == null)
                        {
                            Game.Robot R = Database.LoadAsRobot(Name, ref Account);
                            if (R != null)
                                R.Init(Account);
                        }
                        return true;
                    }
or will the code
Code:
string[] Cmd;
ruin it?
03/07/2013 23:57 pro4never#28
Quote:
Originally Posted by xScylez View Post
Hmm, so in this case:

Code:
case "/robot":
                    {
                        string Account = "";
                        string Name = Cmd[1];

                        if (Game.World.CharacterFromName(Name) == null)
                        {
                            Game.Robot R = Database.LoadAsRobot(Name, ref Account);
                            if (R != null)
                                R.Init(Account);
                        }
                        return true;
                    }
The error is at Cmd, when i add the code, i get error at message..

Should it be like this then:
Code:
case "/robot":
                    {
                        string[] Cmd;
                        string Account = "";
                        string Name = Cmd[1];

                        if (Game.World.CharacterFromName(Name) == null)
                        {
                            Game.Robot R = Database.LoadAsRobot(Name, ref Account);
                            if (R != null)
                                R.Init(Account);
                        }
                        return true;
                    }
or will the code
Code:
string[] Cmd;
ruin it?

We've answered this for you like 5 times...


In the context of this thread, Message is a string (text) variable holding a chat message that the player has sent.

Msg is referring to a .Split version of the Message string (stored as an array of strings)

your errors are literally saying that "You never declared a variable called Msg and now you're trying to use it. What is it, what does it contain!?"



So yes... look at the very top of your switch statement and you'll see what your source calls the chat command being processed (split or otherwise)

You now know what the variable is called and can fix your broken-ass code to reference the right variable. 0 errors as they are all the same problem..
03/08/2013 00:26 xScylez#29
Quote:
Originally Posted by pro4never View Post
We've answered this for you like 5 times...


In the context of this thread, Message is a string (text) variable holding a chat message that the player has sent.

Msg is referring to a .Split version of the Message string (stored as an array of strings)

your errors are literally saying that "You never declared a variable called Msg and now you're trying to use it. What is it, what does it contain!?"



So yes... look at the very top of your switch statement and you'll see what your source calls the chat command being processed (split or otherwise)

You now know what the variable is called and can fix your broken-ass code to reference the right variable. 0 errors as they are all the same problem..
WOOOAAH! I don't understand what i'm doing wrong :(
Have been trying to remove the "Message" error for an hour now :/
03/08/2013 05:12 lostsolder05#30
Quote:
Originally Posted by xScylez View Post
WOOOAAH! I don't understand what i'm doing wrong :(
Have been trying to remove the "Message" error for an hour now :/
public static bool PmandGMCommand(Main.GameClient GC, string[] Msg)
{
string[] Cmd = Message.Split(' ');

Message is undeclared you're using Msg in your bool... :rolleyes: