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
Rainbow How can i add my private server in unranked? Geded12 5 2,928 06-21-2025, 08:34
Last Post: Akash12
  [Release] Windows 8.1 Fix for MW3 Server Addon master131 16 20,524 09-29-2014, 23:08
Last Post: SuperNovaAO
  Help Android problem Yamato 12 9,254 04-25-2014, 04:49
Last Post: ScHmIdTy56789
Brick [Release] MW3 Server Administration Addon iRoNinja 5 9,491 11-10-2013, 15:46
Last Post: Casper
Exclamation Help cmdlist, dvarlist server crash Nerus 17 13,083 11-09-2013, 23:54
Last Post: Nerus
Wink Plugin with !ban !kick and !tampban clemi555 3 4,543 11-09-2013, 09:21
Last Post: clemi555
  AntiNoScope Plugin clemi555 5 5,216 11-08-2013, 19:13
Last Post: clemi555
  Our Level Fastfile is Different from the Server. CheeseToast 6 12,067 11-03-2013, 17:52
Last Post: CheeseToast
  Dedicated Server External (public) IP Nerus 3 6,450 11-02-2013, 14:16
Last Post: Casper
  [Release] Bunker Plugin 1.3 archit 68 45,312 10-30-2013, 11:59
Last Post: clacki

Forum Jump:


Users browsing this thread:
1 Guest(s)

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