Raised This Month: $ Target: $400
 0% 

entity vector


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
TheNewt
Donor
Join Date: Jun 2006
Location: Where I live.
Old 10-04-2006 , 16:00   Re: entity vector
Reply With Quote #3

Gah, I'm trying to make the entity turn so that it 'aims' at an player (the origin)
>_<

This is what I have, and it seems to work pretty well right now
Note: I got this from the plugin Sentry Gun
Code:
sentry_turntotarget(ent, Float:sentryOrigin[3], target, Float:closestOrigin[3]) {     if (target) {         new name[32]         get_user_name(target, name, 31)         new Float:newAngle[3]         entity_get_vector(ent, EV_VEC_angles, newAngle)         new Float:x = closestOrigin[0] - sentryOrigin[0]         new Float:z = closestOrigin[1] - sentryOrigin[1]         new Float:radians = floatatan(z/x, radian)         newAngle[1] = radians * (180 / 3.14)         if (closestOrigin[0] < sentryOrigin[0])             newAngle[1] -= 180.0                 entity_set_vector(ent, EV_VEC_angles, newAngle)     } }

But it faces the opposite direction, all the time.
__________________
Quote:
toe3_ left the chat room. (G-lined (AUTO Excessive connections from a single host.))

Last edited by TheNewt; 10-04-2006 at 16:07.
TheNewt 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:47.


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