View Single Post
Author Message
sanimare
Senior Member
Join Date: Sep 2010
Old 11-20-2022 , 12:03   SoccerJam Goal Net hide (MAP & MOD)
Reply With Quote #1



I saw already server with hidden net of goal, but server is shutted down. It was command and in menu you could choose to hide or show goal net, but ofcourse not remove, just hide, so you can jump on goal and do tricks and stuff, where is the all fun in this mod.

Sma -> https://github.com/Doondook/soccerjam, or just need to make new plugin to do something to this map bsp. Here is all i have, i'm glad if someone could help with this.
Also, here is the map in .zip file called soccerjam_sunrise_v3 and .sma original is also there https://github.com/Doondook/soccerjam, i just put into code so you can see if something is in there that can help just from seeing this post. Thank's.

WORKING:

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

#define PLUGIN " [SJ]Hide goalnets FINAL"
#define AUTHOR "deprale"
#define VERSION "1.0"
#define MAX_ENTITIES 1372
#define Z_AXIS 2
#define Y_AXIS 1
#define X_AXIS 0

new g_HideMAX_PLAYERS ];
new 
bool:g_bGoalNetEntityMAX_ENTITIES ];

new 
g_Strings[][] = {
    { 
"net" }/*,
    { "if you wanna add more dont forget about the commas, only the last element doesn't need a comma "{ },<< this here" "} << last element no comma example*/
}

public 
plugin_init( )
{
    
register_pluginPLUGINVERSIONAUTHOR )

    
register_forwardFM_AddToFullPack"fwdAddToFullPack_Post")

    
register_clcmd"say /net""cmd_net" )
}

public 
plugin_cfg()
{
    
trace_textures(Z_AXIS)
    
trace_textures(Y_AXIS)
}

public 
trace_textures(const axis)
{
    new 
ent = -1
    
    
while ((ent != MAX_ENTITIES)) {
        
ent++
        if(
is_valid_ent(ent)) {
            new 
Float:fOrigin], Float:vEndOrigin],
                
szTextureMAX_NAME_LENGTH ]

            
get_brush_entity_originentfOrigin //You don't wanna know how much hours I spent researching till I found out how to do it properly.
            
vEndOrigin fOrigin
            vEndOrigin
[axis] = 8191.0

            engfunc
EngFunc_TraceTextureentfOriginvEndOriginszTexturecharsmaxszTexture ) )

            for (new 
0sizeof(g_Strings); i++)
            {
                if(
contain(szTextureg_Strings[i]) != -1
                {
                
g_bGoalNetEntity[ent] = true
                
//server_print( "DETECTED" )
                
}
            }
            
            
//server_print( "^nentid:%i^ntexture:%s^norigin[0]:%f^norigin[1]:%f^norigin[2]:%f^n", ent, szTexture, vEndOrigin[ 0 ],vEndOrigin[ 1 ],vEndOrigin[ 2 ] )
        
}
    }
}

public 
cmd_netid )
{
    switch( 
g_Hideid ])
    {
        case 
0g_Hideid ] = true
        
case 1g_Hideid ] = false
    
}

    
client_print_color(idprint_team_default"^3Hide nets status^4:^3%s^4!"g_Hideid ] ? "ON" "OFF" )

    return 
PLUGIN_HANDLED     //don't let the command be shown in chat (annoying for others)
}

public 
client_connectid )
{
    
g_Hideid ] = false
}

public 
client_disconnectedid )
{
    
g_Hideid ] = false
}

public 
fwdAddToFullPack_Postes_handleeentiHosthostflagsplayerpset )
{
    if ( !
g_HideiHost ] )
        return 
FMRES_IGNORED

    
if ( g_bGoalNetEntityent ] )
        
set_eses_handleES_Effectsget_eses_handleES_Effects ) | EF_NODRAW )

    return 
FMRES_IGNORED


Last edited by sanimare; 12-03-2022 at 15:19. Reason: Jobs done
sanimare is offline