01-06-2012, 12:04
01-06-2012, 12:11
01-06-2012, 12:14
It will always tell the player that its invalid coz its outside the catch brackets
01-06-2012, 12:17
(01-06-2012, 12:14)iAegle Wrote: [ -> ]It will always tell the player that its invalid coz its outside the catch brackets
Try it.
01-06-2012, 12:22
Very brave
01-06-2012, 13:14
Well, i'd rather have one that's always activated without using chatcommands, but okay, here you go
01-06-2012, 14:52
(01-06-2012, 13:14)jariz Wrote: [ -> ]Well, i'd rather have one that's always activated without using chatcommands, but okay, here you go
You only need to type it once and besides not everyone likes fov 90. Your plugin doesn't work btw.
01-06-2012, 15:01
noshit sherlock
01-08-2012, 13:40
how activateit without using chatcommands ?
01-08-2012, 15:31
This does not work correctly, when you use the command it changes the FOV, however it also changes so when you ADS it does not zoom in. This is a problem with snipers. I think its because you used cg_fovmin instead of cg_fov.
EDIT: Just tested, this is a edited properly working version:
EDIT: Just tested, this is a edited properly working version:
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)
{
SetClientDvar(Client.ClientNum, "cg_fov \"" + split[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.ChatAll;
}
}
}