Hello guys
This is my fov plugin. Every player can change his fov to a number between 65 - 90.
Example: !fov 80
Requires @Nukem's dedicated server addon V1.190+
Source:
Thanks zxz...
This is my fov plugin. Every player can change his fov to a number between 65 - 90.
Example: !fov 80
Requires @Nukem's dedicated server addon V1.190+
Source:
Code:
using System;
using Addon;
namespace MW3_FOV
{
public class zxz_FOVPlugin : CPlugin
{
public override void OnServerLoad()
{
ServerPrint("\n FOV Plugin loaded \n Author: zxz0O0 \n Thanks to Nukem, Jariz, Pozzuh\n");
}
public override ChatType OnSay(string Message, ServerClient Client)
{
if (Message.StartsWith("!fov"))
{
string[] split = Message.Split(' ');
try
{
int num;
bool isNum = int.TryParse(split[1], out num);
if (split.Length == 2 && isNum)
{
if (Convert.ToInt32(split[1]) <= 90 && Convert.ToInt32(split[1]) >= 65)
{
if (Convert.ToInt32(split[1]) <= 90 && Convert.ToInt32(split[1]) > 80)
{
Int32 fov = Convert.ToInt32(split[1]);
float fovscale = (float)fov / 80;
SetClientDvar(Client.ClientNum, "cg_fov \" 80 \"");
SetClientDvar(Client.ClientNum, "cg_fovscale \"" + fovscale + "\"");
}
else
{
SetClientDvar(Client.ClientNum, "cg_fov \"" + split[1] + "\"");
SetClientDvar(Client.ClientNum, "cg_fovscale \"1\"");
}
TellClient(Client.ClientNum, "PM: FOV changed to " + split[1] + ", default value is 65", true);
}
else
TellClient(Client.ClientNum, "PM: Invalid parameter. Usage: !fov <fov 65-90>", true);
return ChatType.ChatNone;
}
}
catch
{ }
TellClient(Client.ClientNum, "PM: Invalid parameter. Usage: !fov <fov 65-90>", true);
return ChatType.ChatNone;
}
return ChatType.ChatContinue;
}
}
}Thanks zxz...



![[Image: nope.avi.jpg]](http://www.enchantedbros.com/images/nope.avi.jpg)