ItsMods

Full Version: Can you disable the jump button for a period of time?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
As i have made a player be able to jump really high(as high as the world can allow).
There is an exploit where you can keep pressing space and he will just keep on jumping and stop on top of the world so to speak.
I as wondering if you could make it be able to press jump once then disable it or make you not able to use it again until you hit the ground.

Thanks in Advance!


PS: Im using a modified jetpack mod
copy the code here that you are using
(07-02-2011, 01:35)koil Wrote: [ -> ]copy the code here that you are using
What code?
the jet pack code






Jetpack()
{
self endon("death");

self setPerk("specialty_fallheight");
self.jetpack = 10;
FUEL = createPrimaryProgressBar( -275 );
FUELTXT = createPrimaryProgressBarText( -275 );
FUELTXT setText("^1FUEL");
FUELTXT.y = 210;
FUEL.bar.y = 220;
FUEL.y = 220;
self thread HUDestroy(FUEL.bar);
self thread HUDestroy(FUEL);
self thread HUDestroy(FUELTXT);
for(i=0;;i++)
{
if(self jumpbuttonpressed() && self.jetpack > 0)
{
if(self isOnGround())
{
self setOrigin((self.origin[0], self.origin[1], self.origin[2] + 30));

}
else
{
self.jetpack--;
Earthquake(.15 , .2, self gettagorigin("j_spine4"), 50);
PlayFX(level.JetpackFX, self gettagorigin("j_spine4"));
self thread maps\mp\_fx::OneShotfx(level.JetPackFX, self gettagorigin("j_spine4"), 2);

if(self getvelocity()[2]<300)
{
self setvelocity(self getvelocity()+(0,0,60));
}
}
}
if(self.jetpack<10 &&!self jumpbuttonpressed())
{
self.jetpack++;
}
FUEL updateBar(self.jetpack/6000);
FUEL.bar.color=(1,self.jetpack/150,self.jetpack/150);
wait .05;
}
}


HUDestroy(hudElem)
{
self endon("spawned_player");

hudElem destroy();
hudElem delete();
}
one sec ill test it
ok i checked your code, just disable your gravity DVAR and it will work the way you want.. lol