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

[HELP][BB] anti block doors zombie


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
KiLLeR.
Senior Member
Join Date: Jul 2014
Location: Bulgaria
Old 10-17-2017 , 06:30   Re: [HELP][BB] anti block doors zombie
Reply With Quote #11

Quote:
Originally Posted by edon1337 View Post
Idk if it's gonna work but try it.
PHP Code:
#include < amxmodx >
#include < basebuilder >
#include < engine >

new g_iBarrierEnt;

const 
Float:g_iMaxDistance_X 10.0;
const 
Float:g_iMaxDistance_Y 10.0;
const 
Float:g_iMaxDistance_Z 10.0;

public 
plugin_init( )
{
    
register_plugin"Prevent Door Blocking""1.0""DoNii" );

    
g_iBarrierEnt find_ent_by_class( -1"barrier" );
}

public 
bb_round_started( )
{
    if( ! 
is_valid_entg_iBarrierEnt ) )
    return 
PLUGIN_CONTINUE;

    new 
Float:fOriginDoor], Float:fOriginBlock];
    
entity_get_vectorg_iBarrierEntEV_VEC_originfOriginDoor );

    new 
iEnt = -1;

    while( ( 
iEnt find_ent_by_class( -1"func_wall" ) ) != )
    {
        
entity_get_vectoriEntEV_VEC_originfOriginBlock );

        if ( ( ( 
fOriginDoor] - fOriginBlock] ) >= g_iMaxDistance_X ) || ( ( fOriginBlock] - fOriginDoor] ) <= g_iMaxDistance_X )
        || ( ( ( 
fOriginDoor] - fOriginBlock] ) >= g_iMaxDistance_Y ) || ( ( fOriginBlock] - fOriginDoor] ) <= g_iMaxDistance_Y )
        || ( ( ( 
fOriginDoor] - fOriginBlock] ) >= g_iMaxDistance_Z ) || ( ( fOriginBlock] - fOriginDoor] ) <= g_iMaxDistance_Z ) ) ) )
        {
            
            
fOriginBlock] = fOriginBlock] / 10.0;
            
fOriginBlock] = fOriginBlock] / 20.0;
            
fOriginBlock] = fOriginBlock] / 30.0;
            
            
entity_set_vectoriEntEV_VEC_originfOriginBlock );
        }
    }
    return 
PLUGIN_CONTINUE;

Why not just check distance like that:
Code:
if(vector_distance(fOriginBlock, fOriginDoor) < 30.0)
KiLLeR. 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 17:58.


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