01-21-2012, 06:02
UPDATED
MW3 Addon Plugin Pack 1This was a pack based on @JariZ code, I recreated(recoded) this pack for the newest version of MW3 server addon
How to install?
Copy the DLL to MW3 Server\plugins
Sourcecode
- This code is supposed to be used to help you start creating your own plugin, so re-rereleasing any of this code without a significant change is strictly forbidden
- When used, my credits must be included
- Have fun coding!
Requirements
- (THE NEWEST VERSION OF) Nukem's MW3 Server Addon
- MW3 Ded. Server
This pack includes
- FOV
Changes FOV and FOVscale for every client in the server,
fov defaults to 80, fovscale to 1.0
Add this to addon\sv_config.ini in order to use a custom value for the fov amount:
Where '80' is your amount of FOV and '1.125' your FOVscale offcourseCode:[FOV]
fov=80
fovscale=1.125
- Welcomer
Says 'Everybody welcome PLAYERNAME to the server!'
Don't know how it's useful, just makes your server looks awesome i think
- PlayerLog
Logs all players who connect to the server in addon\logs\player.log
It logs: Client ID, Name, XUID and Ping (at time of connection)
Useful if you want to report someone or just find out who connected to your server.
Credits
-@Tylerd86(Coding)
- @JariZ (Orginal codes and coding)
- @Nukem (Addon)
Plugin source code
Spoiler (Click to View)
Welcomer
Fov
PlayerLog
Code:
using System;
using Addon;
namespace plugin_test
{
public class plugin_test : CPlugin
{
public override void OnServerLoad()
{
ServerPrint("Welcomer plugin by Tylerd86 loaded!");
}
public override void OnPlayerConnect(ServerClient Client)
{
ServerSay("^7Welcomer: ^2Everyone welcome ^3" + Client.Name + " ^2to the server!", true);
}
}
}
Code:
using System;
using Addon;
namespace fov
{
public class fov : CPlugin
{
public override void OnServerLoad()
{
ServerPrint("Fov plugin loaded! by Tylerd86 & JariZ");
}
public override void OnPlayerConnect(ServerClient Client)
{
SetClientDvar(Client.ClientNum, string.Format("cg_fov \"{0}\"", GetServerCFG("FOV", "fov", "80")));
SetClientDvar(Client.ClientNum, string.Format("cg_fovscale \"{0}\"", GetServerCFG("FOV", "fovscale", "1.125")));
}
}
}
Code:
using System;
using Addon;
using System.IO;
namespace PlayerLog
{
public class PlayerLog : CPlugin
{
string logpath = "addon\\logs\\player.log";
public override void OnServerLoad()
{
ServerPrint("PlayerLog loaded! by Tylerd86 & JariZ :D");
}
void writeCollumns()
{
StreamWriter rw = new StreamWriter(logpath, false);
rw.WriteLine("NUM NAME XUID RATE PING");
rw.Close();
}
public override void OnPlayerConnect(ServerClient Client)
{
try
{
if (File.Exists(logpath))
{
writeCollumns();
if (File.ReadAllText(logpath) == string.Empty)
writeCollumns();
}
StreamWriter sr = new StreamWriter(logpath, true);
sr.WriteLine(Client.ClientNum + " " + Client.Name + " " + Client.XUID + " " + Client.Rate + " " + Client.Ping);
sr.Close();
}
catch (Exception z) { ServerPrint("[PLAYERLOG] " + z.ToString()); }
}
}
}
Temporary Playerlog Fix
[attachment=1794]
Example:
Spoiler (Click to View)
Code:
0 Tylerd86 01100001010d0000 25000 120
NUM NAME XUID RATE PING
0 Tylerd86 01100001010d0000 25000 254