01-09-2012, 20:42
hi there,
i git some questions i want to create my own plugin for the awsome mw3 server addon i startet with coding but i dont know how i can create a dll with this code with visual studio.. what must i do pls help a little noob..
My idea is a working war plugin like short chat text elements to control the server like: !fr -> fast_restart, !mr -> map_restart, !mr10 ->roundlimit 10, !map alpha -> map mp_alpha and so on...
Pls take a look i just copied the code from iAegle and changed the way it might be working for me:
using System;
using System.Collections.Generic;
using Addon;
namespace plugin_test
{
public class plugin_test : CPlugin
{
List<string> admins = new List<string>();
bool disable = false;
public override ChatType OnSay(string Message, ServerClient Client)
{
if (disable)
return ChatType.ChatAll;
if (Message.StartsWith("!fr") && admins.Contains(Client.XUID))
{
if (Message.Length <= 6)
TellClient(Client.ClientNum, "^2Admin: ^3Usage: [COMMAND]", true);
else
{
string cmd = Message.Substring(6);
ServerPrint(Client.Name + " used Admin command: \"" + cmd + "\"");
ServerCommand(fast_restart);
}
return ChatType.ChatNone;
}
return ChatType.ChatAll;
}
public override void OnServerLoad()
{
string l = GetServerCFG("RCON", "Admin_xuids", "");
if (l == "")
foreach (string xuid in l.Split(','))
admins.Add(xuid);
if (admins.Count == 0)
disable = true;
ServerPrint("Ingame RCON loaded. Author: M@C. Version: 1.0");
}
}
}
this i entered in visual studio but i cant create a working dll with this...
Pls Help a Noob
Greetz M@C
i git some questions i want to create my own plugin for the awsome mw3 server addon i startet with coding but i dont know how i can create a dll with this code with visual studio.. what must i do pls help a little noob..
My idea is a working war plugin like short chat text elements to control the server like: !fr -> fast_restart, !mr -> map_restart, !mr10 ->roundlimit 10, !map alpha -> map mp_alpha and so on...
Pls take a look i just copied the code from iAegle and changed the way it might be working for me:
using System;
using System.Collections.Generic;
using Addon;
namespace plugin_test
{
public class plugin_test : CPlugin
{
List<string> admins = new List<string>();
bool disable = false;
public override ChatType OnSay(string Message, ServerClient Client)
{
if (disable)
return ChatType.ChatAll;
if (Message.StartsWith("!fr") && admins.Contains(Client.XUID))
{
if (Message.Length <= 6)
TellClient(Client.ClientNum, "^2Admin: ^3Usage: [COMMAND]", true);
else
{
string cmd = Message.Substring(6);
ServerPrint(Client.Name + " used Admin command: \"" + cmd + "\"");
ServerCommand(fast_restart);
}
return ChatType.ChatNone;
}
return ChatType.ChatAll;
}
public override void OnServerLoad()
{
string l = GetServerCFG("RCON", "Admin_xuids", "");
if (l == "")
foreach (string xuid in l.Split(','))
admins.Add(xuid);
if (admins.Count == 0)
disable = true;
ServerPrint("Ingame RCON loaded. Author: M@C. Version: 1.0");
}
}
}
this i entered in visual studio but i cant create a working dll with this...
Pls Help a Noob
Greetz M@C