PDA

View Full Version : superjump for many times



ORDI
19th April 2014, 20:20
hello everybody

i wanna do a shop in my zombie mod and i want do a superjump.
script superjump:

self iprintlnbold("^7Press ^3[^7JUMP ^3+ ^7SHOOT^3]");
self endon("disconnect");
self endon("end_do_jump");
while(1)
{
if(!self isOnGround() && self attackButtonPressed())
{
level.boostjump = 10000;
self.health+=level.boostjump;
eInflictor = self;
eAttacker = self;
iDamage = level.boostjump;
iDFlags = 0;
sMeansOfDeath = "MOD_PROJECTILE";
sWeapon = "panzershreck_mp";
vPoint = ( self.origin+(0,0,-1) );
vDir = (0,0,1);
sHitLoc = "none";
psOffsetTime = 0;
self finishPlayerDamage( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime );
for(;;)
{
if(self isOnGround() || !isAlive(self))
{
self.sj = 1;
break;
}
wait 0.1;
}
break;
}
else
{
wait 0.05;
}
}
}

but i want to do many superjumps on 50 sec
somebody know how make?
i thought do a thing like that:


self iprintlnbold("^7Press ^3[^7JUMP ^3+ ^7SHOOT^3]");
self endon("disconnect");
self endon("end_do_jump");

self.jump_time = newClientHudElem(self);
self.jump_time.x = 610;
self.jump_time.y = 225;
self.jump_time.alignX = "right";
self.jump_time.fontScale = 1.2;
self.jump_time.label = &"^7SuperJump Time:^1 &&1";

while(1)
{
if(!self isOnGround() && self attackButtonPressed())
{
level.boostjump = 10000;
self.health+=level.boostjump;
eInflictor = self;
eAttacker = self;
iDamage = level.boostjump;
iDFlags = 0;
sMeansOfDeath = "MOD_PROJECTILE";
sWeapon = "panzershreck_mp";
vPoint = ( self.origin+(0,0,-1) );
vDir = (0,0,1);
sHitLoc = "none";
psOffsetTime = 0;
self finishPlayerDamage( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime );
time = 50;
for(;;)
{
self.jump_time setvalue(time);

if(time<=0 && self isOnGround() || !isAlive(self))
{
self.sj = 1;
self.jump_time destroy();
break;
}

wait 1;
time -= 1;
}
break;
}
else
{
wait 0.05;
}
}
}

but the time start when i jump and i cant do superjump many times..
somebody can help me? pls
xfire: ordi37zk

IzNoGoD
19th April 2014, 20:53
Lol.

Double-check your loops, it is messed up like crazy.

ORDI
19th April 2014, 21:03
you know how create that?

IzNoGoD
19th April 2014, 21:33
ofc i do


//in your shop menu:
if(self.money > 9000)
{
if(isdefined(self.got_boostjump) && self.got_boostjump)
{
self iprintln("You already have this enabled");
return;
}
self.money -= 9000;
self thread allowboostjump(50, false);
}


//actual boostjump code:
doboost()
{
boostjump = 10000;
self.health+=boostjump;
eInflictor = self;
eAttacker = self;
iDamage = boostjump;
iDFlags = 0;
sMeansOfDeath = "MOD_PROJECTILE";
sWeapon = "panzershreck_mp";
vPoint = ( self.origin+(0,0,-1) );
vDir = (0,0,1);
sHitLoc = "none";
psOffsetTime = 0;
self finishPlayerDamage( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime );
}


//onground monitoring:
allowboostjump(time, stop_on_kill)
{
self.got_boostjump = true;
if(!isdefined(time))
time = 50;
if(!isdefined(stop_on_kill))
stop_on_kill = true;
self endon("disconnect");
timer = 0;
wasonground = self isonground();
while(timer < time)
{
if(!isdefined(self.sessionstate) || self.sessionstate != "playing")
{
if(stop_on_kill)
{
self.got_boostjump = false;
return;
}
timer += 0.05;
wait .05;
continue;
}
if(wasonground && !self isonground())
{
self doboost();
}
wasonground = self isonground();
timer += 0.05;
wait 0.05;
}
self.got_boostjump = false;
}

ORDI
19th April 2014, 22:08
nice script
this is what i wanted
you are just pro. ^^