Raised This Month: $ Target: $400
 0% 

Fireball problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
vandercal
Member
Join Date: Apr 2004
Location: Sweden
Old 05-06-2004 , 04:52   Fireball problem
Reply With Quote #1

Hi!

is there a function like get_user_origin(index, vec, mode=3) that can disregard players?

/* Gets origin from player.
* Modes:
* 0 - current position.
* 1 - position from eyes (weapon aiming).
* 2 - end position from player position.
* 3 - end position from eyes (hit point for weapon).
* 4 - position of last bullet hit (only CS).
native get_user_origin(index, origin[3], mode = 0); */

/Regards Van der Cal
__________________
vandercal is offline
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
vandercal
Member
Join Date: Apr 2004
Location: Sweden
Old 05-06-2004 , 14:28  
Reply With Quote #3

Thanks for trying to help, I think this is the one I am after...

/* Trace a line from Start(X, Y, Z) to End(X, Y, Z), will return the point hit in vReturn[3]
* and an entity index if an entity is hit. */
trace_line(iIgnoreEnt, Float:fStart[3], Float:fEnd[3], Float:vReturn[3]);

I want it because I want to send the fireball with a certain speed, and if you should point your crosshair on a player, I would have gotten the point where it hit the player, with this one, I can get the point where it hits the entity behind the player.

This would be a problem if I shot the fireball towards a player and he moved, the point where the fireball exploded on, was the point where the player stood, now its gonna be the entity behind the player. I dont want the fireball to explode in the air, its as simple as that.
__________________
vandercal 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 14:52.


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