AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Solved SoccerJam Goal Net hide (MAP & MOD) (https://forums.alliedmods.net/showthread.php?t=340464)

sanimare 11-20-2022 12:03

SoccerJam Goal Net hide (MAP & MOD)
 
https://imgur.com/lfnJkDa.png

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



deprale 11-21-2022 00:18

Re: SoccerJam Goal Net hide (MAP & MOD)
 
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)
}



sanimare 11-21-2022 14:53

Re: SoccerJam Goal Net hide (MAP & MOD)
 
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 :)

deprale 11-22-2022 10:49

Re: SoccerJam Goal Net hide (MAP & MOD)
 
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.

sanimare 11-23-2022 11:35

Re: SoccerJam Goal Net hide (MAP & MOD)
 
I want player to be able to call command /goalnet and choose whether he want to hide or not, simple: hide/unhide

deprale 11-23-2022 20:45

Re: SoccerJam Goal Net hide (MAP & MOD)
 
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.

sanimare 11-26-2022 15:39

Re: SoccerJam Goal Net hide (MAP & MOD)
 
Super :)

deprale 11-27-2022 03:29

Re: SoccerJam Goal Net hide (MAP & MOD)
 
Quote:

Originally Posted by sanimare (Post 2793774)
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


https://i.imgur.com/veUw5eA.jpg
https://i.imgur.com/4mTp0Kk.jpg

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.

sanimare 11-27-2022 09:15

Re: SoccerJam Goal Net hide (MAP & MOD)
 
On soccerjam_sunrise_v3

https://i.imgur.com/5L8a22L.jpg

deprale 11-28-2022 01:02

Re: SoccerJam Goal Net hide (MAP & MOD)
 
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)


All times are GMT -4. The time now is 19:53.

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