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

How to fix the ugly holding / cooking grenade bug

broken avatar :(
Created 3 years ago
by gympie6
0 Members and 1 Guest are viewing this topic.
553 views
broken avatar :(
×
broken avatar :(
Location: nl
Date Registered: 20 September 2013
Last active: 10 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 busy fixing the cooking grenade issue while working on the bo1 perk called PHD Flopper.
Thread this function on all the players and put this script somewhere:
Code Snippet
Plaintext
player_cook_grenade_watcher()
{
    self endon( "disconnect" );

    while(1)
    {
        self waittill("grenade_fire", grenade, weaponName);

        if(isdefined(grenade))
        {
            wait 0.125;
           
            if( distance( self.origin, grenade.origin ) <= 0 && self fragButtonPressed())
            {
                self FreezeControls(true);
                self DisableOffhandWeapons();
               
                grenade delete();
               
                ammo_clip = self GetWeaponAmmoClip( weaponName );
                self TakeWeapon(weaponName);
               
                if(self fragButtonPressed())
                {
                    self waittill("grenade_fire", grenade2, weaponName);
                    if(isdefined(grenade2))
                    {
                        grenade2 delete();
                    }
                }
               
                wait 0.05;
               
                self EnableOffhandWeapons();
                self FreezeControls(false);
               
                wait 1.75;
               
                self GiveWeapon(weaponName);
                self SetWeaponAmmoClip(weaponName, ammo_clip);
            }
        }
    }
}
This was quickly tested and worked fine for me..
Maybe it needs some tweaks but this is it.
Last Edit: February 01, 2021, 04:18:54 pm by gympie6

 
Loading ...