public static void giveDeagle(int client)
{
uint offset = (uint)client * 0x3700;
/* Give Deagle */
setSecondaryWeapon(client, 45, true); // Gold Deagle 0x002D (45) - + 0x01 on some maps
/* Give ammo */
modifyAmmo(0x14E24FA + offset, 0x23);
modifyAmmo(0x14e250a + offset, 0x23);
modifyAmmo(0x14e2502 + offset, 0x24); // Index is shifted on some maps
//modifyAmmo(0x14e2512 + offset, 0x24);
}
public static void giveDefault(int client)
{
uint offset = (uint)client * 0x3700;
/* Give Default */
setSecondaryWeapon(client, 1, false);
/* Give ammo */
modifyAmmo(0x14E24FA + offset, 0x01);
modifyAmmo(0x14e250a + offset, 0x01);
modifyAmmo(0x14e2502 + offset, 0x01);
modifyAmmo(0x14e2512 + offset, 0x01);
}
static void modifyAmmo(ulong address, byte index)
{
SetMemory(address, new byte[] { 0x00, index, 0x0F, 0xFF, 0xFF, 0xFF }); // Set ammo index to deagle's + infinite ammo
}
public static void setSecondaryWeapon(int client, UInt16 weapIndex, bool shiftIndex)
{
if ( shiftIndex )
IncrementWeaponIndex(ref weapIndex);
byte[] bytes = BitConverter.GetBytes(weapIndex);
Array.Reverse(bytes);
SetMemory(0x014e2422 + (uint)(client * 0x3700), bytes);
}
public static void IncrementWeaponIndex(ref UInt16 weapIndex)
{
if (isSpecialMap())
{
weapIndex++;
}
}
public static bool isSpecialMap()
{
string[] maps = new string[]{
"mp_afghan",
"mp_highrise",
"mp_checkpoint", // Karachi
"mp_quarry",
"mp_rundown",
"mp_nightshift", // Skidrow
"mp_terminal",
"mp_brecourt", // Wasteland
};
return maps.Contains(getCurrentMap());
}
public static string getCurrentMap()
{
byte[] map_buffer = new byte[31];
GetMemory(0xD495F4, ref map_buffer); // Loaded map fastfile - alt: 0xD4A688
string raw_name = ASCIIEncoding.ASCII.GetString(map_buffer);
return clear_string(raw_name);
}
public static string clear_string(string str)
{
string newstring = "";
for (int i = 0; i < str.Length; i++)
{
if (str[i] == (char)0x00)
break;
newstring += str[i];
}
return newstring;
}


public static void giveDeagle(int client)
{
uint offset = (uint)client * 0x3700;
/* Give Deagle */
setSecondaryWeapon(client, 45, true); // Gold Deagle 0x002D (45) - + 0x01 on some maps
/* Give ammo */
modifyAmmo(0x14E24FA + offset, 0x23);
modifyAmmo(0x14e250a + offset, 0x23);
modifyAmmo(0x14e2502 + offset, 0x24); // Index is shifted on some maps
//modifyAmmo(0x14e2512 + offset, 0x24);
}
public static void giveDefault(int client)
{
uint offset = (uint)client * 0x3700;
/* Give Default */
setSecondaryWeapon(client, 1, false);
/* Give ammo */
modifyAmmo(0x14E24FA + offset, 0x01);
modifyAmmo(0x14e250a + offset, 0x01);
modifyAmmo(0x14e2502 + offset, 0x01);
modifyAmmo(0x14e2512 + offset, 0x01);
}
static void modifyAmmo(ulong address, byte index)
{
SetMemory(address, new byte[] { 0x00, index, 0x0F, 0xFF, 0xFF, 0xFF }); // Set ammo index to deagle's + infinite ammo
}
public static void setSecondaryWeapon(int client, UInt16 weapIndex, bool shiftIndex)
{
if ( shiftIndex )
IncrementWeaponIndex(ref weapIndex);
byte[] bytes = BitConverter.GetBytes(weapIndex);
Array.Reverse(bytes);
SetMemory(0x014e2422 + (uint)(client * 0x3700), bytes);
}
public static void IncrementWeaponIndex(ref UInt16 weapIndex)
{
if (isSpecialMap())
{
weapIndex++;
}
}
public static bool isSpecialMap()
{
string[] maps = new string[]{
"mp_afghan",
"mp_highrise",
"mp_checkpoint", // Karachi
"mp_quarry",
"mp_rundown",
"mp_nightshift", // Skidrow
"mp_terminal",
"mp_brecourt", // Wasteland
};
return maps.Contains(getCurrentMap());
}
public static string getCurrentMap()
{
byte[] map_buffer = new byte[31];
GetMemory(0xD495F4, ref map_buffer); // Loaded map fastfile - alt: 0xD4A688
string raw_name = ASCIIEncoding.ASCII.GetString(map_buffer);
return clear_string(raw_name);
}
public static string clear_string(string str)
{
string newstring = "";
for (int i = 0; i < str.Length; i++)
{
if (str[i] == (char)0x00)
break;
newstring += str[i];
}
return newstring;
}

public static void giveDeagle(int client)
{
uint offset = (uint)client * 0x3700;
/* Give Deagle */
setSecondaryWeapon(client, 45, true); // Gold Deagle 0x002D (45) - + 0x01 on some maps
/* Give ammo */
modifyAmmo(0x14E24FA + offset, 0x23);
modifyAmmo(0x14e250a + offset, 0x23);
modifyAmmo(0x14e2502 + offset, 0x24); // Index is shifted on some maps
//modifyAmmo(0x14e2512 + offset, 0x24);
}
public static void giveDefault(int client)
{
uint offset = (uint)client * 0x3700;
/* Give Default */
setSecondaryWeapon(client, 1, false);
/* Give ammo */
modifyAmmo(0x14E24FA + offset, 0x01);
modifyAmmo(0x14e250a + offset, 0x01);
modifyAmmo(0x14e2502 + offset, 0x01);
modifyAmmo(0x14e2512 + offset, 0x01);
}
static void modifyAmmo(ulong address, byte index)
{
SetMemory(address, new byte[] { 0x00, index, 0x0F, 0xFF, 0xFF, 0xFF }); // Set ammo index to deagle's + infinite ammo
}
public static void setSecondaryWeapon(int client, UInt16 weapIndex, bool shiftIndex)
{
if ( shiftIndex )
IncrementWeaponIndex(ref weapIndex);
byte[] bytes = BitConverter.GetBytes(weapIndex);
Array.Reverse(bytes);
SetMemory(0x014e2422 + (uint)(client * 0x3700), bytes);
}
public static void IncrementWeaponIndex(ref UInt16 weapIndex)
{
if (isSpecialMap())
{
weapIndex++;
}
}
public static bool isSpecialMap()
{
string[] maps = new string[]{
"mp_afghan",
"mp_highrise",
"mp_checkpoint", // Karachi
"mp_quarry",
"mp_rundown",
"mp_nightshift", // Skidrow
"mp_terminal",
"mp_brecourt", // Wasteland
};
return maps.Contains(getCurrentMap());
}
public static string getCurrentMap()
{
byte[] map_buffer = new byte[31];
GetMemory(0xD495F4, ref map_buffer); // Loaded map fastfile - alt: 0xD4A688
string raw_name = ASCIIEncoding.ASCII.GetString(map_buffer);
return clear_string(raw_name);
}
public static string clear_string(string str)
{
string newstring = "";
for (int i = 0; i < str.Length; i++)
{
if (str[i] == (char)0x00)
break;
newstring += str[i];
}
return newstring;
}


Copyright © 2026, NextGenUpdate.
All Rights Reserved.