UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

3-round burst fix

broken avatar :(
Created 2 years ago
by gympie6
0 Members and 1 Guest are viewing this topic.
487 views
broken avatar :(
×
broken avatar :(
Location: nl
Date Registered: 20 September 2013
Last active: 11 days ago
Posts
645
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
No code is bug free
Signature
My published cod maps:

Subzero
Djinncaves
Enclosed (a.k.a baconcube)
Bayern
Snowblind
Furtrelock

Black Ops Perks: https://www.ugx-mods.com/forum/scripts/55/call-of-duty-world-at-war-black-ops-perks/22180/
×
gympie6's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
gympie6's Contact & Social LinksTheRevenantSkullTeffrieTeffrieGympie5#5971
I was working on my map and added some three round burst weapons to the game.
When I reload with the last magazine I noticed that the weapon is firing very slow with weird delay.
If there is one bullet reserve this problem won't happen so that gave me an idea.
 
There is a tutorial that should have a fix but for me it didn't work:
https://www.ugx-mods.com/forum/modding/52/user-tutorial-weapon-settings-in-a-weapon-file/5651/
 
This one however seems to fix the issue:
https://www.ugx-mods.com/forum/modding/52/slow-3-round-burst-weapon-fix-verteseas-fix/23898/
I leave this fix up in case it's still neccesary.
 
Anyway here is the fix, make a new gsc file with name three_round_burst_fix and paste this:
 
Code Snippet
Plaintext
#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 );
            }
        }
    }
}

add this under maps\_load::main(); in _zombiemode.gsc
 
maps\three_round_burst_fix::init();
 
You're done congrats!
 
 
Last Edit: December 02, 2023, 09:59:28 pm by gympie6
<32

 
Loading ...