Simply enables unlimited ammo.
Attachment at the bottom of the post
Credits:
@Deviler86
Attachment at the bottom of the post
Credits:
@Deviler86
Code:
using System;
using System.Runtime.InteropServices;
using System.Security;
using Addon;
//Compile with /unsafe
//And a reference to "addon/dist/addon.dll"
namespace unlimited_ammo
{
public class Program : CPlugin
{
[DllImport("kernel32.dll",SetLastError = true)]
public static extern bool WriteProcessMemory(IntPtr hProcess, int lpBaseAddress, byte[] lpBuffer, int nSize, out int lpNumberOfBytesWritten);
unsafe public override void OnServerLoad()
{
ServerPrint("Plugin: Unlimited ammo by Nukem loaded.");
int dwout = 0;
byte[] bytes = { 0x90, 0x90, 0x90, 0x90 };
byte[] bytes2 = { 0x90, 0x90, 0x90 };
WriteProcessMemory(((IntPtr)(-1)), 0x00420E69, bytes, bytes.Length, out dwout);
WriteProcessMemory(((IntPtr)(-1)), 0x0041E749, bytes2, bytes2.Length, out dwout);
}
}
}