Problem with compiling mw3 server plugin
#1
Hi guys,
I want to change team names
I write this code in C# but show same error in error list (Error1 A namespace cannot directly contain members such as fields or methods)

Code:
SetDvar("g_teamname_allies", "^2OTHERS"); SetDvar("g_teamname_axis", "^1H^7e^1R^7o^1S");
can anyone compile this code ?
sorry for my bad englishBlush
tnx

#2
(08-08-2012, 06:56)king_siavash Wrote: Hi guys,
I want to change team names
I write this code in C# but show same error in error list (Error1 A namespace cannot directly contain members such as fields or methods)

Code:
SetDvar("g_teamname_allies", "^2OTHERS"); SetDvar("g_teamname_axis", "^1H^7e^1R^7o^1S");
can anyone compile this code ?
sorry for my bad englishBlush
tnx

it looks like you have defined a namespace and directly a method inside that.. You mustn't do that.

Here is a Example on how a Plugin should look like (main class):

Code:
using System; using System.Collections.Generic; using System.Text; using Addon; namespace YourNameSpace { //Classes here public class YourClass : CPlugin { //Methods/Variables here public string justAVariable = "test"; public override void OnMapChange() { SetDvar("g_teamname_allies", "^2OTHERS"); SetDvar("g_teamname_axis", "^1H^7e^1R^7o^1S"); } } }



Possibly Related Threads…
Thread Author Replies Views Last Post
Wink Plugin with !ban !kick and !tampban clemi555 3 6,593 11-09-2013, 09:21
Last Post: clemi555
  AntiNoScope Plugin clemi555 5 7,723 11-08-2013, 19:13
Last Post: clemi555
  Our Level Fastfile is Different from the Server. CheeseToast 6 15,642 11-03-2013, 17:52
Last Post: CheeseToast
  Dedicated Server External (public) IP Nerus 3 9,636 11-02-2013, 14:16
Last Post: Casper
  MW3 Server Version superg1973 7 17,605 10-28-2013, 01:15
Last Post: kotyra972
  Problem with Rain Effects on Maps mitchhacker 5 7,627 10-22-2013, 00:46
Last Post: mitchhacker
  Help Modifying plugin maverigh 5 7,767 10-19-2013, 10:29
Last Post: Nekochan
Shocked [Request] Switch plugin axel-le-meilleur 6 8,444 10-19-2013, 06:59
Last Post: iRoNinja
  Help how to turn off map in dedicated server pero123 8 9,710 10-15-2013, 19:00
Last Post: Nekochan
  Issue with server addon and NAT dimitrifrom31 3 8,226 10-08-2013, 18:11
Last Post: iRoNinja

Forum Jump:


Users browsing this thread:
1 Guest(s)

Powered By MyBB, © 2002-2026 Melroy van den Berg.