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

Problem with ZP Anti block!!!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Lucky888
Senior Member
Join Date: Nov 2011
Location: Paradise
Old 01-26-2014 , 09:19   Problem with ZP Anti block!!!
Reply With Quote #1

Hi, my server ZP4.3 use this plugin for anti block way, when press USE button, human and zombie can walk through teammate. It work good and no error, but, when have too much player press USE button and walk through, maybe 10-12 people( <10 people is OK) , they will stuck and can not move. It's better way for human shotting.

I mean, have 1 human camp in 1 area, and 10-12 zombies walk to his area, and 10-12 zombie will stuck ( <10 people is OK) and human can farm very easy and no tired. So can you fix for me?

PHP Code:
/*
    This is an edit of this plugin http://xtreme-jumps.eu/e107_plugins/forum/forum_viewtopic.php?102421 for ZP 4.3
*/
#include <amxmodx>
#include <fakemeta>
#include <zombieplague>

#define DISTANCE 120

new g_iTeam[33]
new 
bool:g_bSolid[33]
new 
bool:g_bHasSemiclip[33]
new 
Float:g_fOrigin[33][3]

new 
bool:g_bSemiclipEnabled

new g_iForwardId[3]
new 
g_iMaxPlayers
new g_iCvar[3]

public 
plugin_init( )
{
    
register_plugin"[ZP] Antiblock""0.1""Maslyak" )
    
    
g_iCvar[0] = register_cvar"semiclip_enabled""1" )
    
g_iCvar[1] = register_cvar"semiclip_teamclip""1" )
    
g_iCvar[2] = register_cvar"semiclip_transparancy""1" )
    
    
register_forwardFM_ClientCommand"fwdClientCommand" )
    
    if( 
get_pcvar_numg_iCvar[0] ) )
    {
        
g_iForwardId[0] = register_forwardFM_PlayerPreThink"fwdPlayerPreThink" )
        
g_iForwardId[1] = register_forwardFM_PlayerPostThink"fwdPlayerPostThink" )
        
g_iForwardId[2] = register_forwardFM_AddToFullPack"fwdAddToFullPack_Post")
        
        
g_bSemiclipEnabled true
    
}
    else
        
g_bSemiclipEnabled false
    
    g_iMaxPlayers 
get_maxplayers( )
}

public 
fwdPlayerPreThinkplr )
{
    static 
idlast_think

    
if( last_think plr )
    {
        for( 
id 1id <= g_iMaxPlayersid++ )
        {
            if( 
is_user_aliveid ) )
            {
                if( 
get_pcvar_numg_iCvar[1] ) )
                    
g_iTeam[id] = zp_get_user_zombieid )
                
                
g_bSolid[id] = pevidpev_solid ) == SOLID_SLIDEBOX true false
                pev
idpev_origing_fOrigin[id] )
            }
            else
                
g_bSolid[id] = false
        
}
    }

    
last_think plr

    
if( g_bSolid[plr] )
    {
        for( 
id 1id <= g_iMaxPlayersid++ )
        {
            if( 
g_bSolid[id] && get_distance_fg_fOrigin[plr], g_fOrigin[id] ) <= DISTANCE && id != plr )
            {
                if( 
get_pcvar_numg_iCvar[1] ) && g_iTeam[plr] != g_iTeam[id] )
                    return 
FMRES_IGNORED
                
                
if(!(pev(plrpev_button) & IN_USE))    
                    return 
FMRES_IGNORED
                
                set_pev
idpev_solidSOLID_NOT )
                
g_bHasSemiclip[id] = true
            
}
        }
    }

    return 
FMRES_IGNORED
}

public 
fwdPlayerPostThinkplr )
{
    static 
id

    
for( id 1id <= g_iMaxPlayersid++ )
    {
        if( 
g_bHasSemiclip[id] )
        {
            
set_pevidpev_solidSOLID_SLIDEBOX )
            
g_bHasSemiclip[id] = false
        
}
    }
}

public 
fwdAddToFullPack_Postes_handleeenthosthostflagsplayerpset )
{
    if( 
player )
    {
        if( 
g_bSolid[host] && g_bSolid[ent] && get_distance_fg_fOrigin[host], g_fOrigin[ent] ) <= DISTANCE )
        {
            if( 
get_pcvar_numg_iCvar[1] ) && g_iTeam[host] != g_iTeam[ent] )
                return 
FMRES_IGNORED
            
            
if(!(pev(hostpev_button) & IN_USE))    
                return 
FMRES_IGNORED
                
            set_es
es_handleES_SolidSOLID_NOT // makes semiclip flawless
            
            
if( get_pcvar_numg_iCvar[2] ) == )
            {
                
set_eses_handleES_RenderModekRenderTransAlpha )
                
set_eses_handleES_RenderAmt85 )
            }
            else if( 
get_pcvar_numg_iCvar[2] ) == )
            {
                
set_eses_handleES_EffectsEF_NODRAW )
                
set_eses_handleES_SolidSOLID_NOT )
            }
        }
    }
    
    return 
FMRES_IGNORED
}

// is there a better way to detect changings of g_iCvar[0]?
public fwdClientCommandplr )
{
    
// use the forwards just when needed, for good performance
    
if( !get_pcvar_numg_iCvar[0] ) && g_bSemiclipEnabled )
    {
        
unregister_forwardFM_PlayerPreThinkg_iForwardId[0] )
        
unregister_forwardFM_PlayerPostThinkg_iForwardId[1] )
        
unregister_forwardFM_AddToFullPackg_iForwardId[2], )
        
        
g_bSemiclipEnabled false
    
}
    else if( 
get_pcvar_numg_iCvar[0] ) && !g_bSemiclipEnabled )
    {
        
g_iForwardId[0] = register_forwardFM_PlayerPreThink"fwdPlayerPreThink" )
        
g_iForwardId[1] = register_forwardFM_PlayerPostThink"fwdPlayerPostThink" )
        
g_iForwardId[2] = register_forwardFM_AddToFullPack"fwdAddToFullPack_Post")
        
        
g_bSemiclipEnabled true
    
}

Thank so much!

Edit:
And 1 more error:
When use this antiblock, player can stuck and BUG map. I mean human camp in 1 area, too many people, so they use USE button for anri block way, and walk through 1 another player, he did not use USE button, another player will be stuck, out of area camping, and he is good meat for Zombie. Can you fix this for me?

And if can, can you show for me, what is error, don't give me fish, give me way to fishing. Thank so much!
__________________

Last edited by Lucky888; 01-26-2014 at 09:27.
Lucky888 is offline
Send a message via Yahoo to Lucky888
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 04:42.


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