Advertisement
Guest User

Untitled

a guest
Jul 25th, 2014
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1.  
  2. CRpgRocket__FollowThink( iEntity, Float: flTime )
  3. {
  4. new Float: vecAngles[ 3 ];
  5. new Float: vecTarget[ 3 ];
  6.  
  7. pev( iEntity, pev_angles, vecAngles );
  8.  
  9. engfunc( EngFunc_MakeVectors, vecAngles );
  10. global_get( glb_v_forward, vecTarget );
  11.  
  12. //engfunc( EngFunc_VecToAngles, vecTarget, vecAngles );
  13. //set_pev( iEntity, pev_angles, vecAngles );
  14.  
  15. new Float: flIgniteTime;
  16. new Float: vecVelocity[ 3 ];
  17.  
  18. pev( iEntity, m_flIgniteTime, flIgniteTime );
  19. pev( iEntity, pev_velocity, vecVelocity );
  20.  
  21. new Float: flSpeed = vector_length( vecVelocity );
  22.  
  23. if( flTime - flIgniteTime < 1.0 )
  24. {
  25. vecVelocity[ 0 ] = vecVelocity[ 0 ] * 0.2 + vecTarget[ 0 ] * ( flSpeed * 0.8 + 400.0 );
  26. vecVelocity[ 1 ] = vecVelocity[ 1 ] * 0.2 + vecTarget[ 1 ] * ( flSpeed * 0.8 + 400.0 );
  27. vecVelocity[ 2 ] = vecVelocity[ 2 ] * 0.2 + vecTarget[ 2 ] * ( flSpeed * 0.8 + 400.0 );
  28.  
  29. if( vector_length( vecVelocity ) > 2000.0 )
  30. {
  31. new Float: flInVecLen = 1.0 / floatsqroot( vecVelocity[ 0 ] * vecVelocity[ 0 ] + vecVelocity[ 1 ] * vecVelocity[ 1 ] + vecVelocity[ 2 ] * vecVelocity[ 2 ] );
  32.  
  33. vecVelocity[ 0 ] = vecVelocity[ 0 ] * flInVecLen * 2000.0;
  34. vecVelocity[ 1 ] = vecVelocity[ 1 ] * flInVecLen * 2000.0;
  35. vecVelocity[ 2 ] = vecVelocity[ 2 ] * flInVecLen * 2000.0;
  36. }
  37.  
  38. set_pev( iEntity, pev_velocity, vecVelocity );
  39. }
  40. else
  41. {
  42. if( pev( iEntity, pev_effects ) & EF_LIGHT )
  43. {
  44. set_pev( iEntity, pev_effects, 0 );
  45. emit_sound( iEntity, 2, "weapons/rocket1.wav", 1.0, 0.5, ( 1<< 5 ), 100 );
  46. }
  47.  
  48. vecVelocity[ 0 ] = vecVelocity[ 0 ] * 0.2 + vecTarget[ 0 ] * flSpeed * 0.798;
  49. vecVelocity[ 1 ] = vecVelocity[ 1 ] * 0.2 + vecTarget[ 1 ] * flSpeed * 0.798;
  50. vecVelocity[ 2 ] = vecVelocity[ 2 ] * 0.2 + vecTarget[ 2 ] * flSpeed * 0.798;
  51.  
  52. if( vector_length( vecVelocity ) < 1500.0 )
  53. {
  54. ExecuteHamB( Ham_Touch, iEntity, 0 );
  55. }
  56.  
  57. set_pev( iEntity, pev_velocity, vecVelocity );
  58. }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement