Post: Replacing the tactical grenade
11-12-2015, 11:46 PM #1
BullyWiiPlaza
Climbing up the ladder
(adsbygoogle = window.adsbygoogle || []).push({}); I'm having issues with replacing the tactical grenade since no good function seems to exist.
    getcurrentoffhand()

returns the lethal grenade but how do I get the tactical one?

Yes, I could do
    takeAllWeapons()
and then
    giveWeapon("my_tactical");
but that sucks. I want to keep everything else intact. Dave

The code in particular that I want to fix is Nova Gas. It's still glitchy, you have to use a tactical or lethal before it even gives the Smoke grenade.
    toggleNovaGas()
{
modName = "Nova Gas";

if(!self.novaGas)
{
self.novaGas = true;
self iPrintln("Nova Gas ^2ON");
self thread novaGas();

return;
}

self.novaGas = false;
self iPrintln("Nova Gas ^1OFF");
self notify("stopNovaGas");
}

novaGas()
{
self endon("disconnect");
self endon("stopNovaGas");

while(true)
{
grenadeType = "willy_pete_mp";
// self takeAllWeapons();
self takeWeapon(self getCurrentOffhand());
self giveWeapon(grenadeType);
self giveMaxAmmo(grenadeType);
self switchToWeapon(grenadeType);
self waittill( "grenade_fire", grenade, weapname);

if(weapname == grenadeType)
{
self thread causeNovaGasEffect(grenade);
}
}
}

causeNovaGasEffect(grenade)
{
nova = spawn("script_model", grenade.origin);
nova setModel("t6_wpn_grenade_smoke_projectile");
nova linkto(grenade);
wait 1;

for(i = 0; i <= 12; i++)
{
radiusDamage(nova.origin, 250, 25, 15, self);
wait 1;
}

nova delete();
}

Thanks a lot for your help Happy
(adsbygoogle = window.adsbygoogle || []).push({});

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo