Raised This Month: $ Target: $400
 0% 

Solved [ H3LP ] Velocity between two points?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 07-23-2017 , 22:12   Re: [ H3LP ] Velocity between two points?
Reply With Quote #1

Oh, thanks fysiks, work perfectly!

Here is the solution:
Code:
create_rocket(const Float:origin[3], const Float:end[3]) {     new entity = create_entity("info_target")     entity_set_origin(entity, origin)     entity_set_int(entity, EV_INT_solid, SOLID_TRIGGER)     entity_set_int(entity, EV_INT_movetype, MOVETYPE_FLY)     entity_set_model(entity, ROCKET_MODEL)     new Float:mins[3] = { -1.0, -1.0, -1.0 }     new Float:maxs[3] = { 1.0, 1.0, 1.0 }     entity_set_size(entity, mins, maxs)     new Float:multiplier = 1000.0     new Float:distance = get_distance_f(origin, end)     new Float:vector[3]     vector[0] = ((end[0] - origin[0]) / distance)     vector[1] = ((end[1] - origin[1]) / distance)     vector[2] = ((end[2] - origin[2]) / distance)     new Float:velocity[3]     velocity[0] = vector[0] * multiplier     velocity[1] = vector[1] * multiplier     velocity[2] = vector[2] * multiplier     new Float:angles[3]     vector_to_angle(vector, angles)     entity_set_vector(entity, EV_VEC_velocity, velocity)     entity_set_vector(entity, EV_VEC_angles, angles) }
__________________









Last edited by CrazY.; 07-23-2017 at 22:13.
CrazY. 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 22:54.


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