Comparing Origin
How would i compare a user's origin (checking to see if they haven't moved) within a task.
I have this code....but it isn't working. PHP Code:
|
Re: Comparing Origin
Code:
|
Re: Comparing Origin
Quote:
Where is it? |
Re: Comparing Origin
You have to include <xs>. (xs.inc)
|
Re: Comparing Origin
Oh, thanks
but now that everything has to be floats....how do i get their origin? get_user_origin is in ints.... And wouldn't the vector workings be different than origin? |
Re: Comparing Origin
You can use pev_origin (fakemeta), or EV_VEC_origin (engine) to retrieve origin.
You can use too IVecFVec to convert to float origin. |
Re: Comparing Origin
I tried using IVecFVec to cast all arrays, but it still isn't working.
Here is all relevant code. PHP Code:
|
Re: Comparing Origin
I don't see why you float origin.
Either you use get_user_origin, either you use engine or fakemeta so you retrieve a float vector. Anyway, xs stock is : PHP Code:
PHP Code:
You could use this for both integer OR floats (not both at the same time) but i don't know how to check if tags match so better not to use : PHP Code:
|
Re: Comparing Origin
Quote:
What include is int_vec_equal defined in? Its not compiling.... |
Re: Comparing Origin
It's not in any include file, just put the function in your .sma, and name it as you want.
You may be interested in get_distance native : http://www.amxmodx.org/funcwiki.php?go=func&id=283 |
| All times are GMT -4. The time now is 15:15. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.