Raised This Month: $ Target: $400
 0% 

Fireball problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
xeroblood
BANNED
Join Date: Mar 2004
Location: Toronto, Canada
Old 05-06-2004 , 10:19  
Reply With Quote #2

I'm guessing that you want to find the Origin of an Entity and not a Player??

If so, the Engine Module has what you want:

from engine.inc:
-------------------
native entity_get_vector(iIndex, iKey, Float:vRetVector[3]);


from engine_const.inc:
--------------------------
enum {
EV_VEC_origin = 0,
//...
}


So now you could use these together to find the Origin of an entity, assuming that you know the ID of the entity...

new Float:fOrigin[3]
entity_get_vector( entityID, EV_VEC_origin, fOrigin )

// That will give you a Vector Origin (Float).. to convert it to Integer use:

from engine_stocks.inc:
---------------------------
/* Changes a float vec to an integer vec */
stock FVecIVec(Float:FVec[3], IVec[3])
{
IVec[0] = floatround(FVec[0])
IVec[1] = floatround(FVec[1])
IVec[2] = floatround(FVec[2])

return 1
}


So now you could do:

new nOrigin[3]
FVecIVec( fOrigin, nOrigin )

// That will make nOrigin = the interger origin of the entity!!

Hope that all helps!!
xeroblood is offline
Send a message via MSN to xeroblood
 



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 05:41.


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