


Login Issues
Forgot password?Activate Issues
Account activation email not received? Wrong account activation email used?Other Problems?
Contact Support - Help Center Get help on the UGX Discord. Join it now!![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager. |
![]() Oil Rig Beta Access |
![]() | Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager. |
![]() Oil Rig Beta Access |
Is it possible to add the give weapon function to your scripts from my end?
With your permission of course.
Or might that break some other function?
Just accept that this doesn't work with Harry's perks. Give Fear and Harry some time to come up with a solution and in the mean time don't include it in your map. Simples.
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
take_gun( name )
{
if ( isDefined( self.inventory ) && self.inventory.size > 0 )
{
for ( i = 0; i < self.inventory.size; i++ )
{
if ( self.inventory[ i ] == name )
{
self.inventory[ i ] = "none";
break;
}
}
}
self takeWeapon( name );
}
player take_gun( "weapon_name" );
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
Haven't tested above script yet but I'm not having the specific wall weapon error mentioned above.
Using ugx mod tools patch v1.0.6
Harrys perks v2.0.4
And reapers current script on front page.
No other edits that would affect inventory
Perks version I have had the array index already set to "none"
I did get a few other inventory oddities.
Noticed
somewhere it's not checking for full weapon inventory gave 3 weapon glitch at some point buying wall weap with same weap in fridge and two gun in inventory
Also doesn't check for same weapon in inventory. When pulling g43 out of fridge and one in inventory it took my pistol and left me with one g43
upon hitting fridge again, got pistol back no issue, g43 in fridge still had g43 in inventory.
Another thing is hintstring stays the same whether you're trading or just putting one in but I also haven't got around to adding trems hintstring fix either, will follow up on that once it's implemented and tested.
I am aware though that these are old perk scripts so I will back up map at this point
add update, sort through 50+ pages for error fixing and also add trems hintstring fix.
Then I will test above changes thoroughly and report my finding
Should be able to sort syntax errors to as long as I make sure to get updated perks working first sonI know errors aren't coming from different places.
Thanks for taking the time harry as I read you've moved on from modding cod5.
Still trying to catch up but I appreciate your patience and assistance very much sir.
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
Another thing is hintstring stays the same whether you're trading or just putting one in but I also haven't got around to adding trems hintstring fix either, will follow up on that once it's implemented and tested.
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
weapon_locker_begin()
{
level.harry_perks_fix = true;
players = getplayers();
for( i = 0; i < players.size; i++ )
{
players[ i ] thread get_stored_gun();
}
self thread weapon_locker();
}
get_stored_gun()
{
wait 1;
self.stored_gun_ammo = self GetStat( 3007 );
self.stored_ammo_clip = self GetStat( 3008 );
self.has_stored_weapon = self GetStat( 3009 );
keys = GetArrayKeys( level.zombie_weapons );
self.stored_weapon = keys[ self GetStat( 3006 ) ];
}
weapon_locker()
{
wait 2;
weapon_locker = getEnt( "weapon_locker", "targetname" );
weapon_locker setHintString( "press & hold &&1 to store current weapon" );
weapon_locker setCursorHint( "HINT_NOICON" );
while( 1 )
{
weapon_locker waittill( "trigger", user );
if( is_player_valid( user ))
{
user.old_gun = user getcurrentweapon();
user.gun_ammo = user GetAmmoCount( user.old_gun );
user.gun_ammo_clip = user GetWeaponAmmoClip(user.old_gun);
// this line is for non valid weapons, such as perk bottles, knuckle crack and the syringe when reviving, this should only need to be changed if adding extra perks etc.
if (!( user.old_gun == "none" || user.old_gun == "syrette" || user.old_gun == "zombie_melee" || user.old_gun == "zombie_perk_bottle_revive" || user.old_gun == "zombie_perk_bottle_doubletap" || user.old_gun == "zombie_perk_bottle_jugg" || user.old_gun == "zombie_perk_bottle_sleight" || user.old_gun == "zombie_perk_bottle_staminup" || user.old_gun == "zombie_perk_bottle_phd" || user.old_gun == "zombie_perk_bottle_mulekick" || user.old_gun == "zombie_perk_bottle_deadshot" || user.old_gun == "zombie_perk_bottle_cherry" || user.old_gun == "zombie_perk_bottle_vulture" || user.old_gun == "zombie_knuckle_crack" || user.old_gun == "stielhandgranate" || user.old_gun == "zombie_cymbal_monkey" || user.old_gun == "zombie_bowie_flourish" ))
{
primaryWeapons = user GetWeaponsListPrimaries();
if( ( isDefined( primaryWeapons ) && primaryWeapons.size == 1 || isDefined( primaryWeapons ) && primaryWeapons.size == 2 && user hasPerk ( "specialty_extraammo" ) ) && user.has_stored_weapon == 1 )
{
if ( isDefined( level.harry_perks_fix ) && level.harry_perks_fix )
harrybo21_give_gun( user.old_gun );
else
user giveweapon( user.stored_weapon );
user SetWeaponAmmoStock(user.stored_weapon,user.stored_gun_ammo);
user SetWeaponAmmoClip(user.stored_weapon,user.stored_ammo_clip);
user switchtoweapon( user.stored_weapon );
user.has_stored_weapon = 0;
user SetStat(3009,0);
}
else
// the following line is for weapons that you do not want storeable, i added some from my own map and advise customizing for weapons in your own map. zombie colt should be changed to your starting weapon
if ( user.old_gun == "colt" || user.old_gun == "zombie_colt" || user.old_gun == "zombie_colt_upgraded" || user.old_gun == "tesla_gun" || user.old_gun == "tesla_gun_upgraded" || user.old_gun == "thundergun" || user.old_gun == "thundergun_upgraded" || user.old_gun == "ray_gun" || user.old_gun == "ray_gun_upgraded" || user.old_gun == "scavenger" || user.old_gun == "scavenger_upgraded" || user.old_gun == "vorkuta_knife" || user.old_gun == "vorkuta_knife_upgraded" )
{
user iPrintLnBold("^7cannot store this weapon");
wait 2;
}
else
{
primaryWeapons = user GetWeaponsListPrimaries();
if(!( isDefined( primaryWeapons ) && primaryWeapons.size == 1 || isDefined( primaryWeapons ) && primaryWeapons.size == 2 && user hasPerk ( "specialty_extraammo" ) ))
{
if ( isDefined( level.harry_perks_fix ) && level.harry_perks_fix )
harrybo21_take_gun( user.old_gun );
else
user takeWeapon( user.old_gun );
}
if(user.has_stored_weapon == 1)
{
if ( isDefined( level.harry_perks_fix ) && level.harry_perks_fix )
harrybo21_give_gun( user.old_gun );
else
user giveweapon( user.stored_weapon );
user SetWeaponAmmoStock( user.stored_weapon, user.stored_gun_ammo );
user SetWeaponAmmoClip( user.stored_weapon,user.stored_ammo_clip );
user switchtoweapon( user.stored_weapon );
}
user.switch_weapon = user.stored_weapon;
wait 0.1;
user.stored_weapon = user.old_gun;
user.stored_ammo_clip = user.gun_ammo_clip;
user.stored_gun_ammo = user.gun_ammo - user.stored_ammo_clip;
wait 0.1;
keys = GetArrayKeys( level.zombie_weapons );
for( i = 0; i < keys.size; i ++ )
{
if( keys[ i ] == user.stored_weapon )
{
user SetStat( 3006, i );
break;
}
}
user SetStat( 3007, user.stored_gun_ammo );
user SetStat( 3008, user.stored_ammo_clip );
user.has_stored_weapon = 1;
user SetStat( 3009, 1 );
user playlocalsound( "cha_ching" );
user.cur_gun = user getcurrentweapon();
primaryWeapons = user GetWeaponsListPrimaries();
if( isDefined( primaryWeapons ) && primaryWeapons.size > 0 && ( !( user.cur_gun == user.switch_weapon ) ) )
{
user SwitchToWeapon( primaryWeapons[ 0 ] );
}
wait 2;
}
}
}
}
}
harrybo21_take_gun( name )
{
if ( isDefined( self.grenade ) && self.grenade == name )
self.grenade = undefined;
else if ( isDefined( self.alt_grenade ) && self.alt_grenade == name )
self.alt_grenade = undefined;
else if ( isDefined( self.inventory ) && self.inventory.size > 0 )
{
for ( i = 0; i < self.inventory.size; i++ )
{
if ( self.inventory[ i ] == name )
{
self.inventory[ i ] = "none";
break;
}
}
}
self takeWeapon( name );
}
harrybo21_give_gun( gun, model_index )
{
primaryWeapons = self GetWeaponsListPrimaries();
currentWeapon = self getCurrentWeapon();
for ( i = 0; i < primaryWeapons.size; i++ )
if ( primaryWeapons[ i ] == gun + "_upgraded" )
gun = gun + "_upgraded";
if ( !self harrybo21_has_weapon( gun ) )
{
if ( gun == "zombie_cymbal_monkey" )
{
self maps\_zombiemode_cymbal_monkey::player_give_cymbal_monkey();
self harrybo21_set_alt_grenade( gun, 3 );
}
else if ( gun == "stielhandgranate" )
self harrybo21_set_grenade( gun, 4 );
else if ( gun == "molotov" || gun == "molotov_zombie" )
self harrybo21_set_alt_grenade( gun, 4 );
else
self harrybo21_set_weapon( gun, model_index );
}
else
{
if ( weaponClass( gun ) == "grenade" )
self giveMaxAmmo( gun );
else
self giveMaxAmmo( gun );
}
self notify( "weapon_obtained" );
}
harrybo21_get_weapon_index( gun )
{
for ( i = 0; i < self.inventory.size; i++ )
{
if ( self.inventory[ i ] == gun )
{
return i;
}
}
return undefined;
}
harrybo21_set_weapon( gun, model_index )
{
if ( !isDefined( model_index ) )
model_index = 0;
slot = self harrybo21_get_weapon_index( "none" );
if ( !isDefined( slot ) )
slot = self harrybo21_get_weapon_index( self getCurrentWeapon() );
if ( self.inventory[ slot ] != "none" )
self takeWeapon( self.inventory[ slot ] );
self.inventory[ slot ] = gun;
self giveWeapon( gun, model_index );
self switchToWeapon( gun );
}
harrybo21_set_grenade( gun, ammo )
{
ammo = ammo;
if ( !isDefined( ammo ) )
ammo = 0;
if ( isDefined( self.grenade ) && self.grenade != gun )
self takeWeapon( self.grenade );
self.grenade = gun;
self giveWeapon( gun );
self setWeaponAmmoClip( self.grenade, ammo );
}
harrybo21_set_alt_grenade( gun, ammo )
{
ammo = ammo;
if ( !isDefined( ammo ) )
ammo = 0;
if ( isDefined( self.alt_grenade ) && self.alt_grenade != gun )
self takeWeapon( self.alt_grenade );
self.alt_grenade = gun;
self giveWeapon( gun );
self setWeaponAmmoClip( self.alt_grenade, ammo );
}
level.harry_perks_fix = true;