Question Replicate Gobble Gum Animation [ Answered ]

Lzombie

Veteran
Messages
27
Reaction score
7
Points
793
Hi, I'm trying to create a function that gives the player a weapon "zombie_bgb_grab" then waits a certain time and takes the weapon.
Either that or play the gum grab animation without giving/taking etc.

I have the commands that would work INGAME, but for GSC. I have tried these self zm_weapons::weapon_give("zombie_bgb_grab"); and self zm_weapons::weapon_give(getweapon("zombie_bgb_grab"));.

Both did not seem to work, I tried switchtoweapon and switchtoweaponimmediate with them too.
The command that does it perfectly via ingame console commands;
take zombie_bgb_grab;give zombie_bgb_grab;wait 350;take zombie_bgb_grab

That alone is what I need....but for some reason I cannot find the name for the weapon that would work with giveweapon().
 

Lzombie

Veteran
Messages
27
Reaction score
7
Points
793
This should work.
PHP:
#using scripts\zm\_zm_equipment;
function private temp_give(wep)
{
    if (getweapon(wep))
    {
        self endon("disconnect");
        self zm_utility::increment_is_drinking();
        self zm_utility::disable_player_move_states(true);
        primaries = self getweaponslistprimaries();
        original_weapon = self getcurrentweapon();
        weapon = getweapon(wep);
        if (original_weapon != level.weaponNone && !zm_utility::is_placeable_mine(original_weapon) && !zm_equipment::is_equipment(original_weapon))
            self notify("zmb_lost_knife");
        else
            return;
        self giveweapon(weapon);
        self switchtoweapon(weapon);
        self util::waittill_any("fake_death", "death", "player_downed", "weapon_change_complete");
        self zm_utility::enable_player_move_states();
        if (self laststand::player_is_in_laststand() || IS_TRUE(self.intermission))
        {
            self takeweapon(weapon);
            return;
        }
        self zm_utility::decrement_is_drinking();
        self takeweapon(weapon);
        primaries = self getweaponslistprimaries();
        if(IS_DRINKING(self.is_drinking))
            return;
        else
            self zm_weapons::switch_back_primary_weapon();
    }
}
self plr temp_give("zombie_bgb_grab");
 
Last edited:
Top