onPlayerMultijump()
{
self endon( "disconnect" );
self thread landsOnGround();
self notifyOnPlayerCommand( "action_made_+gostand", "+gostand" );
if(!isDefined(level.numOfMultijumps))
level.numOfMultijumps = 0;
for(;
{
currentNum = 0;
self waittill( "action_made_+gostand" );
if ( !isAlive( self ) )
{
self waittill("spawned_player");
continue;
}
if ( !self isOnGround() )
{
while( !self isOnGround() && isAlive( self ) && currentNum < level.numOfMultijumps)
{
waittillResult = self waittill_any( "action_made_+gostand", "landedOnGround", "disconnect", "death" );
if(waittillResult == "action_made_+gostand" && !self isOnGround() && isAlive( self ))
{
playerAngles = self getplayerangles();
playerVelocity = self getVelocity();
if(playerVelocity[2] < 0)
playerVelocity[2] = 0;
self setvelocity( (playerVelocity[0], playerVelocity[1], playerVelocity[2] + sqrt(getDvarFloat("jump_height") * getDvarInt("g_gravity") * 2) ) );
currentNum++;
}
else
break;
}
while(!self isOnGround())
wait 0.05;
}
}
}
landsOnGround()
{
self endon( "disconnect" );
loopResult = true;
for(;
{
wait 0.05;
newResult = self isOnGround();
if(newResult != loopResult)
{
if(!loopResult && newResult)
self notify( "landedOnGround" );
loopResult = newResult;
}
}
}
Copyright © 2025, NextGenUpdate.
All Rights Reserved.