Posts: 75
Threads: 14
Joined: May 2011
Reputation:
0
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
Posts: 474
Threads: 67
Joined: May 2011
Reputation:
11
copy the code here that you are using
Posts: 75
Threads: 14
Joined: May 2011
Reputation:
0
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();
}
Posts: 474
Threads: 67
Joined: May 2011
Reputation:
11
07-02-2011, 02:01
(This post was last modified: 07-02-2011, 02:15 by koil.)
one sec ill test it
ok i checked your code, just disable your gravity DVAR and it will work the way you want.. lol