|
AMX Mod X Donor
|
03-15-2024
, 14:36
Re: Dollar Weapon menu
|
#12
|
Quote:
Originally Posted by Jhob94
He doesn't want the weapon to be dropped, as instead you can do this:
Code:
const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90);
const SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE);
stock kill_weapons(id, dropwhat)
{
static Weapons[32], Num, i, WeaponID;
Num = 0;
get_user_weapons(id, Weapons, Num);
for(i = 0; i < Num; i ++)
{
WeaponID = Weapons[i];
if((dropwhat == 1 && ((1 << WeaponID) & PRIMARY_WEAPONS_BIT_SUM)) || (dropwhat == 2 && ((1 << WeaponID) & SECONDARY_WEAPONS_BIT_SUM )))
{
static DropName[32], WeaponEntity;
get_weaponname(WeaponID, DropName, charsmax(DropName));
WeaponEntity = fm_find_ent_by_owner(-1, DropName, id);
if(pev_valid(WeaponEntity))
{
ExecuteHamB(Ham_Weapon_RetireWeapon, WeaponEntity)
if(ExecuteHamB(Ham_RemovePlayerItem, id, WeaponEntity))
ExecuteHamB(Ham_Item_Kill, WeaponEntity)
set_pev(id, pev_weapons, pev(id,pev_weapons) & ~(1 << WeaponID))
}
}
}
}
Code:
kill_weapons(id, 1) // Primary weapons
kill_weapons(id, 2) // Secondary weapons
|
Use this before giving the new weapon, that stock will remove any primary/secondary a person has.
__________________
|
|
|
|