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 4 months ago
by gympie6
0 Members and 1 Guest are viewing this topic.
141 views
broken avatar :(
×
broken avatar :(
Location: nl
Date Registered: 20 September 2013
Last active: 9 days ago
Posts
575
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.
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 shooting very weird and slowly.
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/
 
Anyway here is the fix, make a new gsc file with name three_round_burst_fix and paste this:
#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: May 17, 2022, 10:17:43 pm by gympie6
<31

 
Loading ...