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

#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):

CSHARP Code
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using Addon;
  5.  
  6. namespace YourNameSpace
  7. {
  8. //Classes here
  9. public class YourClass : CPlugin
  10. {
  11. //Methods/Variables here
  12. public string justAVariable = "test";
  13.  
  14. public override void OnMapChange()
  15. {
  16. SetDvar("g_teamname_allies", "^2OTHERS");
  17. SetDvar("g_teamname_axis", "^1H^7e^1R^7o^1S");
  18. }
  19. }
  20. }
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [Release] Windows 8.1 Fix for MW3 Server Addon master131 16 18,202 09-29-2014, 23:08
Last Post: SuperNovaAO
  Help Android problem Yamato 12 8,185 04-25-2014, 04:49
Last Post: ScHmIdTy56789
Brick [Release] MW3 Server Administration Addon iRoNinja 5 9,015 11-10-2013, 15:46
Last Post: Casper
Exclamation Help cmdlist, dvarlist server crash Nerus 17 11,920 11-09-2013, 23:54
Last Post: Nerus
Wink Plugin with !ban !kick and !tampban clemi555 3 4,168 11-09-2013, 09:21
Last Post: clemi555
  AntiNoScope Plugin clemi555 5 4,748 11-08-2013, 19:13
Last Post: clemi555
  Our Level Fastfile is Different from the Server. CheeseToast 6 11,327 11-03-2013, 17:52
Last Post: CheeseToast
  Dedicated Server External (public) IP Nerus 3 5,903 11-02-2013, 14:16
Last Post: Casper
  [Release] Bunker Plugin 1.3 archit 68 41,572 10-30-2013, 11:59
Last Post: clacki
  MW3 Server Version superg1973 7 12,755 10-28-2013, 01:15
Last Post: kotyra972

Forum Jump:


Users browsing this thread:
1 Guest(s)

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