Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help MW3 HighJump speed plugin broken?
#1
OK I've had my server up and running for a long time now and for some reason the speed plugin is messed up now everything has been working just fine and 2 days ago something happened and now as soon as you press w a s or d you zoom off and get all glitchy everything around you is black and your weapon is messed up so i removed the plugin thinking it got corrupted and the server is fine but you walk and run normal so i reinstalled the original speed plugin i had saved on my computer and it goes back to being messed up and unplayable. So does anyone have or has anyone had this problem and know how to fix it?
[Image: b_560_95_1.png]
Reply

#2
You should post this in the plugin post Wink
[Image: b_560_95_1.png]
[Image: hax0r3ez.gif]
Reply

#3
(02-15-2013, 17:04)MADD_DOGG Wrote: OK I've had my server up and running for a long time now and for some reason the speed plugin is messed up now everything has been working just fine and 2 days ago something happened and now as soon as you press w a s or d you zoom off and get all glitchy everything around you is black and your weapon is messed up so i removed the plugin thinking it got corrupted and the server is fine but you walk and run normal so i reinstalled the original speed plugin i had saved on my computer and it goes back to being messed up and unplayable. So does anyone have or has anyone had this problem and know how to fix it?

I update the speedplugin myself and I don't have any problems. I think it's because it's using the wrong offsets.

Here's my code with the current offsets.
Code:
using System;
using System.Runtime.InteropServices;
using Addon;
using System.Net;

namespace ReadyUP
{
    public class Class1 : CPlugin
    {
        string cur_version = "";
        string update_message = "";

        int g_speed_var = 0;
        float jump_height_var = 0;
        int fall_damage_var = 0;
        int gravity_var = 0;
        bool fall_damage_enabled = true;

        IntPtr g_speed, jump_height, fallmax, fallmin, g_gravity;

        [DllImport("kernel32.dll")]
        private static extern bool VirtualProtect(IntPtr lpAddress, uint dwSize, uint flNewProtect, out uint lpflOldProtect);

        unsafe public bool getOffsets()
        {
            //version,g_speed,jump_height,fallmax,fallmin,g_gravity,update message
            try
            {
                WebClient wc = new WebClient();
                string download = "1.9.461,0x046F3D7,0x0787CC8,0x0787908,0x076F044,0x047036C,LOL";
                string[] downloads = download.Split(',');

                cur_version = downloads[0];
                g_speed = (IntPtr)Convert.ToInt32(downloads[1], 16);
                jump_height = (IntPtr)Convert.ToInt32(downloads[2], 16);
                fallmax = (IntPtr)Convert.ToInt32(downloads[3], 16);
                fallmin = (IntPtr)Convert.ToInt32(downloads[4], 16);
                g_gravity = (IntPtr)Convert.ToInt32(downloads[5], 16);
                update_message = downloads[6];

                /*if (cur_version != GetDvar("shortversion"))
                {
                    ServerPrint("Speed plugin outdated, wait patiently for an update!");
                    ServerPrint("Current server version: " + GetDvar("shortversion") + ". Current speed plugin offset version: " + cur_version);
                    return false;
                }*/

                ServerPrint("Speed plugin for version " + cur_version.ToString() + " loaded. Author: Pozzuh.");

                if (update_message != "-1")
                    ServerPrint(update_message);

                return true;
            }
            catch (Exception e)
            {
                ServerPrint("Speed plugin couldn't load. Error written to log.");
                ServerLog(LogType.LogConsole, "SPEED PLUGIN ERROR: " + e.ToString());

                if (update_message != "-1")
                    ServerPrint(update_message);

                return false;
            }
        }

        unsafe public override void OnServerLoad()
        {
            if (!getOffsets())
                return;

            if (GetServerCFG("SPEEDPLUGIN", "Speed", "-1") == "-1")
                SetServerCFG("SPEEDPLUGIN", "Speed", "190");
            if (GetServerCFG("SPEEDPLUGIN", "JumpHeight", "-1") == "-1")
                SetServerCFG("SPEEDPLUGIN", "JumpHeight", "39");
            if (GetServerCFG("SPEEDPLUGIN", "FallDamage", "-1") == "-1")
                SetServerCFG("SPEEDPLUGIN", "FallDamage", "1");
            if (GetServerCFG("SPEEDPLUGIN", "Gravity", "-1") == "-1")
                SetServerCFG("SPEEDPLUGIN", "Gravity", "800");

            try
            {
                g_speed_var = Convert.ToInt32(GetServerCFG("SPEEDPLUGIN", "Speed", "190"));
                jump_height_var = Convert.ToInt32(GetServerCFG("SPEEDPLUGIN", "JumpHeight", "39"));
                fall_damage_var = Convert.ToInt32(GetServerCFG("SPEEDPLUGIN", "FallDamage", "1"));
                gravity_var = Convert.ToInt32(GetServerCFG("SPEEDPLUGIN", "Gravity", "800"));
            }
            catch
            {
                ServerPrint("invalid speed, jump height, fall damage or gravity value...");
            }

            makeSpeedHappy();
            makeJumpHeightHappy();
            makeGravityHappy();

            set_g_speed(g_speed_var);
            set_jump_height(jump_height_var);
            set_g_gravity(gravity_var);

            if (fall_damage_var == 0)
                disableFallDamage();
        }

        public override unsafe ChatType OnSay(string Message, ServerClient Client)
        {
            string lowMsg = Message.ToLower();

            if (lowMsg.StartsWith("!falldamage"))
            {
                string[] splitMsg = lowMsg.Split(' ');

                if (splitMsg.Length == 1)
                {
                    if (fall_damage_enabled)
                        TellClient(Client.ClientNum, "Fall damage is currently enabled.", true);
                    else
                        TellClient(Client.ClientNum, "Fall damage is currently disabled.", true);
                }
                else
                {
                    if (splitMsg[1] == "0")
                    {
                        disableFallDamage();
                        TellClient(Client.ClientNum, "Fall damage is now disabled.", true);
                    }
                    else if (splitMsg[1] == "1")
                    {
                        enableFallDamage();
                        TellClient(Client.ClientNum, "Fall damage is now enabled.", true);
                    }
                }

                return ChatType.ChatNone;
            }

            if (lowMsg.StartsWith("!speed"))
            {
                string[] splitMsg = lowMsg.Split(' ');

                if (splitMsg.Length == 1)
                    TellClient(Client.ClientNum, "Current speed: " + *(int*)g_speed, true);
                else
                {
                    try
                    {
                        int NewSpeedValue = Convert.ToInt32(splitMsg[1]);
                        set_g_speed(NewSpeedValue);

                        TellClient(Client.ClientNum, "Speed changed to: " + NewSpeedValue + " (default=190)", true);
                    }
                    catch
                    {
                        TellClient(Client.ClientNum, "^1Invalid speed value!", true);
                    }
                }
                return ChatType.ChatNone;
            }

            if (lowMsg.StartsWith("!jumpheight"))
            {
                string[] splitMsg = lowMsg.Split(' ');

                if (splitMsg.Length == 1)
                    TellClient(Client.ClientNum, "Current jump height: " + *(float*)jump_height, true);
                else
                {
                    try
                    {
                        float NewJumpHeightValue = (float)Convert.ToInt32(splitMsg[1]);

                        set_jump_height(NewJumpHeightValue);

                        if (NewJumpHeightValue < 128)
                            TellClient(Client.ClientNum, "Jump height changed to: " + NewJumpHeightValue, true);
                        else
                        {
                            TellClient(Client.ClientNum, "Jump height changed to: " + NewJumpHeightValue + " (default=39). Fall damage disabled.", true);
                            disableFallDamage();
                        }

                    }
                    catch
                    {
                        TellClient(Client.ClientNum, "^1Invalid jump height value!", true);
                    }
                }
                return ChatType.ChatNone;
            }

            if (lowMsg.StartsWith("!gravity"))
            {
                string[] splitMsg = lowMsg.Split(' ');

                if (splitMsg.Length == 1)
                    TellClient(Client.ClientNum, "Current gravity: " + *(int*)g_gravity, true);
                else
                {
                    try
                    {
                        int newGravityValue = Convert.ToInt32(splitMsg[1]);

                        set_g_gravity(newGravityValue);

                        TellClient(Client.ClientNum, "Gravity changed to: " + newGravityValue + " (default=800).", true);
                    }
                    catch
                    {
                        TellClient(Client.ClientNum, "^1Invalid gravity value!", true);
                    }
                }
                return ChatType.ChatNone;
            }

            return ChatType.ChatContinue;
        }

        /////////////////////////////////////////////////////////////////////////////////////////////////////////
        //Stuff needed for speed change
        public void makeSpeedHappy()
        {
            try
            {
                uint size = 4;
                uint newProtect = 0x40;
                uint oldProtect = 0;

                VirtualProtect(g_speed, size, newProtect, out oldProtect);
            }
            catch (Exception e)
            {
                ServerLog(LogType.LogConsole, "SPEED PLUGIN ERROR: " + e.ToString());
            }
        }

        unsafe public void set_g_speed(int value)
        {
            try
            {
                *(int*)g_speed = value;
            }
            catch (Exception e)
            {
                ServerLog(LogType.LogConsole, "SPEED PLUGIN ERROR: " + e.ToString());
            }
        }

        public unsafe void makeJumpHeightHappy()
        {
            try
            {
                uint size = 4;
                uint newProtect = 0x40;
                uint oldProtect = 0;

                VirtualProtect(jump_height, size, newProtect, out oldProtect);
                VirtualProtect(fallmin, size, newProtect, out oldProtect);
                VirtualProtect(fallmax, size, newProtect, out oldProtect);


            }
            catch (Exception e)
            {
                ServerLog(LogType.LogConsole, "SPEED PLUGIN ERROR: " + e.ToString());
            }
        }

        public unsafe void disableFallDamage()
        {
            fall_damage_enabled = false;
            *(float*)fallmin = 999999.0f;
            *(float*)fallmax = 1000000.0f;
        }


        public unsafe void enableFallDamage()
        {
            fall_damage_enabled = true;
            *(float*)fallmin = 128.0f;
            *(float*)fallmax = 300.0f;
        }

        unsafe public void set_jump_height(float value)
        {
            try
            {
                *(float*)jump_height = value;
            }
            catch (Exception e)
            {
                ServerLog(LogType.LogConsole, "SPEED PLUGIN ERROR: " + e.ToString());
            }
        }

        public void makeGravityHappy()
        {
            try
            {
                uint size = 4;
                uint newProtect = 0x40;
                uint oldProtect = 0;

                VirtualProtect(g_gravity, size, newProtect, out oldProtect);
            }
            catch (Exception e)
            {
                ServerLog(LogType.LogConsole, "SPEED PLUGIN ERROR: " + e.ToString());
            }
        }

        unsafe public void set_g_gravity(int value)
        {
            try
            {
                *(int*)g_gravity = value;
            }
            catch (Exception e)
            {
                ServerLog(LogType.LogConsole, "SPEED PLUGIN ERROR: " + e.ToString());
            }
        }
    }
}
Reply

#4
if your using @8q4s8 ok,

otherwise reboot now should be ok.
[Image: b_560_95_1.png]


[Image: b_560_95_1.png]

Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
Wink Plugin with !ban !kick and !tampban clemi555 3 4,161 11-09-2013, 09:21
Last Post: clemi555
  AntiNoScope Plugin clemi555 5 4,744 11-08-2013, 19:13
Last Post: clemi555
  [Release] Bunker Plugin 1.3 archit 68 41,498 10-30-2013, 11:59
Last Post: clacki
  Help Modifying plugin maverigh 5 5,666 10-19-2013, 10:29
Last Post: Nekochan
Shocked [Request] Switch plugin axel-le-meilleur 6 5,176 10-19-2013, 06:59
Last Post: iRoNinja
  [Release] Yurio Map Plugin Yurio 101 62,186 09-26-2013, 13:38
Last Post: First_Semyon
Brick [Release] v1.1 ChangeMap/NextMap Plugin without any configuration milchshake 23 18,619 09-23-2013, 13:18
Last Post: SgtLegend
  Infected Stuff is semi broken DidUknowiPwn 2 3,454 09-21-2013, 20:22
Last Post: surtek
  Help !say Plugin (like the !say from GodPlugin) Hallla 0 2,711 09-13-2013, 09:31
Last Post: Hallla
Rainbow [Release] MW3: Random Weapon Plugin V1 Nekochan 50 33,256 09-11-2013, 15:11
Last Post: EnVi Sweden Rocks

Forum Jump:


Users browsing this thread:
1 Guest(s)

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