Raised This Month: $51 Target: $400
 12% 

I need entity positions.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kiki33hun
Veteran Member
Join Date: Jul 2011
Location: Magyarország
Old 01-23-2015 , 11:28   I need entity positions.
Reply With Quote #1

Hello, i have a entity, like this:



My code:
Code:
new entity = fm_create_entity("info_target")     set_pev(entity, pev_classname, "rushzona")     fm_entity_set_model(entity, "models/gib_skull.mdl")     fm_entity_set_origin(entity, position)     set_pev(entity, pev_movetype, MOVETYPE_FLY)     fm_entity_set_size(entity, mins, maxs)     fm_set_entity_visibility(entity, 0

The position is user position.

Default mins, and maxs:

new Float:mins[3] = { -32.0, -32.0, -32.0 }
new Float:maxs[3] = { 32.0, 32.0, 32.0 }

how to get the cordinates, of the image?
__________________
kiki33hun is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-23-2015 , 13:03   Re: I need entity positions.
Reply With Quote #2

Maybe, from the center of the box you can send some tracelines, see what it hits, return the origin from the end position of the trace.
__________________
HamletEagle is offline
Fr33m@n
Veteran Member
Join Date: May 2008
Location: France Marne
Old 01-23-2015 , 13:27   Re: I need entity positions.
Reply With Quote #3

PHP Code:
new Float:Angles[3], Float:DirectionLeft[3], Float:[3], PositionLeft[3], PositionRight[3]
pev(entitypev_anglesAngles)
angle_vector(AnglesANGLEVECTOR_RIGHTDirectionRight)
xs_vec_copy(DirectionRightDirectionLeft)
xs_vec_mul_scalar(DirectionRight32.0DirectionRight)
xs_vec_mul_scalar(DirectionLeft, -32.0DirectionLeft)
xs_vec_add(positionDirectionRightPositionRight)
xs_vec_add(positionDirectionLeftPositionLeft
Try this. I'm not sure if it will work. You need to include xs.

Last edited by Fr33m@n; 01-23-2015 at 13:32.
Fr33m@n is offline
Fr33m@n
Veteran Member
Join Date: May 2008
Location: France Marne
Old 01-30-2015 , 17:41   Re: I need entity positions.
Reply With Quote #4

I like to help people without feedback...

Last edited by Fr33m@n; 01-30-2015 at 17:42.
Fr33m@n 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 19:14.


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