ItsMods

Full Version: FOV Plugin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5
Chicken
It will always tell the player that its invalid coz its outside the catch brackets Wink
(01-06-2012, 12:14)iAegle Wrote: [ -> ]It will always tell the player that its invalid coz its outside the catch brackets Wink

[Image: nope.avi.jpg]
Try it.
Very brave
Well, i'd rather have one that's always activated without using chatcommands, but okay, here you go
(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.
noshit sherlock
how activateit without using chatcommands ?
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:

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;
    }
    }
    }
Pages: 1 2 3 4 5