Raised This Month: $ Target: $400
 0% 

[Solved] About entity distance.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 11-06-2013 , 13:55   Re: [Help] About entity distance.
Reply With Quote #1

Not sure about this....
PHP Code:
#include <fakemeta>
#include <hamsandwich>

stock CanPlant(idFloat:vOrigin[3])
{
    new 
iEnt
    
while( ( iEnt engfunc(EngFunc_FindEntityInSphereget_maxplayers(), vOrigin100.0 /* ??? i really don't know */) ) )
    {
    
        
//new Float:vEntOrigin[3];
        //pev(iEnt, pev_origin, vEntOrigin)
        
        
if(!ExecuteHam(Ham_FVisibleidiEnt)) continue;
        
//if(!ExecuteHam(Ham_FVecVisible, id, vEntOrigin) ) continue;
        
        
new Float:vMins[3], Float:vMaxs[3];
        
        
pev(iEntpev_minsvMins);
        
pev(iEntpev_maxsvMaxs);
        
        new 
Float:vCheckOrigin[3]
        for(new 
i3i++, vCheckOrigin[0] = vOrigin[0],
        
vCheckOrigin[1] = vOrigin[1], vCheckOrigin[2] = vOrigin[2])
        {
            
vCheckOrigin[i] += vMins[i];
            if(
engfunc(EngFunc_PointContentsvCheckOrigin) == CONTENTS_SOLID)
            {
                return 
0;
            }
            
        }
        
        for(new 
i3i++, vCheckOrigin[0] = vOrigin[0],
        
vCheckOrigin[1] = vOrigin[1], vCheckOrigin[2] = vOrigin[2])
        {
            
vCheckOrigin[i] += vMaxs[i];
            if(
engfunc(EngFunc_PointContentsvCheckOrigin) == CONTENTS_SOLID)
            {
                return 
0;
            }
        }
    }
    
    return 
1;

__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.
pokemonmaster 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 23:18.


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