Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with compiling mw3 server plugin
08-08-2012, 06:56
Post: #1
Problem with compiling mw3 server plugin
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
Related links
Find all posts by this user
Add Thank You Quote this message in a reply
08-08-2012, 17:22
Post: #2
RE: Problem with compiling mw3 server plugin
(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. }
Find all posts by this user
Add Thank You Quote this message in a reply
[-] The following 2 users say Thank You to Deviler86 for this post:
d0h! (08-09-2012), JariZ (08-08-2012)
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  How to set up your own modded server with server addon for supernoobs JariZ 93 13,459 04-28-2013 09:27
Last Post: odok
  [Release] MW3 Server Addon zxz0O0 184 23,149 04-26-2013 12:29
Last Post: hillbilly
  [Release] Plugin Source Codes SirGravzy 9 542 04-20-2013 05:56
Last Post: koil
  Help I need this plugin ss345 2 157 04-12-2013 17:29
Last Post: SailorMoon
  Promod Plugin 1.7 Quarkclan 1 113 04-11-2013 10:29
Last Post: archit
  warning problem AndEEDJay 0 66 04-08-2013 09:54
Last Post: AndEEDJay
  Help Server Addons morha12 2 206 03-27-2013 13:31
Last Post: SailorMoon
  Server addon & plugins pflaurie 5 398 03-19-2013 03:31
Last Post: hillbilly
  Help Hosted server pflaurie 1 168 02-27-2013 21:14
Last Post: hillbilly
  Help my plugin has bugs, help EnVi Sweden Rocks 8 239 02-13-2013 12:58
Last Post: EnVi Sweden Rocks

Forum Jump:


User(s) browsing this thread: 1 Guest(s)
Media Embeding by Simple Audio Video Embeder