


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!![]() | Has released one or more maps to the UGX-Mods community. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
![]() BO3 Modtools Alpha | This user has access to the Black Ops 3 Modtools Alpha |
maps\_zombiemode::main();
maps\_zombiemode::main();
maps\_mc_weapon_trade::init();
startingWeapon = "kar98k"; //change this to be the first weapon on trade table
cost = 0; //change this to cost something to trade, i.e. 250, 750

![]() | Has released one or more maps to the UGX-Mods community. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
![]() BO3 Modtools Alpha | This user has access to the Black Ops 3 Modtools Alpha |
looks great can't wait to add it to my map, but does it work with ported weapons? all of my guns in my current map are ported weapons.



[/url]![]() | 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. |
![]() | Has released one or more maps to the UGX-Mods community. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
![]() BO3 Modtools Alpha | This user has access to the Black Ops 3 Modtools Alpha |
that's a good damn idea man gg
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
+1![]() | Has released one or more maps to the UGX-Mods community. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
![]() BO3 Modtools Alpha | This user has access to the Black Ops 3 Modtools Alpha |
great idea man+1
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |

![]() | 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. |
Thanks man. The idea hit me today while working on another EE. I was wondering if it was done already?

![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |

Thanks man. The idea hit me today while working on another EE. I was wondering if it was done already?
![]() | |
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Has shown excellence and experience in the area of custom scripting in the UGX-Mods community. |
![]() BO3 Modtools Alpha | This user has access to the Black Ops 3 Modtools Alpha |
![]() | Has released one or more maps to the UGX-Mods community. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
![]() BO3 Modtools Alpha | This user has access to the Black Ops 3 Modtools Alpha |
Jesus what's with the repeated code?
i.e. takeweapon, giveweapon, ammo, etc.
You could have just made a bool check something like weapontraded = true and then passed weapontraded as a parameter to another function to set everything else or even just remove all duplicate code.
Edit: There's a lot of problems your code, wrong functions used for sound and players can glitch the amount of ammo you could get.
WeaponTrade(startingWeapon){
self.Script_Noteworthy = startingWeapon;
weapon = undefined;
showGun = getent(self.target, "targetname");
while(1){
if(!(weapon == self.Script_Noteworthy)){
weapon = self.Script_Noteworthy;
showGun setmodel( GetWeaponModel(weapon, 0));
showGun.origin = showGun.origin + (0,0,10);
showGun PhysicsLaunch( showGun.origin, (0,0,0) );
wait(1);
}
self waittill("trigger", player);
if(player.score >= self.zombie_cost){
playerWeapon = player GetCurrentWeapon();
if(!( playerWeapon == "mk2_frag" || playerWeapon == "fraggrenade" || playerWeapon == "stielhandgranate" || playerWeapon == "molotov" || playerWeapon == "zombie_cymbal_monkey" )){
weapons = player GetWeaponsListPrimaries();
if(!(player HasWeapon( self.Script_Noteworthy ))){
if(!(self.zombie_cost == 0)){
player maps\_zombiemode_score::minus_to_player_score( self.zombie_cost );
player playsound( "cha_ching" );
}
if(weapons.size>1){
self TradeWeapons(playerWeapon, player);
}else{
if(!(self.Script_Noteworthy == startingWeapon)){
glitch = 0;
glitchWeaponAmmoClip = 0;
glitchWeaponAmmoStock = 0;
if(player HasWeapon( startingWeapon )){
glitch = 1;
glitchWeaponAmmoClip = player GetWeaponAmmoClip( startingWeapon );
glitchWeaponAmmoStock = player GetWeaponAmmoStock( startingWeapon );
player TakeWeapon(startingWeapon);
}
player GiveWeapon(startingWeapon);
player SwitchToWeapon( startingWeapon);
self TradeWeapons(startingWeapon, player);
if(glitch){
player GiveWeapon(startingWeapon);
player SetWeaponAmmoClip(startingWeapon,glitchWeaponAmmoClip);
player SetWeaponAmmoStock(startingWeapon,glitchWeaponAmmoStock);
}
}else{
player GiveWeapon(startingWeapon);
player SwitchToWeapon( startingWeapon);
}
}
}else{
player iprintlnbold("You already have that weapon");
}
}
}else{
player playsound( "no_cha_ching" );
}
}
}
TradeWeapons(weapon, player){
weaponAmmoClip = player GetWeaponAmmoClip( weapon );
weaponAmmoStock = player GetWeaponAmmoStock( weapon );
player TakeWeapon( weapon );
player GiveWeapon(self.Script_Noteworthy);
player SwitchToWeapon( self.Script_Noteworthy);
player SetWeaponAmmoClip(self.Script_Noteworthy,self.weaponAmmoClip);
player SetWeaponAmmoStock(self.Script_Noteworthy,self.weaponAmmoStock);
self.Script_Noteworthy = weapon;
self.weaponAmmoClip = weaponAmmoClip;
self.weaponAmmoStock = weaponAmmoStock;
}
![]() | |
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Has shown excellence and experience in the area of custom scripting in the UGX-Mods community. |
![]() BO3 Modtools Alpha | This user has access to the Black Ops 3 Modtools Alpha |
#include maps\_utility;
#include common_scripts\utility;
#include maps\_zombiemode_utility;
/*
#########################
by: M.A.K.E C E N T S
_mc_weapon_trade
modified by: DidUknowiPwn
#########################
*/
init()
{
set_dvar_int_if_unset("scr_zom_weapon_trade_cost", 0); //DUKIP - Default cost to 0, unless already defined by config, menu, etc.
set_dvar_if_unset("scr_zom_weapon_trade_start", "kar98k"); //DUKIP - Default wt (weapon trade) to kar98k, unless already defined by config, menu, etc.
wtStartingWeapon = GetDvar("scr_zom_weapon_trade_start");
cost = GetDvarInt("scr_zom_weapon_trade_cost");
trigs = GetEntArray("weapontrade", "targetname");
for( i = 0; i < trigs.size; i++ )
{
trigs[i] SetCursorHint("HINT_NOICON");
trigs[i] UseTriggerRequireLookAt();
trigs[i].zombie_cost = cost;
if(trigs[i].zombie_cost == 0)
trigs[i] SetHintString("Press &&1 to trade your weapon");
else
trigs[i] SetHintString("Press &&1 to trade your weapon [Cost: " + trigs[i].zombie_cost + "]");
trigs[i] thread WeaponTrade(wtStartingWeapon);
}
}
WeaponTrade(wtStartingWeapon)
{
wtWeapon = wtStartingWeapon;
wtModel = GetWeaponModel(wtWeapon);
self SetModel(wtModel);
wtAmmoClip = undefined;
wtAmmoStock = undefined;
wtTradeWeap = undefined;
while( true )
{
self.trigger waittill("trigger", player);
if( player.score >= self.trigger.zombie_cost && !IsDefined( player.revivetrigger ) )
{
weapon = player GetCurrentWeapon();
if( weaponClass( weapon ) != "grenade" && !IsSubStr( weapon, "m7_launcher" ) && weapon != "none" )
{
totalWeapons = player GetWeaponsListPrimaries();
if( !( player HasWeapon( wtWeapon ) ) )
{
if( self.trigger.zombie_cost > 0 )
{
player maps\_zombiemode_score::minus_to_player_score( self.trigger.zombie_cost );
player PlayLocalSound( "cha_ching" );
}
if( totalWeapons.size > 1 )
{
tradeWeapAmmoClip = player GetWeaponAmmoClip( weapon );
tradeWeapAmmoStock = player GetWeaponAmmoStock( weapon );
wtTradeWeap = weapon;
player TakeWeapon( weapon );
wtShouldChange = true;
}
else if( totalWeapons.size <= 1 )
{
tradeWeapAmmoClip = player GetWeaponAmmoClip( weapon );
tradeWeapAmmoStock = player GetWeaponAmmoStock( weapon );
wtShouldChange = false;
}
else
continue;
player GiveWeapon( wtWeapon );
player SwitchToWeapon( wtWeapon );
player SetWeaponAmmoClip(wtWeapon, wtAmmoClip);
player SetWeaponAmmoStock(wtWeapon, wtAmmoStock);
wtAmmoClip = tradeWeapAmmoClip;
wtAmmoStock = tradeWeapAmmoStock;
if( wtShouldChange )
{
wtWeapon = wtTradeWeap;
self SetModel( GetWeaponModel( wtWeapon ) );
self.origin += (0, 0, 10);
self PhysicsLaunch( self.origin, (0,0,0) );
wtShouldChange = undefined;
}
}
else
player IPrintLnBold("You already have that weapon!");
}
}
else
player PlayLocalSound( "no_cha_ching" );
wait 1;
}
}
//DUKIP - Copied from another WaW GSC.
set_dvar_int_if_unset(dvar, value)
{
if (GetDvar(dvar)=="")
{
SetDvar(dvar, value);
return int(value);
}
return GetDvarInt(dvar);
}
set_dvar_if_unset(dvar, value)
{
if (GetDvar(dvar)=="")
{
SetDvar(dvar, value);
return value;
}
return GetDvar(dvar);
}