



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 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 |
// ==========================================================
// Coding Projects
//
// Component: WaW
// Purpose: Code for dropping a weapon through script
// PROPERLY!!!
//
// Initial author: DidUknowiPwn
// Started: 2014-12-13
// © 2014 DidUknowiPwn™
// ==========================================================
#include common_scriptsutility;
#include maps\_utility;
#include maps\_zombiemode_utility;
#include maps\_loadout;
init()
{
level thread onPlayerConnect();
}
onPlayerConnect()
{
for(;;)
{
level waittill("connecting", player);
player thread onPlayerSpawned();
}
}
onPlayerSpawned()
{
self endon("disconnct");
for(;;)
{
self waittill("spawned_player");
wait 2;
self thread DropLeWeapon("zombie_kar98k");
}
}
DropLeWeapon( weapon_name )
{
weapon = weapon_name;
item = Spawn( "weapon_" + weapon_name, self.origin + (0,0,12) );
item SetModel( GetWeaponModel(weapon) );
clipAmmo = RandomInt( WeaponClipSize(weapon) );
stockAmmo = RandomIntRange( WeaponClipSize(weapon), WeaponMaxAmmo( weapon ) + 1 );
stockMax = WeaponMaxAmmo( weapon );
if ( stockAmmo > stockMax )
stockAmmo = stockMax;
item ItemWeaponSetAmmo( clipAmmo, stockAmmo );
item itemRemoveAmmoFromAltModes();
}
itemRemoveAmmoFromAltModes()
{
origweapname = self getItemWeaponName();
curweapname = weaponAltWeaponName( origweapname );
altindex = 1;
while ( curweapname != "none" && curweapname != origweapname )
{
self itemWeaponSetAmmo( 0, 0, altindex );
curweapname = weaponAltWeaponName( curweapname );
altindex++;
}
}
getItemWeaponName()
{
classname = self.classname;
assert( getsubstr( classname, 0, 7 ) == "weapon_" );
weapname = getsubstr( classname, 7 );
return weapname;
}