AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   help - semiclip ladders (https://forums.alliedmods.net/showthread.php?t=101939)

arnaldo_silva 08-28-2009 18:18

help - semiclip ladders
 
Well that plugin makes semiclip at ladders.

Well my problem is that he only do semiclip when is 2 people on the ladder. Is possible put when is only one player on the ladder he get's automatically semiclip. This is for hns for the people on the ladder don't block. Can some one edit this plugin and put that? Help plz

PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define PLUGIN "Semiclip"
#define VERSION "1.31"
#define AUTHOR "skyjur"

new bool:plrSolid[33]
new 
bool:plrRestore[33]

new 
maxplayers

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_forward(FM_PlayerPreThink"preThink")
    
register_forward(FM_PlayerPostThink"postThink")
    
    
register_forward(FM_AddToFullPack"addToFullPack"1)
    
    
maxplayers get_maxplayers()
}

public 
addToFullPack(eseenthosthostflagsplayerpSet)
{
    if(
player)
    {
        if(
plrSolid[host] && plrSolid[ent])
        {
            
set_es(esES_SolidSOLID_NOT)
            
set_es(esES_RenderModekRenderTransAlpha)
            
set_es(esES_RenderAmt85)
        }
    }
}

FirstThink()
{
    for(new 
1<= maxplayersi++)
    {
        if(!
is_user_alive(i) || pev(ipev_movetype) != MOVETYPE_FLY)
        {
            
plrSolid[i] = false
            
continue
        }
        
        
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
        
        
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
        
}
    }


Thx

Exolent[jNr] 08-29-2009 02:38

Re: help - semiclip ladders
 
Try this:

PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define PLUGIN "Semiclip"
#define VERSION "1.31"
#define AUTHOR "skyjur"

new bool:plrSolid[33]
new 
bool:plrRestore[33]
new 
bool:plrLadder[33]

new 
maxplayers

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_forward(FM_PlayerPreThink"preThink")
    
register_forward(FM_PlayerPostThink"postThink")
    
    
register_forward(FM_AddToFullPack"addToFullPack"1)
    
    
maxplayers get_maxplayers()
}

public 
addToFullPack(eseenthosthostflagsplayerpSet)
{
    if(
player)
    {
        if(
plrSolid[host] && plrSolid[ent] && (plrLadder[host] || plrLadder[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
        }
        
        
plrSolid[i] = pev(ipev_solid) == SOLID_SLIDEBOX true false
        plrLadder
[i] = pev(ipev_movetype) == MOVETYPE_FLY 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
        
        
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
        
}
    }



arnaldo_silva 08-29-2009 12:49

Re: help - semiclip ladders
 
With your plugin semiclip is enable in everywhere in the map. In the ground players have semiclip too. Can you fixed?

Exolent[jNr] 08-30-2009 00:57

Re: help - semiclip ladders
 
Sorry, I didn't really pay attention to the variable name I used.
Code should be fixed now.

arnaldo_silva 08-30-2009 09:21

Re: help - semiclip ladders
 
Still with semiclip :S

In the ground it's like the plugin try to block semiclip but you still can pass through the player.

tolsty 09-03-2009 18:52

Re: help - semiclip ladders
 
try this
PHP Code:

//cred. xpaw for his original semiclip code
#include <amxmodx>
#include <fun>
#include <fakemeta>

#define PLUGIN "hns SEMICLIP"
#define VERSION "0.0"
#define AUTHOR "Tolsty"

#pragma semicolon 1;
 
new g_iSemiClip[33];
new 
air[33];



public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_forwardFM_PlayerPreThink"fwdPlayerPreThink" );
    
register_forwardFM_StartFrame,        "fwStartFrame");
    
register_forwardFM_AddToFullPack,     "fwFullPack",        );
}

public 
fwdAddToFullPack_Postes_handleeenthosthostflagsplayerpset ) {
        if(
player && g_iSemiClip[ent] && g_iSemiClip[host]) {
            
set_es(es_handleES_SolidSOLID_NOT);
            
set_es(es_handleES_RenderModekRenderTransAlpha);
            
set_es(es_handleES_RenderAmt100);
        }

            return 
FMRES_IGNORED;
}


public 
fwdPlayerPreThinkiPlayer ) {

    static 
flags;
    
flags peviPlayerpev_flags );
    if ( 
flags FL_ONGROUND || (pev(iPlayerpev_movetype) == MOVETYPE_FLY)  ) {
            
remove_task(iPlayer);
            
air[iPlayer] = false;
    }
}
 
public 
fwStartFrame(plr) {
        static 
iPlayers[32], iNumiPlayeriPlayer2;
        
get_players(iPlayersiNum);
        
        
arrayset(g_iSemiClip0sizeof(g_iSemiClip));
  
        for(new 
i=0iNumi++) {
            
iPlayer iPlayers[i];
                
            if( !
is_user_alive(iPlayer) )
                continue;
                
            for(new 
j=0iNumj++) {
                
iPlayer2 iPlayers[j];
                        
                if(
iPlayer == iPlayer2 || !is_user_alive(iPlayer2))
                    continue;
                        
                static 
Float:vOrigin1[3], Float:vOrigin2[3];
                
pev(iPlayerpev_originvOrigin1);
                
pev(iPlayer2pev_originvOrigin2);
                static 
team[33];
                            
team[iPlayer] = get_user_teamiPlayer );
                static 
flags;
                
flags peviPlayerpev_flags );
                
                if ( !( 
flags FL_ONGROUND ) && (pev(iPlayerpev_movetype) != MOVETYPE_FLY) ) {
                    
set_task(0.8"inair"iPlayer);
                }
                if ( 
vector_distancevOrigin1vOrigin2 ) < 220 && (pev(iPlayerpev_movetype) == MOVETYPE_FLY && (team[iPlayer] != team[iPlayer2]) || air[iPlayer] )  ) {
                    
g_iSemiClip[iPlayer]    = true;
                    
g_iSemiClip[iPlayer2]   = true;
                } 
                else if( 
vector_distancevOrigin1vOrigin2 ) < 220 && (team[iPlayer] == team[iPlayer2]) ) {
                    
g_iSemiClip[iPlayer]    = true;
                    
g_iSemiClip[iPlayer2]   = true;
                }
            }
        }
        
        for(new 
i=0iNum;i++) {
            
iPlayer iPlayers[i];
                
            if( 
is_user_alive(iPlayer) )
                
set_pev(iPlayerpev_solidg_iSemiClip[iPlayer] ? SOLID_NOT SOLID_SLIDEBOX);
        }

        return 
FMRES_IGNORED;


public 
inair(plr) {
    new 
flags;
    
flags pevplrpev_flags );
    if ( 
flags FL_ONGROUND || (pev(plrpev_movetype) == MOVETYPE_FLY)  ) {
        
air[plr] = false;
    }
    else {
        
air[plr] = true;
    }    




All times are GMT -4. The time now is 15:06.

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