Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Request fov changer
#1
Can someone make a fov changer with cg_gun_x -7 and fovscale 1.125
Reply

#2
Use example code and put "SetDvar" in it or just use Plugin Maker program.
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#3
(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;
        }
    }
}
Reply

#4
SetClientDvar is not working anymore. You can use FOV Changers but they could react like cheats so "Hello, VAC!".
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#5
(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
Reply

#6
(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...
Don't worry if things aren't the way you planned, in the end everything will solve itself...
Reply

#7
setclientdvar works with fov tho, no problem
Reply

#8
(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.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.