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

[HELP][BB] anti block doors zombie


Post New Thread Reply   
 
Thread Tools Display Modes
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 #21

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
Old 10-17-2017, 06:42
Natsheh
This message has been deleted by Natsheh.
Natsheh
Veteran Member
Join Date: Sep 2012
Old 10-17-2017 , 07:17   Re: [HELP][BB] anti block doors zombie
Reply With Quote #22

Edon i have no idea where you are setting the block, and you have to check if the classname of the (block)func_wall is ignore to ignore it....

but here you go, more simple way...

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <basebuilder>

#define PLUGIN "Anti Barrier Blocking"
#define VERSION "1.0"
#define AUTHOR "Natsheh"

new iBarrierEnt;

const 
Float:MaxRadius 100.0;

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
iBarrierEnt engfunc(EngFunc_FindEntityByString, -1"classname""barrier");
    
    if(!
iBarrierEnt)
    {
        
set_fail_state("Barrier Entity is not found!")
    }
}

public 
bb_drop_post(const id, const ent)
{
    new 
entityFloat:fOrigin[3];
    
pev(entpev_originfOrigin)
    
entity engfunc(EngFunc_FindEntityInSphere, (iBarrierEnt 1), fOriginMaxRadius);
    if(
entity == iBarrierEnt)
    {
        
client_print(idprint_chat"You can't build here!")
        
set_pev(entpev_originFloat:{0.0,0.0,0.0})
    }

Requires basebuilder version 6.5 ++
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 10-20-2017 at 09:53.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
KiLLeR.
Senior Member
Join Date: Jul 2014
Location: Bulgaria
Old 10-17-2017 , 11:50   Re: [HELP][BB] anti block doors zombie
Reply With Quote #23

Code:
set_pev(ent, pev_origin, Float:{0.0,0.0,0.0})
This will stack blocks in same position, also let's guess that coords are inside zombie base?!
I'm not familiar with Base Builder by Tirant, but the best solution seems to be setting block origin to the origin before the block being moved.
KiLLeR. is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 10-17-2017 , 13:19   Re: [HELP][BB] anti block doors zombie
Reply With Quote #24

Quote:
Originally Posted by KiLLeR. View Post
Code:
set_pev(ent, pev_origin, Float:{0.0,0.0,0.0})
This will stack blocks in same position, also let's guess that coords are inside zombie base?!
I'm not familiar with Base Builder by Tirant, but the best solution seems to be setting block origin to the origin before the block being moved.
It seems you have no idea about brush entities... Search before you talk, it will return the block to its spawn position
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 10-17-2017 at 13:20.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 10-17-2017 , 14:31   Re: [HELP][BB] anti block doors zombie
Reply With Quote #25

Quote:
Originally Posted by Natsheh View Post
Edon i have no idea where you are setting the block.
Who said you need to have an idea? That block is un-needed, I just set it to a random origin far away from the Barrier.

Quote:
Originally Posted by Natsheh View Post
you have to check if the classname of the (block)func_wall is ignore to ignore it....
I don't understand what you're trying to say at all.
__________________
edon1337 is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 10-17-2017 , 14:33   Re: [HELP][BB] anti block doors zombie
Reply With Quote #26

Quote:
Originally Posted by KiLLeR. View Post
Why not just check distance like that:
Code:
if(vector_distance(fOriginBlock, fOriginDoor) < 30.0)
And what makes you think there's a difference between that Native and my method? The only difference is that your Native won't work in some cases.
__________________
edon1337 is offline
Old 10-20-2017, 09:19
spooky HL15
This message has been deleted by spooky HL15.
spooky HL15
Member
Join Date: Oct 2015
Old 10-20-2017 , 09:30   Re: [HELP][BB] anti block doors zombie
Reply With Quote #27

Quote:
Originally Posted by Natsheh View Post
Edon i have no idea where you are setting the block, and you have to check if the classname of the (block)func_wall is ignore to ignore it....

but here you go, more simple way...

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <basebuilder>

#define PLUGIN "Anti Barrier Blocking"
#define VERSION "1.0"
#define AUTHOR "Natsheh"

new iBarrierEnt;

const 
Float:MaxRadius 100.0;

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
iBarrierEnt engfunc(EngFunc_FindEntityByString, -1"classname""barrier");
    
    if(!
iBarrierEnt)
    {
        
set_fail_state("Barrier Entity is not found!")
    }
}

public 
bb_drop_post(const id, const ent)
{
    new 
entity = -1Float:fOrigin[3];
    
pev(entpev_originfOrigin)
    while( ( 
entity engfunc(EngFunc_FindEntityInSphereentityfOriginMaxRadius) ) > 0)
    {
        if(
entity == iBarrierEnt)
        {
            
client_print(idprint_chat"You can't build here!")
            
set_pev(entpev_originFloat:{0.0,0.0,0.0})
            break;
        }
    }

Requires basebuilder version 6.5 ++
mrs.Natsheh
thank you for your free services but your free services do not work
spooky HL15 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 10-20-2017 , 09:36   Re: [HELP][BB] anti block doors zombie
Reply With Quote #28

Which bb version you are using?

Edit: Code Optimized....
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 10-20-2017 at 09:55.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Natsheh
Veteran Member
Join Date: Sep 2012
Old 10-20-2017 , 13:19   Re: [HELP][BB] anti block doors zombie
Reply With Quote #29

Quote:
Originally Posted by edon1337

I don't understand what you're trying to say at all.
Quote:
Originally Posted by Tirant
- Custom Maps -
This mod requires completely custom maps. In order for your map to function properly, please name your door entity "barrier" and your entities that should be ignored as "ignore." You are only allowed one barrier entity, so select all brushes before tying them to an entity, so that they all count as this one barrier together.

__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
spooky HL15
Member
Join Date: Oct 2015
Old 10-21-2017 , 16:41   Re: [HELP][BB] anti block doors zombie
Reply With Quote #30

when i copy your scripting i drop it in max mod x there is euror
25 "public bb_drop_post(const id, const ent)"
i have Version 6.5
spooky HL15 is offline
Reply


Thread Tools
Display Modes

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 14:42.


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