Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CRpgRocket__FollowThink( iEntity, Float: flTime )
- {
- new Float: vecAngles[ 3 ];
- new Float: vecTarget[ 3 ];
- pev( iEntity, pev_angles, vecAngles );
- engfunc( EngFunc_MakeVectors, vecAngles );
- global_get( glb_v_forward, vecTarget );
- //engfunc( EngFunc_VecToAngles, vecTarget, vecAngles );
- //set_pev( iEntity, pev_angles, vecAngles );
- new Float: flIgniteTime;
- new Float: vecVelocity[ 3 ];
- pev( iEntity, m_flIgniteTime, flIgniteTime );
- pev( iEntity, pev_velocity, vecVelocity );
- new Float: flSpeed = vector_length( vecVelocity );
- if( flTime - flIgniteTime < 1.0 )
- {
- vecVelocity[ 0 ] = vecVelocity[ 0 ] * 0.2 + vecTarget[ 0 ] * ( flSpeed * 0.8 + 400.0 );
- vecVelocity[ 1 ] = vecVelocity[ 1 ] * 0.2 + vecTarget[ 1 ] * ( flSpeed * 0.8 + 400.0 );
- vecVelocity[ 2 ] = vecVelocity[ 2 ] * 0.2 + vecTarget[ 2 ] * ( flSpeed * 0.8 + 400.0 );
- if( vector_length( vecVelocity ) > 2000.0 )
- {
- new Float: flInVecLen = 1.0 / floatsqroot( vecVelocity[ 0 ] * vecVelocity[ 0 ] + vecVelocity[ 1 ] * vecVelocity[ 1 ] + vecVelocity[ 2 ] * vecVelocity[ 2 ] );
- vecVelocity[ 0 ] = vecVelocity[ 0 ] * flInVecLen * 2000.0;
- vecVelocity[ 1 ] = vecVelocity[ 1 ] * flInVecLen * 2000.0;
- vecVelocity[ 2 ] = vecVelocity[ 2 ] * flInVecLen * 2000.0;
- }
- set_pev( iEntity, pev_velocity, vecVelocity );
- }
- else
- {
- if( pev( iEntity, pev_effects ) & EF_LIGHT )
- {
- set_pev( iEntity, pev_effects, 0 );
- emit_sound( iEntity, 2, "weapons/rocket1.wav", 1.0, 0.5, ( 1<< 5 ), 100 );
- }
- vecVelocity[ 0 ] = vecVelocity[ 0 ] * 0.2 + vecTarget[ 0 ] * flSpeed * 0.798;
- vecVelocity[ 1 ] = vecVelocity[ 1 ] * 0.2 + vecTarget[ 1 ] * flSpeed * 0.798;
- vecVelocity[ 2 ] = vecVelocity[ 2 ] * 0.2 + vecTarget[ 2 ] * flSpeed * 0.798;
- if( vector_length( vecVelocity ) < 1500.0 )
- {
- ExecuteHamB( Ham_Touch, iEntity, 0 );
- }
- set_pev( iEntity, pev_velocity, vecVelocity );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement