Raised This Month: $ Target: $400
 0% 

Velocity from player eyes.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 11-24-2014 , 14:46   Re: Velocity from player eyes.
Reply With Quote #1

Well, in that case:
Code:
new Float: fvAngle[3];
pev(id, pev_v_angle, fvAngle); // Get player's view angle
angle_vector(fvAngle, ANGLEVECTOR_FORWARD, fvAngle); // Transfer angle vector to a vector
xs_vec_normalize(fvAngle, fvAngle); // Create unit vector
xs_vec_mul_scalar(fvAngle, 200.0, fvAngle); // Multiply vector by 200.0
After that, fvAngle[] would be velocity you want to set for your grenade. Red number in code above is velocity you want to set.
klippy is offline
Reply



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 17:39.


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