
Posts
678
Respect
194Add +1
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
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 shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;
init()
{
level thread fix_on_player_connect();
}
fix_on_player_connect()
{
for( ;; )
{
level waittill( "connecting", player );
player thread begin_firing_fix();
player thread end_firing_fix();
player thread fire_fix();
}
}
check_is_weapon(weapon)
{
// I couldn't find a check for 3-round burst weapons...
// Add your 3-round burst weapons here!
if(weapon == "zm_m16"
|| weapon == "ray_gun2"
|| weapon == "ray_gun2_upgraded"
|| weapon == "acidgat_zm"
|| weapon == "acidgat_zm_upgraded")
{
return true;
}
return false;
}
begin_firing_fix()
{
self endon("disconnect");
while(1)
{
self waittill( "begin_firing" );
current_weapon = self GetCurrentWeapon();
if (check_is_weapon(current_weapon))
{
stock_ammo = self getWeaponAmmoStock( current_weapon );
if (stock_ammo == 0)
{
self setWeaponAmmoStock( current_weapon, 1 );
}
}
}
}
end_firing_fix()
{
self endon("disconnect");
while(1)
{
self waittill( "end_firing" );
current_weapon = self GetCurrentWeapon();
if (check_is_weapon(current_weapon))
{
stock_ammo = self getWeaponAmmoStock( current_weapon );
if (stock_ammo <= 1)
{
self setWeaponAmmoStock( current_weapon, 0 );
}
}
}
}
fire_fix()
{
self endon("disconnect");
while(1)
{
self waittill( "weapon_fired" );
current_weapon = self GetCurrentWeapon();
if (check_is_weapon(current_weapon))
{
clip_ammo = self GetWeaponAmmoClip( current_weapon );
stock_ammo = self getWeaponAmmoStock( current_weapon );
if (stock_ammo <= 1 && clip_ammo == 0)
{
self setWeaponAmmoStock( current_weapon, 0 );
}
}
}
}