Raised This Month: $30 Target: $400
 7% 

Solved SoccerJam Goal Net hide (MAP & MOD)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sanimare
Senior Member
Join Date: Sep 2010
Old 11-20-2022 , 13: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 16:19. Reason: Jobs done
sanimare is offline
deprale
Senior Member
Join Date: Oct 2018
Location: Leeds
Old 11-21-2022 , 01:18   Re: SoccerJam Goal Net hide (MAP & MOD)
Reply With Quote #2

https://github.com/Doondook/soccerja...m%2B.sma#L4844
https://github.com/Doondook/soccerja...m%2B.sma#L4852 ->> entityname

Method number 1: Modify the plugin directly and add a button or bind to set_entitiy_visibility(endzone, 1)
Method number 2: Make another plugin (Cringe)

You just have to find the entity and set the flag EF_NODRAW or just use engine like the og plugin since you're already using it.
PHP Code:
#include engine

public plugin_init()
{
makeamenuhere
}

public 
menulol() {
switch 
keypress {
case 
0sendcmd(1// visible yes
case 1sendcmd(0// visible no
}
}

public 
sendcmd(number)
{
while((
ent find_ent_by_class(ent,"soccerjam_goalnet")) != 0)
{
    
set_entity_visibility(entnumber)
}

__________________

Last edited by deprale; 11-21-2022 at 01:18.
deprale is offline
sanimare
Senior Member
Join Date: Sep 2010
Old 11-21-2022 , 15:53   Re: SoccerJam Goal Net hide (MAP & MOD)
Reply With Quote #3

I tried some things but i don't know about coding alot, so i couldn't real do it so far, if anyone can help more would be great
sanimare is offline
deprale
Senior Member
Join Date: Oct 2018
Location: Leeds
Old 11-22-2022 , 11:49   Re: SoccerJam Goal Net hide (MAP & MOD)
Reply With Quote #4

I don't have internet access and I'm quite busy for the week, but if you're willing to wait I might fork that plugin and add the menu button you requested by MONDAY.

EDIT: Looks like you wanted PER PLAYER button, I thought you wanted just a simple on/off button, my bad.
I don't have any experience with addtofullpack or pev_groupinfo so you'll have to ask someone more experienced I'm afraid.
__________________

Last edited by deprale; 11-23-2022 at 09:24.
deprale is offline
sanimare
Senior Member
Join Date: Sep 2010
Old 11-23-2022 , 12:35   Re: SoccerJam Goal Net hide (MAP & MOD)
Reply With Quote #5

I want player to be able to call command /goalnet and choose whether he want to hide or not, simple: hide/unhide
sanimare is offline
deprale
Senior Member
Join Date: Oct 2018
Location: Leeds
Old 11-23-2022 , 21:45   Re: SoccerJam Goal Net hide (MAP & MOD)
Reply With Quote #6

Ok, I understood your request now.
I found a great example of working with addtofullpack over here

I don't promise anything but expect a reply this weekend.
__________________
deprale is offline
sanimare
Senior Member
Join Date: Sep 2010
Old 11-26-2022 , 16:39   Re: SoccerJam Goal Net hide (MAP & MOD)
Reply With Quote #7

Super
sanimare is offline
deprale
Senior Member
Join Date: Oct 2018
Location: Leeds
Old 11-27-2022 , 04:29   Re: SoccerJam Goal Net hide (MAP & MOD)
Reply With Quote #8

Quote:
Originally Posted by sanimare View Post
Super
PHP Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>

#define PLUGIN "Hide goalnets [SJ]"
#define AUTHOR "deprale"
#define VERSION "1.0"
#define MAX_ENTITIES 1372

new g_Hide[MAX_PLAYERS 1];
new 
bool:g_bGoalNetEntity[MAX_ENTITIES];

public 
plugin_init( )
{
    
register_pluginPLUGINVERSIONAUTHOR )
    
register_clcmd"say /net""cmd_net" )
    
register_forwardFM_AddToFullPack"fwdAddToFullPack_Post")

}

public 
plugin_cfg( ) {
    new 
ent = -1
    
while( ( ent find_ent_by_classent"func_illusionary" ) ) != )
    {        
        
g_bGoalNetEntityent ] = true
    
}
}

public 
cmd_netid )
{
    switch( 
g_Hideid ] ){
        case 
0g_Hideid ] = true
        
case 1g_Hideid ] = false
    
}
    
client_print_coloridprint_team_default"^4Hide nets^1:^3 %s"g_Hideid ] ? "Yes" "No" )
}

public 
client_connectedid )
{
    
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




This in theory should work on all maps/plugins unless they used different entity names for goalnets, which in that case I will provide you with further instructions/help.
__________________

Last edited by deprale; 11-27-2022 at 04:32. Reason: forgot smth
deprale is offline
sanimare
Senior Member
Join Date: Sep 2010
Old 11-27-2022 , 10:15   Re: SoccerJam Goal Net hide (MAP & MOD)
Reply With Quote #9

On soccerjam_sunrise_v3

sanimare is offline
deprale
Senior Member
Join Date: Oct 2018
Location: Leeds
Old 11-28-2022 , 02:02   Re: SoccerJam Goal Net hide (MAP & MOD)
Reply With Quote #10

Can you provide the map ? I can not find it on the internet, or any server running it.

In the meanwhile try this too:

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

#define PLUGIN "Hide goalnets [SJ]"
#define AUTHOR "deprale"
#define VERSION "1.0"
#define MAX_ENTITIES 1372

new g_Hide[MAX_PLAYERS 1];
new 
bool:g_bGoalNetEntity[MAX_ENTITIES];

public 
plugin_init( )
{
    
register_pluginPLUGINVERSIONAUTHOR )
    
register_clcmd"say /net""cmd_net" )
    
register_forwardFM_AddToFullPack"fwdAddToFullPack_Post")

}

public 
plugin_cfg( ) {
    new 
ent = -1
    
while( ( ent find_ent_by_classent"func_illusionary" ) ) != )
    {        
        
g_bGoalNetEntityent ] = true
    
}
    while( ( 
ent find_ent_by_classent"soccerjam_goalnet" ) ) != )
    {        
        
g_bGoalNetEntityent ] = true
    
}
}

public 
cmd_netid )
{
    switch( 
g_Hideid ] ){
        case 
0g_Hideid ] = true
        
case 1g_Hideid ] = false
    
}
    
client_print_coloridprint_team_default"^4Hide nets^1:^3 %s"g_Hideid ] ? "Yes" "No" )
}

public 
client_connectedid )
{
    
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

Downloaded some other maps and apparently it either is func_illusionary or soccerjam_goalnet entities usually (confirmed by both amxx and bspguy)
__________________

Last edited by deprale; 11-28-2022 at 02:06.
deprale is offline
Reply


Thread Tools
Display Modes

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 20:11.


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