Raised This Month: $ Target: $400
 0% 

How to get a rocket goes towards a player


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
hzqst
Senior Member
Join Date: Jul 2008
Old 12-25-2009 , 06:49   How to get a rocket goes towards a player
Reply With Quote #1

How to have a rocket go towards a player and rotates smoothly
I want it not to turn to targets instantly but to change angles per 0.1s

PHP Code:
stock fm_set_entity_view_smoothly(entityFloat:Target[3], Float:scale){
 new 
Float:Origin[3], Float:Angles[3], Float:OriAngle[3]
 
pev(entitypev_originOrigin)
 
xs_vec_sub(TargetOriginTarget)
 
vector_to_angle(TargetAngles)
 
Angles[0] = 360.0 Angles[0]
 
Angles[0] *= -1.0
 
new Float:AngleDiff[3]
 
pev(entitypev_anglesOriAngle)
 
xs_vec_sub(AnglesOriAngleAngleDiff)
 
xs_vec_mul_scalar(AngleDiffscaleAngleDiff)
 
xs_vec_add(OriAngleAngleDiffOriAngle)
 
set_pev(entitypev_anglesOriAngle)
 
OriAngle[0] *= -1.0
 set_pev
(entitypev_v_angleOriAngle)
 
set_pev(entitypev_fixangle1)

This is my code , it's buggy and rockets will be unable to follow the targets sometime

Last edited by hzqst; 12-25-2009 at 06:54.
hzqst is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:07.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode