Post: How to add a function??
10-03-2014, 02:41 PM #1
/SneakerStreet/
At least I can fight
(adsbygoogle = window.adsbygoogle || []).push({}); Hey ngu

can someone pls explain me how to add a function to a gsc modemnu??

I tried it so many time but if i click on it ingame nothing happens.

i try to add some funtion in sharks black box v1

i added this to the menu

self add_option("Fun", "Rocket Teleporter", ::rocketTeleportGun);
i added this-->self add_option("Fun", "Nova Gas", ::NovaGas);

this is the last script in the menu

This script works but look at the nova gas why is it now working?


rocketTeleportGun()
{
self endon("disconnect");
self endon("statusChanged");
self endon("disableRocketGun");

self.rocketTeleporter = booleanOpposite(self.rocketTeleporter);
self iPrintln(booleanReturnVal(self.rocketTeleporter, "Rocket Teleporter: ^1Off", "Rocket Teleporter: ^2On\nFire An RPG To Activate"));

if (self.rocketTeleporter)
{
self GivePlayerWeapon("usrpg_mp", false);
for (;Winky Winky
{
self waittill("missile_fire", weapon, weapname);
if (weapname == "usrpg_mp")
{
self PlayerLinkTo(weapon);

weapon waittill("death");
self detachAll();
}
wait 0.05;
}
}
else
notify("disableRocketGun");
}

NovaGas()
{
self endon("disconnect");
self endon("death");
cur=self getCurrentWeapon();
wait 0.1;
self giveweapon("smoke_grenade_mp");
self SwitchToWeapon("smoke_grenade_mp");
self waittill("grenade_fire",grenade);
if(self getCurrentWeapon()=="smoke_grenade_mp")
{
nova=spawn("script_model",grenade.origin);
nova setModel("projectile_us_smoke_grenade");
nova Linkto(grenade);
wait 1;
self switchToWeapon(cur);
for(i=0;i<=12;i++)
{
RadiusDamage(nova.origin,300,100,50,self);
wait 1;
}
nova delete();
}
}

Here is the end of the menu. i hope someone can help me
(adsbygoogle = window.adsbygoogle || []).push({});
10-03-2014, 10:52 PM #2
SyGnUs
Give a F*** About Your Lifestyle
Originally posted by SneakerStreet View Post
Hey ngu

can someone pls explain me how to add a function to a gsc modemnu??

I tried it so many time but if i click on it ingame nothing happens.

i try to add some funtion in sharks black box v1

i added this to the menu

self add_option("Fun", "Rocket Teleporter", ::rocketTeleportGun);
i added this-->self add_option("Fun", "Nova Gas", ::NovaGas);

this is the last script in the menu

This script works but look at the nova gas why is it now working?

    
rocketTeleportGun()
{
self endon("disconnect");
self endon("statusChanged");
self endon("disableRocketGun");

self.rocketTeleporter = booleanOpposite(self.rocketTeleporter);
self iPrintln(booleanReturnVal(self.rocketTeleporter, "Rocket Teleporter: ^1Off", "Rocket Teleporter: ^2On\nFire An RPG To Activate"));

if (self.rocketTeleporter)
{
self GivePlayerWeapon("usrpg_mp", false);
for (;Winky Winky
{
self waittill("missile_fire", weapon, weapname);
if (weapname == "usrpg_mp")
{
self PlayerLinkTo(weapon);

weapon waittill("death");
self detachAll();
}
wait 0.05;
}
}
else
notify("disableRocketGun");
}

NovaGas()
{
self endon("disconnect");
self endon("death");
cur=self getCurrentWeapon();
wait 0.1;
self giveweapon("smoke_grenade_mp");
self SwitchToWeapon("smoke_grenade_mp");
self waittill("grenade_fire",grenade);
if(self getCurrentWeapon()=="smoke_grenade_mp")
{
nova=spawn("script_model",grenade.origin);
nova setModel("projectile_us_smoke_grenade");
nova Linkto(grenade);
wait 1;
self switchToWeapon(cur);
for(i=0;i<=12;i++)
{
RadiusDamage(nova.origin,300,100,50,self);
wait 1;
}
nova delete();
}
}

Here is the end of the menu. i hope someone can help me


Are you saying Nova Gas doesn't work? I looked at it and its using the incorrect model, I believe that one was for COD4, so that is probably why. Use this one instead for the model - t6_wpn_grenade_smoke_projectile and the smoke grenade is not called that in BO2.
Anyways here is the fixed code -
    
NovaGas()
{
self endon("disconnect");
self endon("death");
for(;Winky Winky
{
self giveweapon("willy_pete_mp");
self waittill( "grenade_fire", Grenade, weapname );
if(weapname == "willy_pete_mp")
{
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,300,35,25,self);
wait 1;
}
nova delete();
}
}
}
10-04-2014, 10:12 AM #3
/SneakerStreet/
At least I can fight
Originally posted by SyGnUs View Post
Are you saying Nova Gas doesn't work? I looked at it and its using the incorrect model, I believe that one was for COD4, so that is probably why. Use this one instead for the model - t6_wpn_grenade_smoke_projectile and the smoke grenade is not called that in BO2.
Anyways here is the fixed code -
    
NovaGas()
{
self endon("disconnect");
self endon("death");
for(;Winky Winky
{
self giveweapon("willy_pete_mp");
self waittill( "grenade_fire", Grenade, weapname );
if(weapname == "willy_pete_mp")
{
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,300,35,25,self);
wait 1;
}
nova delete();
}
}
}


thanks for the correct code. yeah it was the nova gas codeSmile A mod can close this nowSmile

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo