Raised This Month: $ Target: $400
 0% 

[Solved] Detect Distance


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
padilha007
Senior Member
Join Date: Jul 2008
Old 03-17-2010 , 10:18   [Solved] Detect Distance
Reply With Quote #1

I need to get the distance from the tr spawn and any other door.

PHP Code:
new b_Base[101];

public 
Spawns_To_Edit( )
{
    
// Entidades
    
new entityg_iBombFloat:g_Varg_iCount;
    
    
// Colocar
    
g_Var float(get_pcvar_num(g_iRadius))
    
    
// Origens
    
new Float:DROrigin[3];
    new 
Float:PLOrigin[3];
    
    while ((
entity find_ent_by_class(g_iBomb"info_player_deathmatch")))
    {
        
peventitypev_originDROrigin )
        
        while ((
g_iBomb find_ent_by_class(entity"func_door")))
        {
            
pevg_iBomb pev_originDROrigin )
            
            if ( 
get_distance_fDROriginPLOrigin ) <= g_Var )
            {
                for(new 
i=1;<= 100;i++)
                {
                    if( !
g_Base[i] && fnEntCount(g_iBomb ) == )
                    {
                        
g_Base[i] = g_iBomb;    
                        
g_iCount++;
                    }
                }
            }
        }
    }
    
    
client_print(0print_chat"[Debug] %d"g_iCount);
}

fnEntCount(entity)
{
    new 
iCount 0

    
for(new i=1;<= 100;i++)
    {
        if( 
g_Base[i] == entity )
            
iCount++
    }

    return 
iCount

Tnx
__________________


Last edited by padilha007; 03-18-2010 at 09:56.
padilha007 is offline
 



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 08:49.


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