Raised This Month: $ Target: $400
 0% 

is user in between


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-22-2009 , 23:58   Re: is user in between
Reply With Quote #1

Try this

Param1 = Player to check
param2 = One of the outside origins
Param3 = The other outside origin

PHP Code:
public IsWithinid FloatfOrigin1[3] , FloatfOrigin2[3] )
{
    new 
FloatfOrigin[3];
    new 
FloatfDistWithin get_distance_ffOrigin1 fOrigin2 );
    
pevid pev_origin fOrigin );
    
    return ( ( 
fDistWithin get_distance_ffOrigin fOrigin1 ) ) && ( fDistWithin get_distance_ffOrigin fOrigin2 ) ) );

Or you can check origins manually:

param1 = The origin to check
param2 = One of the outside origins
Param3 = The other outside origin

Using float origins:
PHP Code:
public IsWithinFloatfOriginCheck[3] , FloatfOrigin1[3] , FloatfOrigin2[3] )
{
    new 
FloatfDistWithin get_distance_ffOrigin1 fOrigin2 );

    return ( ( 
fDistWithin get_distance_ffOriginCheck fOrigin1 ) ) && ( fDistWithin get_distance_ffOriginCheck fOrigin2 ) ) );

Non-float:
PHP Code:
public IsWithiniOriginCheck[3] , iOrigin1[3] , iOrigin2[3] )
{
    new 
iDistWithin get_distanceiOrigin1 iOrigin2 );

    return ( ( 
iDistWithin get_distanceiOriginCheck iOrigin1 ) ) && ( iDistWithin get_distanceiOriginCheck iOrigin2 ) ) );

__________________

Last edited by Bugsy; 05-23-2009 at 00:04.
Bugsy is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 05-23-2009 , 00:10   Re: is user in between
Reply With Quote #2

My sugestions checks the two origins if there's anything between them
Bugsy's sugestions checks if the user is between the origins

Use wich one fits best in your case
__________________
Hunter-Digital 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 01:33.


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