Raised This Month: $ Target: $400
 0% 

change entity path


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
kp_uparrow
Penalized Member
Join Date: Jun 2006
Location: 192.168.0.1
Old 07-10-2007 , 01:09   Re: change entity path
Reply With Quote #3

will try, currently im creating a fake model at the origin and making it follow, really wierd
Code:
stock entity_set_follow(entity, target, Float:speed) {   if (!is_valid_ent(entity) || !is_valid_ent(target)) return 0   new Float:entity_origin[3], Float:target_origin[3]   entity_get_vector(entity, EV_VEC_origin, entity_origin)   entity_get_vector(target, EV_VEC_origin, target_origin)   new Float:diff[3]   diff[0] = target_origin[0] - entity_origin[0]   diff[1] = target_origin[1] - entity_origin[1]   diff[2] = target_origin[2] - entity_origin[2]   new Float:length = floatsqroot(floatpower(diff[0], 2.0) + floatpower(diff[1], 2.0) + floatpower(diff[2], 2.0))   new Float:Velocity[3]   Velocity[0] = diff[0] * (speed / length)   Velocity[1] = diff[1] * (speed / length)   Velocity[2] = diff[2] * (speed / length)   entity_set_vector(entity, EV_VEC_velocity, Velocity)   return 1 }



can i just edit the above to : ?

Code:
stock entity_set_follow2(entity,const Float:target_origin[3]={0.0,0.0,0.0}, Float:speed) {   if (!is_valid_ent(entity)) return 0   new Float:entity_origin[3]   entity_get_vector(entity, EV_VEC_origin, entity_origin)   new Float:diff[3]   diff[0] = target_origin[0] - entity_origin[0]   diff[1] = target_origin[1] - entity_origin[1]   diff[2] = target_origin[2] - entity_origin[2]   new Float:length = floatsqroot(floatpower(diff[0], 2.0) + floatpower(diff[1], 2.0) + floatpower(diff[2], 2.0))   new Float:Velocity[3]   Velocity[0] = diff[0] * (speed / length)   Velocity[1] = diff[1] * (speed / length)   Velocity[2] = diff[2] * (speed / length)   entity_set_vector(entity, EV_VEC_velocity, Velocity)   return 1 }


so far its working!
__________________
I USED A SECOND ACCOUNT TO DO MORE KARMA UPS AND DOWNS UNTIL GREENTRYST CAUGHT ME

Last edited by kp_uparrow; 07-10-2007 at 02:41.
kp_uparrow 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 21:27.


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