Raised This Month: $ Target: $400
 0% 

NAN orgin :S


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 10-28-2009 , 16:01   Re: NAN orgin :S
Reply With Quote #1

The get_user_origin() function does not return a floated value. And entity_set_origin() sets an origin(floated one).

So you'd have to do it like this(using IVecFVec()):

Code:
new iOrigin[ 3 ], Float:fOrigin[ 3 ]; get_user_origin( id, iOrigin, 3 ); // 3 is ending position from eyes(crosshair) IVecFVec( iOrigin, fOrigin ); // integer origin converted to float entity_set_origin( ent, fOrigin ); // entity at that origin

or you could just use float().

Code:
new iOrigin[ 3 ], Float:fOrigin[ 3 ]; get_user_origin( id, iOrigin, 3 ); // 3 is ending position from eyes(crosshair) fOrigin[ 0 ] = float( iOrigin[ 0 ] ); fOrigin[ 1 ] = float( iOrigin[ 1 ] ); fOrigin[ 2 ] = float( iOrigin[ 2 ] ); // im not sure but i think you could do this also // fOrigin = float( iOrigin ); entity_set_origin( ent, fOrigin ); // entity at that origin
__________________
Achievements API - a simple way for you to create your OWN custom achievements!
Xellath 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 17:35.


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