AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Semiclip (https://forums.alliedmods.net/showthread.php?t=172227)

Diegorkable 11-17-2011 12:05

Semiclip
 
Hey guys,

I tried to take out the semiclip from xPaw's Deathrun Manager, but with no success. What am I missing here? (its not working, ppl still block each other.)

PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <cstrike>
#include <fun>
#include <fakemeta>

#define PLUGIN "Semi-Clip"
#define VERSION "1.0"
#define AUTHOR "xPaw"

new g_iSemiClip[33]

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_forwardFM_StartFrame"FwdStartFrame");
    
register_forwardFM_AddToFullPack"FwdFullPack");
}

public 
FwdFullPackeseenthostflagsplayerpSet ) {
    
    if( 
player && g_iSemiClipent ] && g_iSemiCliphost ] ) {
        
set_esesES_SolidSOLID_NOT );
        
set_esesES_RenderModekRenderTransAlpha );
        
set_esesES_RenderAmt85 );
    }
    
    return 
FMRES_IGNORED;
}

public 
FwdStartFrame( ) {
    
    static 
iPlayers32 ], iNumiPlayeriPlayer2ij;
    
get_playersiPlayersiNum"ache""CT" );
    
    
arraysetg_iSemiClip032 );
    
    if( 
iNum <= )
        return 
FMRES_IGNORED;
    
    for( 
0iNumi++ ) {
        
iPlayer iPlayers];
        
        for( 
0iNumj++ ) {
            
iPlayer2 iPlayers];
            
            if( 
iPlayer == iPlayer2 )
                continue;
            
            if( 
g_iSemiClipiPlayer ] && g_iSemiClipiPlayer2 ] )
                continue;
            
            if( 
entity_rangeiPlayeriPlayer2 ) < 128 ) {
                
g_iSemiClipiPlayer ]    = true;
                
g_iSemiClipiPlayer2 ]    = true;
            }
        }
    }
    
    for( 
0iNumi++ ) {
        
iPlayer iPlayers];
        
        
set_peviPlayerpev_solidg_iSemiClipiPlayer ] ? SOLID_NOT SOLID_SLIDEBOX );
    }
    
    return 
FMRES_IGNORED;



Diegorkable 11-17-2011 12:46

Re: Semiclip
 
Nevermind, it is actually working, don't know what changed. I'll leave it here if anyone wants it. It's actually really good cuz it doesn't has this bug when you stand on a moving object with someone else you both get damaged or die.

Devil259 11-18-2011 05:39

Re: Semiclip
 
http://forums.alliedmods.net/showpos...8&postcount=86

hzqst 11-18-2011 06:19

Re: Semiclip
 
Search in Module Coding

Diegorkable 11-18-2011 07:06

Re: Semiclip
 
That one Devil259 posted is actually working good, does someone know how to make it a Team Semiclip? Cuz I tried putting in each public a check if cs_get_user_team of the 2 player is equal then do the semiclip, but things mess up and they still can get into each other, I want them to block each other and not just be able to hit:

PHP Code:

#include < amxmodx >
#include < engine >
#include < fakemeta >
#include < hamsandwich >

#define IsPlayer(%1) ( 1 <= %1 <= g_iMaxPlayers )

new const g_szAliveFlags[ ] = "a";
new 
g_iPlayers32 ], g_iNumg_iPlayerg_iMaxPlayersi;

public 
plugin_init( )
{
    
register_plugin"Semiclip""1.0""ConnorMcLeod / xPaw" );
    
    
register_forwardFM_ShouldCollide"FwdShouldCollide" );
    
register_forwardFM_AddToFullPack"FwdAddToFullPack"true );
    
    
RegisterHamHam_Player_PreThink"player""FwdHamPlayerPreThink"true );
    
RegisterHamHam_Killed,          "player""FwdHamPlayerKilled",   true );
    
    
g_iMaxPlayers get_maxplayers( );
}

public 
FwdAddToFullPackeseiEntidhostflagsplayerpSet )
{
    if( 
player && id != iEnt && get_orig_retval( ) )
    {
        
set_esesES_SolidSOLID_NOT );
        
        static 
Float:flDistance;
        
flDistance entity_rangeidiEnt );
        
        if( 
flDistance 512.0 )
        {
            
set_esesES_RenderModekRenderTransAlpha )
            
set_esesES_RenderAmtfloatroundflDistance ) / );
        }
    }
}

public 
FwdShouldCollide( const iTouched, const iOther )
{
    if( 
IsPlayeriTouched ) && IsPlayeriOther ) )
    {
        
forward_returnFMV_CELL);
        return 
FMRES_SUPERCEDE;
    }
    
    return 
FMRES_IGNORED;
}

public 
FwdHamPlayerKilled( )
{
    
get_playersg_iPlayersg_iNumg_szAliveFlags );
    
    for( 
0g_iNumi++ )
    {
        
entity_set_intg_iPlayers], EV_INT_solidSOLID_SLIDEBOX );
    }
}

public 
FwdHamPlayerPreThink( const id )
    
SemiclipidSOLID_NOT );

public 
client_PostThinkid )
    
SemiclipidSOLID_SLIDEBOX );

Semiclip( const id, const iSolid )
{
    if( !
is_user_aliveid ) )
        return;
    
    
get_playersg_iPlayersg_iNumg_szAliveFlags );
    
    for( 
0g_iNumi++ )
    {
        
g_iPlayer g_iPlayers];
        
        if( 
id != g_iPlayer )
            
entity_set_intg_iPlayerEV_INT_solidiSolid );
    }



Diegorkable 11-18-2011 08:55

Re: Semiclip
 
EDIT: I use now the first code for me its really good.

I want something else if someone could help me with, I want that with the fact that players on the same team can not block each other, I want also that they can hit each other ---> It means that the semiclip works good they cant block each other, but they can hit each other.

How do I do that?

Code:

PHP Code:

/* Plugin generated by AMXX-Studio */ 

#include <amxmodx> 
#include <amxmisc> 
#include <engine> 
#include <cstrike> 
#include <fun> 
#include <fakemeta> 

#define PLUGIN "Semi-Clip" 
#define VERSION "1.0" 
#define AUTHOR "xPaw" 

new g_iSemiClip[33

public 
plugin_init() { 
    
register_plugin(PLUGINVERSIONAUTHOR
     
    
register_forwardFM_StartFrame"FwdStartFrame"); 
    
register_forwardFM_AddToFullPack"FwdFullPack"); 


public 
FwdFullPackeseenthostflagsplayerpSet ) { 
     
    if( 
player && g_iSemiClipent ] && g_iSemiCliphost ] ) { 
        
set_esesES_SolidSOLID_NOT ); 
        
set_esesES_RenderModekRenderTransAlpha ); 
        
set_esesES_RenderAmt85 ); 
    } 
     
    return 
FMRES_IGNORED


public 
FwdStartFrame( ) { 
     
    static 
iPlayers32 ], iNumiPlayeriPlayer2ij
    
get_playersiPlayersiNum"ache""CT" ); 
     
    
arraysetg_iSemiClip032 ); 
     
    if( 
iNum <= 
        return 
FMRES_IGNORED
     
    for( 
0iNumi++ ) { 
        
iPlayer iPlayers]; 
         
        for( 
0iNumj++ ) { 
            
iPlayer2 iPlayers]; 
             
            if( 
iPlayer == iPlayer2 
                continue; 
             
            if( 
g_iSemiClipiPlayer ] && g_iSemiClipiPlayer2 ] ) 
                continue; 
             
            if( 
entity_rangeiPlayeriPlayer2 ) < 128 ) { 
                
g_iSemiClipiPlayer ]    = true
                
g_iSemiClipiPlayer2 ]    = true
            } 
        } 
    } 
     
    for( 
0iNumi++ ) { 
        
iPlayer iPlayers]; 
         
        
set_peviPlayerpev_solidg_iSemiClipiPlayer ] ? SOLID_NOT SOLID_SLIDEBOX ); 
    } 
     
    return 
FMRES_IGNORED



schmurgel1983 11-19-2011 09:14

Re: Semiclip
 
try this one http://forums.alliedmods.net/showthread.php?t=137980

Diegorkable 11-19-2011 13:05

Re: Semiclip
 
Quote:

Originally Posted by schmurgel1983 (Post 1599098)

it has few bugs.. tried it already.

EDIT: The semiclip Im currently using is really good, but when 2 players stand together on an object that should kill you when you touch it, they stay alive, until they move from each other, then they die. Why is it? and how do I fix such thing?

PHP Code:

/* Plugin generated by AMXX-Studio */  

#include <amxmodx>  
#include <amxmisc>  
#include <engine>  
#include <cstrike>  
#include <fun>  
#include <fakemeta>  

#define PLUGIN "Semi-Clip"  
#define VERSION "1.0"  
#define AUTHOR "xPaw"  

new g_iSemiClip[33]  

public 
plugin_init() {  
    
register_plugin(PLUGINVERSIONAUTHOR)  
      
    
register_forwardFM_StartFrame"FwdStartFrame");  
    
register_forwardFM_AddToFullPack"FwdFullPack");  
}  

public 
FwdFullPackeseenthostflagsplayerpSet ) {  
      
    if( 
player && g_iSemiClipent ] && g_iSemiCliphost ] ) {  
        
set_esesES_SolidSOLID_NOT );  
        
set_esesES_RenderModekRenderTransAlpha );  
        
set_esesES_RenderAmt85 );  
    }  
      
    return 
FMRES_IGNORED;  
}  

public 
FwdStartFrame( ) {  
      
    static 
iPlayers32 ], iNumiPlayeriPlayer2ij;  
    
get_playersiPlayersiNum"ache""CT" );  
      
    
arraysetg_iSemiClip032 );  
      
    if( 
iNum <= )  
        return 
FMRES_IGNORED;  
      
    for( 
0iNumi++ ) {  
        
iPlayer iPlayers];  
          
        for( 
0iNumj++ ) {  
            
iPlayer2 iPlayers];  
              
            if( 
iPlayer == iPlayer2 )  
                continue;  
              
            if( 
g_iSemiClipiPlayer ] && g_iSemiClipiPlayer2 ] )  
                continue;  
              
            if( 
entity_rangeiPlayeriPlayer2 ) < 128 ) {  
                
g_iSemiClipiPlayer ]    = true;  
                
g_iSemiClipiPlayer2 ]    = true;  
            }  
        }  
    }  
      
    for( 
0iNumi++ ) {  
        
iPlayer iPlayers];  
          
        
set_peviPlayerpev_solidg_iSemiClipiPlayer ] ? SOLID_NOT SOLID_SLIDEBOX );  
    }  
      
    return 
FMRES_IGNORED;  



schmurgel1983 11-19-2011 17:50

Re: Semiclip
 
Quote:

Originally Posted by Diegorkable (Post 1599207)
it has few bugs.. tried it already.

tell me the "bugs"

Diegorkable 11-20-2011 01:38

Re: Semiclip
 
The reason I opened this thread are those bugs.
I run a deathrun server with the plugin I've built, and many people play it everyday. The thing is that when 2 players stand on a block together (any moving map object), at the second it starts moving, if the two players touch each other one of them die, or sometimes when they stand together on a moving object they both get hit and damaged till they seperate again.


All times are GMT -4. The time now is 08:34.

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