Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help ERROR STRING
#1
Question 
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
Reply

#2
Code:
if(Message.SubString(0, 4) == "!map") ServerCommand("map "+Message.SubString(4));
Reply

#3
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#
Reply

#4
woops, that should be 'Substring' instead of 'SubString'
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Help Getting string from perk? DidUknowiPwn 3 3,322 09-27-2013, 19:10
Last Post: Nekochan
  Help error when run mod mr.apple 9 6,638 09-24-2013, 21:49
Last Post: Nekochan
  Help COD mw3 Error Couln't load image 3_cursor3:s Paylgs 2 14,291 07-18-2013, 18:46
Last Post: Nekochan
  Mod Error! help please Brandeeno 2 4,059 07-11-2013, 21:06
Last Post: Brandeeno
  Help xkmod error Domino29 2 4,455 07-11-2013, 20:07
Last Post: Brandeeno
  Help mw3 addon error [HARD] Tony. 2 4,473 06-08-2013, 00:32
Last Post: master131
  Help Freaking weird error when starting server!!!! Misterio 5 4,947 04-23-2013, 01:47
Last Post: Misterio
  d3d9 error magnuze 3 4,345 04-09-2013, 14:26
Last Post: NyZzE
  Help Server Script Compile Error when loading ExtremeBunkerMaker lolmoon 3 3,928 04-09-2013, 03:11
Last Post: lolmoon
  error CheGuevara 2 2,925 04-07-2013, 17:39
Last Post: CheGuevara

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.