Raised This Month: $ Target: $400
 0% 

aim_at_origin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ramono
Veteran Member
Join Date: Nov 2005
Location: Netherlands
Old 10-25-2006 , 17:13   aim_at_origin
Reply With Quote #1

Is there anyway to aim at a origin, i tryed some calculations already, but im bad with hard calculations.

Code:
public aim_at_origin(id,origin[3]) {     new angles[3]     //...     //...     //...     //...     //...     entity_set_vector(id,EV_VEC_angles,angles)     // or     set_pev(id,pev_angles,angles) }
__________________
Um, hi.
Ramono is offline
jRaven
AMX Mod X Beta Tester
Join Date: Jan 2006
Location: IA, USA
Old 10-25-2006 , 19:08   Re: aim_at_origin
Reply With Quote #2

entity_get_vector(id,EV_VEC_angles,angles) ?

Edit: okay, I'm an idiot.

Last edited by jRaven; 10-25-2006 at 20:16.
jRaven is offline
Send a message via ICQ to jRaven Send a message via AIM to jRaven
Zenith77
Veteran Member
Join Date: Aug 2005
Old 10-25-2006 , 19:10   Re: aim_at_origin
Reply With Quote #3

What a great response. He's trying to set something, not get it. Try setting puchangles (or look in aimbot plugins).
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
TheNewt
Donor
Join Date: Jun 2006
Location: Where I live.
Old 10-25-2006 , 20:34   Re: aim_at_origin
Reply With Quote #4

This is what I use...
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.0 / 3.141592654)         newAngle[1] += 180         if (closestOrigin[0] < sentryOrigin[0])             newAngle[1] -= 180.0                 entity_set_float(ent, SENTRY_FL_ANGLE, newAngle[1])                 new Float:h = closestOrigin[2] - sentryOrigin[2]         new Float:b = vector_distance(sentryOrigin, closestOrigin)         radians = floatatan(h/b, radian)         new Float:degs = radians * (180.0 / 3.141592654)                 new Float:degreeByte = 830.0/256.0;         new Float:tilt = 127.0 - degreeByte * degs;                 entity_set_byte(ent, SENTRY_TILT_TURRET, floatround(tilt))         entity_set_vector(ent, EV_VEC_angles, newAngle)     } }
It is from the SentryGuns plugin, and had to revise a lot of it to make it cleaner. But it forces and Entity to turn to a target.
Go look in the Sentry Guns plugin and see how he does it, it should be very similiar.
Some lines aren't truelly necassary for calculating the angles, they are just fuser, iuser, etc to hold values specific to that entity.
Sorry I can't be much of help, hope that gives you somewhere to start looking though!
__________________
Quote:
toe3_ left the chat room. (G-lined (AUTO Excessive connections from a single host.))
TheNewt is offline
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 10-26-2006 , 13:21   Re: aim_at_origin
Reply With Quote #5

to set the angles of an client you have to set pev_fixangle to 1
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
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 04:57.


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