Перейти к содержимому
View in the app

A better way to browse. Learn more.

Zloplay community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Опубликовано:

If you want to disable knifing in your mod you can use this class.

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using InfinityScript;
using System.Runtime.InteropServices;

//Noknife from http://www.itsmods.com/forum/Thread-Release-NoKnife-Plugin.html
//credits to:
//base.ServerPrint("\n NoKnife Plugin loaded \n Author: zxz0O0 \n Thanks to Nukem, Jariz, Pozzuh and Makavel\n");
//base.ServerPrint(" www.youtube.com/zxz0O0 \n www.itsmods.com\n");

//Adapted by DaMacc for IW5M

namespace IW5MExtensions
{
   unsafe class NoKnife
   {

       public unsafe void DisableKnife()
       {
           *this.KnifeRange = (int)ZeroAddress;
       }

       public unsafe void EnableKnife()
       {
           *this.KnifeRange = (int)DefaultKnifeAddress;
       }

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


       private int DefaultKnifeAddress;
       private int* KnifeRange;
       private int* ZeroAddress;

       private unsafe int FindMem(byte?[] search, int num = 1, int start = 0x1000000, int end = 0x3d00000)
       {
           byte* num2 = (byte*)0;
           try
           {
               int num3 = 0;
               for (int i = start; i < end; i++)
               {
                   num2 = (byte*)i;
                   bool flag = false;
                   for (int j = 0; j < search.Length; j++)
                   {
                       if (search[j].HasValue)
                       {
                           byte num7 = *num2;
                           if (num7 != search[j])
                           {
                               break;
                           }
                       }
                       if (j == (search.Length - 1))
                       {
                           if (num == 1)
                           {
                               flag = true;
                           }
                           else
                           {
                               num3++;
                               if (num3 == num)
                               {
                                   flag = true;
                               }
                           }
                       }
                       else
                       {
                           num2++;
                       }
                   }
                   if (flag)
                   {
                       return i;
                   }
               }
           }
           catch (Exception exception)
           {
               Log.Write(LogLevel.Error, "FindMem: " + exception.Message + "\nAddress: " + (int)num2);
           }
           return 0;
       }



       public unsafe NoKnife()
       {

           Log.Write(LogLevel.Info, "NoKnife Plugin loaded \n Author: zxz0O0 \n Thanks to Nukem, Jariz, Pozzuh and Makavel\n Modified for IW5M by DaMacc");

           try
           {

               byte?[] search = new byte?[] { 
               0x8b, null, null, null, 0x83, null, 4, null, 0x83, null, 12, 0xd9, null, null, null, 0x8b, 
               null, 0xd9, null, null, null, 0xd9, 5
            };
               this.KnifeRange = (int*)(this.FindMem(search, 1, 0x400000, 0x500000) + search.Length);

               Log.Write(LogLevel.Info, "KnifeRange ptr: " + string.Format("{0:X}", (int)KnifeRange));

               if ((int)this.KnifeRange == search.Length)
               {
                   byte?[] nullableArray2 = new byte?[] { 
                   0x8b, null, null, null, 0x83, null, 0x18, null, 0x83, null, 12, 0xd9, null, null, null, 0x8d, 
                   null, null, null, 0xd9, null, null, null, 0xd9, 5
                };
                   this.KnifeRange = (int*)(this.FindMem(nullableArray2, 1, 0x400000, 0x500000) + nullableArray2.Length);

                   Log.Write(LogLevel.Info, "KnifeRange ptr: " + string.Format("{0:X}", (int)KnifeRange));

                   if ((int)this.KnifeRange == nullableArray2.Length)
                   {
                       this.KnifeRange = (int*)0;
                   }
               }
               this.DefaultKnifeAddress = *this.KnifeRange;
               byte?[] nullableArray3 = new byte?[] { 
               0xd9, 0x5c, null, null, 0xd8, null, null, 0xd8, null, null, 0xd9, 0x5c, null, null, 0x83, null, 
               1, 15, 0x86, null, 0, 0, 0, 0xd9
            };
               this.ZeroAddress = (int*)(this.FindMem(nullableArray3, 1, 0x400000, 0x500000) + nullableArray3.Length + 2);

               Log.Write(LogLevel.Info, "ZeroAddress ptr: " + string.Format("{0:X}", (int)ZeroAddress));

               if ((((int)this.KnifeRange == 0) || ((int)this.DefaultKnifeAddress == 0)) || ((int)this.ZeroAddress == 0))
               {
                   Log.Write(LogLevel.Error, "Error finding address: NoKnife Plugin will not work");

               }
               else
               {
                   uint num;
                   VirtualProtect((IntPtr)this.KnifeRange, (IntPtr)4, 0x40, out num);
               }
           }
           catch (Exception exception)
           {
               Log.Write(LogLevel.Error, "Error in NoKnife Plugin. Plugin will not work.");
               Log.Write(LogLevel.Error, exception.ToString());
           }
       }
   }
}

 

Example usage:

 

  public class Instagib : BaseScript
   {
       public Instagib()
       {    
           NoKnife nk = new NoKnife();
           nk.DisableKnife();

...

  • 3 weeks later...
  • 2 months later...
Опубликовано:
Can't you just change knife's range to 0?

There surely was such dvar in IW3 :P

....

Опубликовано:
Switcheyy":3ocm25oh]I compiled it. Plugin doesn't work and I don't know how to use it. Copied the compiled .dll into my scripts folder and renamed it to noknife.auto.dll. It's not working in-game.

Add it as class in your mod as explained in the first post which you obviously didn't read.

  • 1 month later...
Опубликовано:

Gives me this ???

\NoKnife.cs' or one of its dependencies. An attempt was made to load a program with an incorrect format.

File name: 'scripts\NoKnife.cs'

 at (wrapper managed-to-native) System.Reflection.Assembly:LoadFrom (string,bool)

 at System.Reflection.Assembly.LoadFrom (System.String assemblyFile, System.Security.Policy.Evidence securityEvidence) [0x00000] in :0 

 at System.Reflection.Assembly.LoadFile (System.String path, System.Security.Policy.Evidence securityEvidence) [0x00000] in :0 

 at System.Reflection.Assembly.LoadFile (System.String path) [0x00000] in :0 

 at InfinityScript.ScriptLoader.LoadAssemblies (System.String dir, System.String filter) [0x00000] in :0 

  • 4 weeks later...
Опубликовано:

Thank you!!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Гость
Ответить в тему...

Сейчас на странице 0

  • Нет пользователей, просматривающих эту страницу

Важная информация

Используя этот сайт, вы соглашаетесь Условия использования.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.