ItsMods

Full Version: ERROR STRING
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Code:
string mapname;

                    if (Message == "!map " + mapname)
                    {
                        ServerCommand("map " + mapname);
                    }
and i get error Use of unassibled local variable mapname.

i dont want full source but guide on howto fix ive heard that i can do
string mapname = String.Empty; im not sure if it will work tho
Code:
if(Message.SubString(0, 4) == "!map") ServerCommand("map "+Message.SubString(4));
Thanks ill try it

Still errors
Code:
Error    14    'string' does not contain a definition for 'SubString' and no extension method 'SubString' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?)    C:\mw3server\plugins\Class1.cs    204
im sorry im not good with C#
woops, that should be 'Substring' instead of 'SubString'