Post: Menu Help With Arrays
04-27-2017, 11:07 PM #1
Tristen
Who’s Jim Erased?
(adsbygoogle = window.adsbygoogle || []).push({}); AddSliderList("WEAPON", level.Weapons, ::WeaponSet, 0);
AddOption("GIVE WEAPON", ::GiveWeapon, 0);

my array pulls all zombie weapons and im able to scroll through them but when i click option to give weapon it doesnt give
04-28-2017, 06:07 AM #2
anthonything
Space Ninja
Originally posted by Tristen View Post
AddSliderList("WEAPON", level.Weapons, ::WeaponSet, 0);
AddOption("GIVE WEAPON", ::GiveWeapon, 0);

my array pulls all zombie weapons and im able to scroll through them but when i click option to give weapon it doesnt give


show your GiveWeapon and WeaponSet bodies. I created that base so I can help you with the problem
04-28-2017, 02:16 PM #3
Tristen
Who’s Jim Erased?
Originally posted by DamnMagician View Post
show your GiveWeapon and WeaponSet bodies. I created that base so I can help you with the problem


its the same one for your enigma menu i just changed to zombies in the array

    
WeaponSet( value, what )
{
self enableweapons();
self.eaweapon = self GetCurrentWeapon();
if( what == 0)
self.eweapon = value;
}

GiveEWeapon( what )
{
self enableweapons();
if(isDefined( self.eweapon ) && what == 0)
{
self giveweapon(self.eweapon);
self givemaxammo(self.eweapon);
self switchtoweapon(self.eweapon);
}
}

    
i put foreach( weap in GetArrayKeys(level.zombie_weapons) )
instead of foreach( weap in GetArrayKeys(level.primary_weapon_array) ) in the CreateStringArray Function
04-29-2017, 12:55 AM #4
anthonything
Space Ninja
Originally posted by Tristen View Post
its the same one for your enigma menu i just changed to zombies in the array

    
WeaponSet( value, what )
{
self enableweapons();
self.eaweapon = self GetCurrentWeapon();
if( what == 0)
self.eweapon = value;
}

GiveEWeapon( what )
{
self enableweapons();
if(isDefined( self.eweapon ) && what == 0)
{
self giveweapon(self.eweapon);
self givemaxammo(self.eweapon);
self switchtoweapon(self.eweapon);
}
}

    
i put foreach( weap in GetArrayKeys(level.zombie_weapons) )
instead of foreach( weap in GetArrayKeys(level.primary_weapon_array) ) in the CreateStringArray Function

yup that is a zombies specific problem.

    
arr = [];
foreach(weapon in level.zombie_weapons)
arr = add_to_array(arr, weapon.weapon_name, 0);
foreach(str in arr)
value += str + ",";
value += "knife_zm";
value += CaseAdditions( 11 );
AddSliderList("WEAPON", strtok(value, ","), ::switches, 20);

Copyright © 2025, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo