Demon xModRx
Insane-Known Member
- Messages
- 63
- Reaction score
- 5
- Points
- 358
im using code directly from iconic(which is an open source menu), and im trying to edit weapons in the box, ive got "No Weapons In Box" working. but nothing else. when I enable "All Weapons In Box" it just acts I just pressed "No Weapons In Box" and disables all box weapons. and it does the same when I add a specific weapon to the box. can someone please take a look at the code and help?
My Options
and heres my scripts
will seriously appreciate any help, thanks!
My Options
add_option( bh, "All Weapons In Box", ::allboxweapons );
add_option( bh, "No Weapons In Box", ::noboxweapons );
add_option( bh, "Add Weapon To Box", ::submenu, bhb, "Add Weapon To Box" );
add_menu( bhb, bh, "Add Weapon To Box" );
weapons = strTok("defaultweapon_mp,ak74u_zm,mp5k_zm,qcw05_zm,m14_zm", ",");
for(i=0;i<weapons.size;i++)
add_option( bhb, weapons, ::addweapontobox, weapons);
add_option( bh, "No Weapons In Box", ::noboxweapons );
add_option( bh, "Add Weapon To Box", ::submenu, bhb, "Add Weapon To Box" );
add_menu( bhb, bh, "Add Weapon To Box" );
weapons = strTok("defaultweapon_mp,ak74u_zm,mp5k_zm,qcw05_zm,m14_zm", ",");
for(i=0;i<weapons.size;i++)
add_option( bhb, weapons, ::addweapontobox, weapons);
and heres my scripts
C++:
AllWeaponsInBox()
{
level.demon_modded_box = 1;
if (isDefined(level.custom_magic_box_selection_logic))
level.custom_magic_box_selection_logic = undefined;
if (isDefined(level.special_weapon_magicbox_check))
level.special_weapon_magicbox_check = undefined;
if (isDefined(level.content_weapon))
level.content_weapon = undefined;
foreach(weapon in level.zombie_weapons)
weapon.is_in_box = 1;
level.limited_weapons = [];
level.demon_box_weapons = [];
level.demon_box_weapons = array_copy(level.zombie_weapons);
level.customrandomweaponweights = ::demonMBOverride;
}
demonMBOverride()
{
level.demon_box_weapons = array_randomize(level.demon_box_weapons);
return level.demon_box_weapons;
}
allboxweapons()
{
AllWeaponsInBox();
self b("All Weapons Are In The Box!");
}
noboxweapons()
{
if (!isDefined(level.demon_modded_box))
AllWeaponsInBox();
level.limited_weapons = [];
level.demon_box_weapons = [];
self b("No Weapons Are In The Box!");
}
addweapontobox(value)
{
if (!isDefined(level.demon_modded_box))
{
AllWeaponsInBox();
}
level.zombie_weapons[value].is_in_box = 1;
level.limited_weapons[value] = undefined;
level.demon_box_weapons = add_to_array(level.demon_box_weapons, value, 0);
self b(value + "^2 Added");
}
will seriously appreciate any help, thanks!
Last edited by a moderator: