01-08-2012, 19:30
The speed plugin is now discontinued. I no longer plan on updating it.THE PLUGIN WON'T WORK ANY LONGER. This is due to the fact that Black Ops 2 was released, and I lost interest in MW3 a few months ago. I hope you guys can be grateful for the 11 months I kept this plugin up-to-date.
Features:
This plugin allows server admins to change the run speed, jump height, gravity and fall damage.
Requirements:
@Nukem's server addon, the newest mw3 version. (Techno Gods NOT supported!)
Changelog:
Usage (for admins):
Use my Permission Plugin, or every player will be able to change the jumpheight, fall damage and run speed.
Run the plugin once for it to make the settings in sv_config.ini. Now close the server and change the settings to your liking.
Usage:
Credits:
@Pozzuh - Made the plugin
@Nukem & @zxz0O0 & @barata - Finding offsets
@Deviler86 - Fixing fall damage enabling.
Source:
Features:
This plugin allows server admins to change the run speed, jump height, gravity and fall damage.
Requirements:
@Nukem's server addon, the newest mw3 version. (Techno Gods NOT supported!)
Changelog:
Code:
v1.0 initial release
v1.1 Updated to addon 1.190 (Linux support)
v1.2 Updated to addon V1.250, fixed enabling fall damage again.
v1.3 Fixed an issue with changing speed.
v1.4 Added ability to change gravity.
v1.5, v1.6, v1.7 Updated for newest version of the game
v1.8 Now fetches the memory addresses from a website, no need to redownload the plugin in the future.
Usage (for admins):
Use my Permission Plugin, or every player will be able to change the jumpheight, fall damage and run speed.
Run the plugin once for it to make the settings in sv_config.ini. Now close the server and change the settings to your liking.
Usage:
Code:
!falldamage // Shows if fall damage is currently enabled.
!speed // shows the current running speed.
!jumpheight // shows the current jump height.
!gravity // shows the current gravity value.
!falldamage 0 //disables falldamage
!falldamage 1 //enables falldamage
!speed <number> // sets the running speed to that number (default = 190).
!jumpheight <number> // sets the jump height to that number (default = 39).
!gravity <number> // sets the gravity value to that number (default = 800)
Credits:
@Pozzuh - Made the plugin
@Nukem & @zxz0O0 & @barata - Finding offsets
@Deviler86 - Fixing fall damage enabling.
Source:
Source code (Click to View)
CSHARP 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
- {
- string download = wc.DownloadString("http://cfgfactory.com/kc/pozzuh/speed_plugin_update.txt");
- 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 (Exception e)
- {
- 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 (Exception e)
- {
- 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 (Exception e)
- {
- 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 (Exception e)
- {
- 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());
- }
- }
- }
- }