ItsMods

Full Version: fov changer
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Can someone make a fov changer with cg_gun_x -7 and fovscale 1.125
Use example code and put "SetDvar" in it or just use Plugin Maker program.
(05-18-2014, 11:57)SailorMoon Wrote: [ -> ]Use example code and put "SetDvar" in it or just use Plugin Maker program.

I want that every player can choose his fov.
And if i use this code from zxz0O0 and change fovscale nothing happens[/code]

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 \" 90 \"");
                                SetClientDvar(Client.ClientNum, "cg_fovscale \"" + fovscale + "\"");
                            }
                            else
                            {
                                SetClientDvar(Client.ClientNum, "cg_fov \"" + split[1] + "\"");
                                SetClientDvar(Client.ClientNum, "cg_fovscale \"1.125\"");
                            }

                            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;
        }
    }
}
SetClientDvar is not working anymore. You can use FOV Changers but they could react like cheats so "Hello, VAC!".
(05-18-2014, 18:17)SailorMoon Wrote: [ -> ]SetClientDvar is not working anymore. You can use FOV Changers but they could react like cheats so "Hello, VAC!".
the fov changer from promod plugin still works fine
(05-18-2014, 18:17)SailorMoon Wrote: [ -> ]SetClientDvar is not working anymore. You can use FOV Changers but they could react like cheats so "Hello, VAC!".

Would be more like, hey VAC don't mind me Troll

Thanks Barata...
setclientdvar works with fov tho, no problem
(05-18-2014, 20:23)barata Wrote: [ -> ]
(05-18-2014, 18:17)SailorMoon Wrote: [ -> ]SetClientDvar is not working anymore. You can use FOV Changers but they could react like cheats so "Hello, VAC!".

Would be more like, hey VAC don't mind me Troll

Thanks Barata...

Simply changing the value of the variable (which should be in Read/Write memory (not execute or just read)) is no problem at all with VAC2. Sometimes Valve decides to be a dick though and blacklists the process that does write the variable so changing the variable and then kill the program that did this for you before joining a server is a good idea.