Release NoKnife Plugin
#1
This Plugin should disable Knife damage.

Requirements:
@Nukem's dedicated server addon
MW3 Dedicated Server

This plugin uses signature scans to find the offsets, it *should* work on all MW3 versions.

Commands:
!knife - Show if knifing enabled/disabled
!knife 0 - Disable knifing
!knife 1 - Enable knifing

sv_config:
Code:
[Knife] Enabled=1 // 0 or 1 ChatCommands=1 // 0 or 1, enable/disable chat commands above

Obsolete source code
Code:
using System; using System.Collections.Generic; using System.Text; using Addon; namespace NoKnife { public class Class1 : CPlugin { [System.Runtime.InteropServices.DllImport("kernel32.dll", SetLastError = true)] private static extern bool WriteProcessMemory(IntPtr hProcess, int lpBaseAddress, byte[] lpBuffer, int nSize, out int lpNumberOfBytesWritten); string str_Knife = "enabled"; public override void OnServerLoad() { ServerPrint("\n NoKnife Plugin loaded \n Author: zxz0O0 \n Thanks to Nukem, Jariz, Pozzuh and Makavel\n"); ServerPrint(" youtube.com/zxz0O0 \n itsmods.com\n"); if (GetServerCFG("Knife", "Enabled", "1") == "0") Knife(false); } private void Knife(bool bl) { if (bl == false) { int oP; byte[] bytes = { 0xD9, 0x05, 0xD8, 0xFC, 0x76, 0x00 }; WriteProcessMemory(((IntPtr)(-1)), 0x004B75E0, bytes, bytes.Length, out oP); str_Knife = "disabled"; ServerSay("Knifing disabled", false); } else { int oP; byte[] bytes = { 0xD9, 0x05, 0xD0, 0x5A, 0x78, 0x00 }; WriteProcessMemory(((IntPtr)(-1)), 0x004B75E0, bytes, bytes.Length, out oP); str_Knife = "enabled"; ServerSay("Knifing enabled", false); } } public override ChatType OnSay(string Message, ServerClient Client) { if (Message == "!knife") { TellClient(Client.ClientNum, "PM: Knifing " + str_Knife, true); return ChatType.ChatNone; } else if (Message.StartsWith("!knife ")) { if (Message == "!knife 0") Knife(false); else if (Message == "!knife 1") Knife(true); return ChatType.ChatNone; } return ChatType.ChatContinue; } } }

Thanks to @makavel for testing and helping and thanks to @Nukem for telling how to fix the bugs.


Attached Files
.zip   NoKnife.zip (Size: 3.69 KB / Downloads: 1,653)
[Image: azuw.jpg]
Reply

#2
Why did you set it to 11 and not to 1 or 0?
[Image: MaEIQ.png]
Reply

#3
(03-03-2012, 10:47)Pozzuh Wrote: Why did you set it to 11 and not to 1 or 0?

If you set it to 0 you are immune to weapons too. If you set it 0 < x < 10 hitboxes are weird. Not sure what causes that, but I tried the highest possible value where you can not knife and 11 should be ok.
[Image: azuw.jpg]
Reply

#4
So what dvar is that?
[Image: MaEIQ.png]
Reply

#5
(03-03-2012, 11:06)Pozzuh Wrote: So what dvar is that?

player_MeleeRange obviously.
[Image: azuw.jpg]
Reply

#6
How would setting that to 0 make all players invincible? That didn't happen in any cod.
[Image: MaEIQ.png]
Reply

#7
(03-03-2012, 11:12)Pozzuh Wrote: How would setting that to 0 make all players invincible? That didn't happen in any cod.

As you can see it's a float address and of course other dvars are also using that float dvar.
[Image: azuw.jpg]
Reply

#8
good one +rep
Reply

#9
(03-03-2012, 11:25)zxz0O0 Wrote:
(03-03-2012, 11:12)Pozzuh Wrote: How would setting that to 0 make all players invincible? That didn't happen in any cod.

As you can see it's a float address and of course other dvars are also using that float dvar.

Well he`s right. It changes some others dvar value also so that effect to other dvar`s aswell which are also associated with the same float value.
Reply

#10
Thanks for adding me to the credits. Awesome plugin.
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
Rainbow [Release] Plugin ReservedSlot v1.3 frst_ 1 4,996 11-08-2018, 19:17
Last Post: frst_
Tongue [Release] MW3 Shop plugin Dude 56 51,303 03-25-2018, 05:18
Last Post: [email protected]
  [Release] Permission plugin Pozzuh 202 163,924 05-01-2017, 15:41
Last Post: W4R||The Hyper
  [Release] FIXED SPEED PLUGIN hillbilly 2 5,656 06-02-2016, 20:23
Last Post: clacki
  [Release] Bots Plugin For Users Casper 22 39,851 08-22-2015, 17:45
Last Post: SnapBacks
  [Release] God Plugin v5.0 [Ingame Rcon Tool] OzonE 464 335,832 06-27-2015, 15:38
Last Post: bluedot
  [Release] Anti Hardscope Plugin 8q4s8 26 27,596 06-20-2015, 22:44
Last Post: urj88419
  [Release] ProMod Plugin zxz0O0 875 761,622 03-25-2015, 22:02
Last Post: kris
  [Release] [Discontinued] Speed Plugin Pozzuh 164 121,952 10-06-2014, 12:56
Last Post: Nekochan
  [help]how create a ping plugin clacki 3 5,077 09-13-2014, 01:23
Last Post: clacki

Forum Jump:


Users browsing this thread:
1 Guest(s)

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