Raised This Month: $ Target: $400
 0% 

Hey


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-11-2015 , 08:52   Re: Hey
Reply With Quote #1

Use this to check if an ent is inside of another ent.

iFirstIndex should be the player index if it's about your exmaple and iSecondIndex the cube zone index.
PHP Code:
stock boolEntInsideEntiFirstIndexiSecondIndex)
{
    new  
FloatfEntMin    ];  peviFirstIndexpev_absminfEntMin )
    new  
FloatfEntMax    ];  peviFirstIndexpev_absmaxfEntMax )
    new  
FloatfTargetMin    ];  peviSecondIndexpev_absminfTargetMin )
    new  
FloatfTargetMax    ];  peviSecondIndexpev_absmaxfTargetMax )
    new  
Floatv_fDistance    ]

    for( new 
i3i++ )
    {
        if( 
fEntMin] > fTargetMax] )
        {
            
v_fDistance] = fEntMin] - fTargetMax]
        }
        
        else if( 
fTargetMin] > fEntMax] )
        {
            
v_fDistance] = fTargetMin] - fEntMax]
        }
    }
    
    if( 
vector_lengthv_fDistance ) )
    {
        return 
false
    
}
    
    else
    {
        return 
true 
    
}
    
    return 
false

__________________
HamletEagle 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 15:28.


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