Post: [SCRIPT] Bunny Hopping
06-11-2012, 07:07 PM #1
(adsbygoogle = window.adsbygoogle || []).push({});
nothing amazing about this, just something ive found through the game files produced by the makers of deathrun, ill optimize it after if anyone wants it optimized. btw this hasn't been tested


    bunnyHoop()
{
self endon("disconnect");
self endon("spawned_player");
self endon("joined_spectators");
self endon("death");

if( !level.dvar["bunnyhoop"] )
return;

wait 2; // this is just to make sure that new players won't spawn and bunny hoop in 1st frame

// mnaauuu
last = self.origin;
lastBH = 0;
lastCount = 0;
// ----- //

while( isAlive( self ) )
{
// mnaauuu
dist = distance(self.origin, last);
last = self.origin;
if ( dist > 450 && lastBH && lastCount > 5)
{
num = self getEntityNumber();
guid = self getGuid();
logPrint( "LJ;" + guid + ";" + num + ";" + self.name + ";\n" );
self iprintln("^3Lagjump? ^1DIE!");
self suicide();
}
lastBH = self.doingBH;
wait 0.1;
self setClientDvar( "com_maxfps", 250 ); // what is this for?
// ----- //

stance = self getStance();
useButton = self useButtonPressed();
onGround = self isOnGround();
fraction = bulletTrace( self getEye(), self getEye() + vector_scale(anglesToForward(self.angles), 32 ), true, self )["fraction"];

// Begin
if( !self.doingBH && useButton && !onGround && fraction == 1 )
{
self setClientDvars( "bg_viewKickMax", 0, "bg_viewKickMin", 0, "bg_viewKickRandom", 0, "bg_viewKickScale", 0 );
self.doingBH = true;
lastCount = 0;
}

// Accelerate
if( self.doingBH && useButton && onGround && stance != "prone" && fraction == 1 )
{
lastCount++;
if( self.bh < 120 )
self.bh += 30;
}

// Finish
if( self.doingBH && !useButton || self.doingBH && stance == "prone" || self.doingBH && fraction < 1 )
{
self setClientDvars( "bg_viewKickMax", 90, "bg_viewKickMin", 5, "bg_viewKickRandom", 0.4, "bg_viewKickScale", 0.2 );
self.doingBH = false;
self.bh = 0;
lastCount = 0;
continue;
}

// Bounce
if( self.bh && self.doingBH && onGround && fraction == 1 )
{
bounceFrom = (self.origin - vector_scale( anglesToForward( self.angles ), 50 )) - (0,0,42);
bounceFrom = vectorNormalize( self.origin - bounceFrom );
self bounce( bounceFrom, self.bh );
self bounce( bounceFrom, self.bh );
wait 0.1;
}
}
}


How to Use: Press Sprint + Use (square) & jump (x) to bunny hop.

Video - skip to 0:40 seconds




Credit goes to lau12345671 for the vid and Brax for scripting this.
(adsbygoogle = window.adsbygoogle || []).push({});

The following 5 users say thank you to Uk_ViiPeR for this useful post:

Correy, forflah123, Harry, KingcreekS, Taylor
06-11-2012, 07:16 PM #2
Harry
Former Staff
awesome thanks mate, good to see you posting more stuff on this site ^^

Also, need some help with COD4 AI Zombies ?
06-11-2012, 07:21 PM #3
INSAN3LY_D34TH
INSAN3LY GAMING
Originally posted by ViiPeR View Post
nothing amazing about this, just something ive found through the game files produced by the makers of deathrun, ill optimize it after if anyone wants it optimized.


    bunnyHoop()
{
self endon( "disconnect" );
self endon( "spawned_player" );
self endon( "joined_spectators" );
self endon( "death" );

if( !level.dvar["bunnyhoop"] )
return;

wait 2; // this is just to make sure that new players won't spawn and bunny hoop in 1st frame

// mnaauuu
last = self.origin;
lastBH = 0;
lastCount = 0;
// ----- //

while( isAlive( self ) )
{
// mnaauuu
dist = distance(self.origin, last);
last = self.origin;
if ( dist > 450 && lastBH && lastCount > 5)
{
num = self getEntityNumber();
guid = self getGuid();
logPrint( "LJ;" + guid + ";" + num + ";" + self.name + ";\n" );
self iprintln("^3Lagjump? ^1DIE!");
self suicide();
}
lastBH = self.doingBH;
wait 0.1;
self setClientDvar( "com_maxfps", 250 ); // what is this for?
// ----- //

stance = self getStance();
useButton = self useButtonPressed();
onGround = self isOnGround();
fraction = bulletTrace( self getEye(), self getEye() + vector_scale(anglesToForward(self.angles), 32 ), true, self )["fraction"];

// Begin
if( !self.doingBH && useButton && !onGround && fraction == 1 )
{
self setClientDvars( "bg_viewKickMax", 0, "bg_viewKickMin", 0, "bg_viewKickRandom", 0, "bg_viewKickScale", 0 );
self.doingBH = true;
lastCount = 0;
}

// Accelerate
if( self.doingBH && useButton && onGround && stance != "prone" && fraction == 1 )
{
lastCount++;
if( self.bh < 120 )
self.bh += 30;
}

// Finish
if( self.doingBH && !useButton || self.doingBH && stance == "prone" || self.doingBH && fraction < 1 )
{
self setClientDvars( "bg_viewKickMax", 90, "bg_viewKickMin", 5, "bg_viewKickRandom", 0.4, "bg_viewKickScale", 0.2 );
self.doingBH = false;
self.bh = 0;
lastCount = 0;
continue;
}

// Bounce
if( self.bh && self.doingBH && onGround && fraction == 1 )
{
bounceFrom = (self.origin - vector_scale( anglesToForward( self.angles ), 50 )) - (0,0,42);
bounceFrom = vectorNormalize( self.origin - bounceFrom );
self bounce( bounceFrom, self.bh );
self bounce( bounceFrom, self.bh );
wait 0.1;
}
}
}


All Credit goes to the producers of the deathrun mod in the cod4 scene.


Video??? And it sounds like it would be pretty fun haha
06-11-2012, 07:25 PM #4
Originally posted by Hxrry View Post
awesome thanks mate, good to see you posting more stuff on this site ^^

Also, need some help with COD4 AI Zombies ?


not atm, im not doing any work till my last exams over this Wednesday.

---------- Post added at 08:25 PM ---------- Previous post was at 08:24 PM ----------

Originally posted by D34TH View Post
Video??? And it sounds like it would be pretty fun haha


you`ll have to ask someone else, im too busy atm. Thread has been updated.
06-11-2012, 07:30 PM #5
Harry
Former Staff
yeah i know that, also hope exam went well today :love: When your all done, im offering my help. after all, i wanna get better at coding <3
06-11-2012, 07:31 PM #6
this has a bad syntaxx :( You must login or register to view this content.
Originally posted by ViiPeR View Post
nothing amazing about this, just something ive found through the game files produced by the makers of deathrun, ill optimize it after if anyone wants it optimized.


    bunnyHoop()
{
self endon( "disconnect" );
self endon( "spawned_player" );
self endon( "joined_spectators" );
self endon( "death" );

if( !level.dvar["bunnyhoop"] )
return;

wait 2; // this is just to make sure that new players won't spawn and bunny hoop in 1st frame

// mnaauuu
last = self.origin;
lastBH = 0;
lastCount = 0;
// ----- //

while( isAlive( self ) )
{
// mnaauuu
dist = distance(self.origin, last);
last = self.origin;
if ( dist > 450 && lastBH && lastCount > 5)
{
num = self getEntityNumber();
guid = self getGuid();
logPrint( "LJ;" + guid + ";" + num + ";" + self.name + ";\n" );
self iprintln("^3Lagjump? ^1DIE!");
self suicide();
}
lastBH = self.doingBH;
wait 0.1;
self setClientDvar( "com_maxfps", 250 ); // what is this for?
// ----- //

stance = self getStance();
useButton = self useButtonPressed();
onGround = self isOnGround();
fraction = bulletTrace( self getEye(), self getEye() + vector_scale(anglesToForward(self.angles), 32 ), true, self )["fraction"];

// Begin
if( !self.doingBH && useButton && !onGround && fraction == 1 )
{
self setClientDvars( "bg_viewKickMax", 0, "bg_viewKickMin", 0, "bg_viewKickRandom", 0, "bg_viewKickScale", 0 );
self.doingBH = true;
lastCount = 0;
}

// Accelerate
if( self.doingBH && useButton && onGround && stance != "prone" && fraction == 1 )
{
lastCount++;
if( self.bh < 120 )
self.bh += 30;
}

// Finish
if( self.doingBH && !useButton || self.doingBH && stance == "prone" || self.doingBH && fraction < 1 )
{
self setClientDvars( "bg_viewKickMax", 90, "bg_viewKickMin", 5, "bg_viewKickRandom", 0.4, "bg_viewKickScale", 0.2 );
self.doingBH = false;
self.bh = 0;
lastCount = 0;
continue;
}

// Bounce
if( self.bh && self.doingBH && onGround && fraction == 1 )
{
bounceFrom = (self.origin - vector_scale( anglesToForward( self.angles ), 50 )) - (0,0,42);
bounceFrom = vectorNormalize( self.origin - bounceFrom );
self bounce( bounceFrom, self.bh );
self bounce( bounceFrom, self.bh );
wait 0.1;
}
}
}


How to Use: Press Sprint + Use (square) & jump (x) to bunny hop.

Video - skip to 0:40 seconds




Credit goes to lau12345671 for the vid and the producers of the deathrun mod in the cod4 scene.
06-11-2012, 08:06 PM #7
INSAN3LY_D34TH
INSAN3LY GAMING
Originally posted by xChronicModz View Post
this has a bad syntaxx :( You must login or register to view this content.


thats not a bad syntax, thats a underscore from the line above
06-11-2012, 08:06 PM #8
Originally posted by xChronicModz View Post
this has a bad syntaxx :( You must login or register to view this content.


ill fix it now.

edit: dw.
06-11-2012, 08:14 PM #9
Originally posted by ViiPeR View Post
self bounce( bounceFrom, self.bh );



??

(too short)
06-11-2012, 08:18 PM #10
IVI40A3Fusionz
Former Gaming Squad Member
This has a few errors.

self bounce - Unknown function.
logPrint - Unknown function.

Only ones that caught my eye straight away :p.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo