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

Comparing players origin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mlk27
Veteran Member
Join Date: May 2008
Old 10-21-2011 , 11:21   Comparing players origin
Reply With Quote #1

My scripting skill has been rusty due to not doing any scripting for a long time now. How do you save the 'before' and 'after' origins (X,Y,Z) of all players and then compare them together to see if they are the same?

Last edited by Mlk27; 10-21-2011 at 11:28.
Mlk27 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-21-2011 , 11:53   Re: Comparing players origin
Reply With Quote #2

Not sure if I understood correctly but you can get both origins and then check the distance apart which will determine if there was a change. To check all just use a loop with get_players().
PHP Code:
new Float:fOriginBefore33 ][ ];
new 
Float:fOriginAfter33 ][ ];

pevid pev_origin fOriginBeforeid ] );
//Same for after origin

new Float:fDistanceApart get_distance_ffOriginBefore fOriginAfter ); 
__________________

Last edited by Bugsy; 10-21-2011 at 12:00.
Bugsy is offline
Mlk27
Veteran Member
Join Date: May 2008
Old 10-21-2011 , 15:39   Re: Comparing players origin
Reply With Quote #3

You understood my question correctly

that fDistanceApart var, the distance is calculated for which angle?
Mlk27 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-21-2011 , 15:57   Re: Comparing players origin
Reply With Quote #4

Total distance, each axis is considered. If, for example you want only ground distance, set Z coord (origin[ 2 ]) on both origins to 0.
__________________

Last edited by Bugsy; 10-21-2011 at 18:20.
Bugsy 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:34.


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