Advertisement
Guest User

Untitled

a guest
May 10th, 2010
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.46 KB | None | 0 0
  1. /* Quake-Like Bounce-Jump
  2.  * Will use the finishPlayerDamage function to boost you up with full
  3.  * air control. (only one won't work, needs about 10-20)
  4.  * How to use:
  5.  * Make a trigger_multiple and give it a targetname then thread the
  6.  * trigger with this function. E.g. in a loop target thread bounce_jump()
  7.  *
  8.  * How is it possible to control the bounce:
  9.  * In order to control the height of the bounce you can vary with the power
  10.  * but this won't work really good. Though the bounce height depends also
  11.  * on the used fps.
  12.  *
  13.  * Try to work with a loop (see comments) and a specific count for your
  14.  * jump height. I made an array(lookup table) for my entities.
  15.  * entityToPower(self) is this lookup-table with a simple (swith-case)
  16.  */
  17. bounce_jump(){
  18.  
  19.     while(1){
  20.         self waittill("trigger", player);
  21.         // player playsound("jump_pad"); // original quake sound
  22.         /* for(i = 0; i < entityToPower(self); i++){ */
  23.             power = 150;
  24.             player.health = player.health + power;
  25.             eInflictor = player;
  26.             eAttacker = player;
  27.             iDamage = power;
  28.             iDFlags = 0;
  29.             sMeansOfDeath = "MOD_PROJECTILE";
  30.             sWeapon = "panzershreck_mp";
  31.             vPoint = ( player.origin + (0,0,-1) );
  32.             vDir = vectornormalize( player.origin - vPoint );
  33.             sHitLoc = "none";
  34.             psOffsetTime = 0;
  35.  
  36.             player finishPlayerDamage( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime );
  37.         /* } */
  38.         // wait(0.5); // adjust this to your needs
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement