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

Need help, semiclip.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
t3hNox
Senior Member
Join Date: Oct 2009
Old 08-09-2010 , 15:19   Need help, semiclip.
Reply With Quote #1

Hi,
Once again I need help. This time with semiclip. I want to make so that if player has bool Respawning[id] = true he can walk through enemy team players (but not his own team players). I suppose I just need to put somewhere if(Respawning[id]) check. The problem is that I don't know which of addToFullPack function's parameters refers to id/player (I have tried Respawning[player]).
PHP Code:
public addToFullPack(eseenthosthostflagsplayerpSet)
{
    if(
player)
    {
        if(
plrSolid[host] && plrSolid[ent] && plrTeam[host] == plrTeam[ent])
        {
            
set_es(esES_SolidSOLID_NOT)
            
set_es(esES_RenderModekRenderTransAlpha)
            
set_es(esES_RenderAmt85)
        }
    }
}

FirstThink()
{
    for(new 
1<= maxplayersi++)
    {
        if(!
is_user_alive(i))
        {
            
plrSolid[i] = false
            
continue
        }
        
        
plrTeam[i] = get_user_team(i)
        
plrSolid[i] = pev(ipev_solid) == SOLID_SLIDEBOX true false
    
}
}

public 
preThink(id)
{
    static 
iLastThink
    
    
if(LastThink id)
    {
        
FirstThink()
    }
    
LastThink id

    
    
if(!plrSolid[id]) return
    
    for(
1<= maxplayersi++)
    {
        if(!
plrSolid[i] || id == i) continue
        
        if(
plrTeam[i] == plrTeam[id])
        {
            
set_pev(ipev_solidSOLID_NOT)
            
plrRestore[i] = true
        
}
    }
}

public 
postThink(id)
{
    static 
i
    
    
for(1<= maxplayersi++)
    {
        if(
plrRestore[i])
        {
            
set_pev(ipev_solidSOLID_SLIDEBOX)
            
plrRestore[i] = false
        
}
    }

Thanks.

Last edited by t3hNox; 08-09-2010 at 17:59.
t3hNox is offline
Jack86
Veteran Member
Join Date: Dec 2008
Location: Belgrade, Serbia
Old 08-09-2010 , 15:43   Re: Need help, semiclip.
Reply With Quote #2

Quote:
Originally Posted by ConnorMcLeod View Post
host is the player who you send the data (receiver), ent is the player from who you send datas (when player == 0, ent is not a player)

Bad english
__________________

Jack86 is offline
t3hNox
Senior Member
Join Date: Oct 2009
Old 08-09-2010 , 16:34   Re: Need help, semiclip.
Reply With Quote #3

Ok. It means that Respawning[ent] should be used to check whether to make player able to go through others or not.
PHP Code:
public addToFullPack(eseenthosthostflagsplayerpSet

    if(
player && Respawning[ent] == true// if true
    

        if(
plrSolid[host] && plrSolid[ent] && plrTeam[host] != plrTeam[ent])  // != to check whether the teams are different 
        

            
set_es(esES_SolidSOLID_NOT
            
set_es(esES_RenderModekRenderTransAlpha
            
set_es(esES_RenderAmt85
        } 
    } 

But what to do with the other forward ?
As a side question - the loop in the forward means that looping is done the whole time, isn't it (too) much CPU consuming ?
t3hNox is offline
t3hNox
Senior Member
Join Date: Oct 2009
Old 08-10-2010 , 06:56   Re: Need help, semiclip.
Reply With Quote #4

Sorry for double post :/
I remembered that xPaw's DR manager uses semiclip that I could edit. I have get this far:
PHP Code:
new bool:Respawning[33] = falsebool:g_NoSolid[33] = false

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

public 
FwdFullPackeseenthostflagsplayerpSet ) {
    
    if( !
is_user_alive(ent) || !IsPlayer(ent) )
        return 
FMRES_IGNORED;
    
    if( 
is_user_alive(ent) && player && cs_get_user_team(ent) != cs_get_user_team(host) ) {
        
set_esesES_SolidSOLID_NOT );
        
set_esesES_RenderModekRenderTransAlpha );
        
set_esesES_RenderAmt85 );
    }
    
    return 
FMRES_IGNORED;
}

public 
FwdStartFrame( ) {
    
    static 
iPlayers32 ], iNumiPlayeriPlayer2ij;
    
get_playersiPlayersiNum"ach" );
    
    
arraysetg_NoSolid032 );
    
    if( 
iNum <= )
        return 
FMRES_IGNORED;
    
    for( 
0iNumi++ ) {
        
iPlayer iPlayers];
        
        if(
Respawning[iPlayer])
            continue;
        
        for( 
0iNumj++ ) {
            
iPlayer2 iPlayers];
            
            if( 
iPlayer == iPlayer2 )
                continue;
            
            if( 
RespawningiPlayer ] && cs_get_user_team(iPlayer) != cs_get_user_team(iPlayer2))
                continue;
            
            if( 
entity_rangeiPlayeriPlayer2 ) < 128 ) {
                
g_NoSolidiPlayer ] = true;
            }
        }
    }
    
    for( 
0iNumi++ ) {
        
iPlayer iPlayers];
        
        
set_peviPlayerpev_solidg_NoSolidiPlayer ] ? SOLID_NOT SOLID_SLIDEBOX );
    }
    
    return 
FMRES_IGNORED;

The problems I've enountered with are that it seems that T has only semiclip (all the time) and T is always half-visible. What I wanted to make is that is CT has Respawning[id] true, he can go through T.
t3hNox is offline
t3hNox
Senior Member
Join Date: Oct 2009
Old 08-11-2010 , 10:48   Re: Need help, semiclip.
Reply With Quote #5

I'm sorry for posting repeatedly but this semiclip part is now the only thing that keeps me away from finishing a plugin and also I have been working on these two functions for over a day now.
PHP Code:
new bool:Respawning[33] = falsebool:g_NoSolid[33] = false
public plugin_init()
{
    
register_forwardFM_StartFrame,    "FwdStartFrame");
    
register_forwardFM_AddToFullPack,    "FwdFullPack",   );
}

public 
FwdFullPackeseenthostflagsplayerpSet ) {

    if( 
player && g_NoSolident ] && g_NoSolidhost ] ) {
        
set_esesES_SolidSOLID_NOT );
        
set_esesES_RenderModekRenderTransAlpha );
        
set_esesES_RenderAmt85 );
    }
    
    return 
FMRES_IGNORED;
}

public 
FwdStartFrame( ) {

    static 
iPlayers32 ], iNumiPlayeriPlayer2ij;
    
get_playersiPlayersiNum"ah" );
    
    
arraysetg_NoSolid032 );
    
    if( 
iNum <= )
        return 
FMRES_IGNORED;
    
    for( 
0iNumi++ ) {
        
iPlayer iPlayers];
        
        for( 
0iNumj++ ) {
            
iPlayer2 iPlayers];
            
            if( 
iPlayer == iPlayer2 )
                continue;
            
            if( 
g_NoSolidiPlayer ] && g_NoSolidiPlayer2 ])
                continue;
                
            if(
Respawning[iPlayer] || Respawning[iPlayer2])
                continue;
            else                            
//else part not actually needed
                
break;
            
            if( 
entity_rangeiPlayeriPlayer2 ) < 100 ) {
                
g_NoSolidiPlayer ]    = true;
                
g_NoSolidiPlayer2 ]    = true;
            }
        }
    }
    
    for( 
0iNumi++ ) {
        
iPlayer iPlayers];
        
        
set_peviPlayerpev_solidg_NoSolidiPlayer ] ? SOLID_NOT SOLID_SLIDEBOX );
    }
    
    return 
FMRES_IGNORED;

Without if(Respawning[iPlayer] || Respawning[iPlayer2]) part everything is working, everyone has semiclip, but with Respawning check nothing is working.
IDK, where could be the problem.
t3hNox is offline
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 05:00.


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