Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Block Zone #1169

Open
Uronic opened this issue Sep 13, 2022 · 1 comment
Open

[Feature Request] Block Zone #1169

Uronic opened this issue Sep 13, 2022 · 1 comment

Comments

@Uronic
Copy link

Uronic commented Sep 13, 2022

A zone which blocks the player. This zone type exists in Influx Timer.

This is the code from influx:

        default :
        {
            float spd = GetEntitySpeed( client ) * 0.5;
            
            if ( spd < 300.0 )
            {
                spd = 300.0;
            }
            
            decl Float:temp[3], Float:temp2[3];
            GetClientAbsOrigin( client, temp );
            GetEntityOrigin( ent, temp2 );
            
            float dist = GetVectorDistance( temp, temp2, false );
            for ( int i = 0; i < 3; i++ )
            {
                temp[i] = ( (temp[i] - temp2[i]) / dist ) * spd;
            }
            
            GetClientEyeAngles( client, temp2 );
            temp2[0] = GetRandomFloat( -89.0, 89.0 );
            temp2[1] = GetRandomFloat( -180.0, 180.0 );
            
            TeleportEntity( client, NULL_VECTOR, temp2, temp );
        }
    }
    
    if ( print && GetEngineTime() > g_flNextMsg[client] )
    {
        PrintCenterText( client, "You shouldn't be here!" );
        
        g_flNextMsg[client] = GetEngineTime() + 1.0;
    }

https://github.com/InfluxTimer/sm-timer/blob/d3e055ecf4d25cbb08ffd531215a7be49e641a6a/addons/sourcemod/scripting/influx_zones_block.sp#L536-L568

@rtldg
Copy link
Collaborator

rtldg commented Sep 15, 2022

I'm not really a fan of adding a push zone to keep people out of somewhere tbh.
In my opinion, the map should be fixed with stripper, a _fix bsp, or obviously teleport/glitch zones.

It's also possible to make a zone solid although which could fill in a place. Although you'd have to edit the zones db to make a solid zone right now.

if (gA_ZoneCache[zone].iFlags & ZF_Solid)
{
SetEntProp(entity, Prop_Send, "m_usSolidFlags",
GetEntProp(entity, Prop_Send, "m_usSolidFlags") & ~(FSOLID_TRIGGER|FSOLID_NOT_SOLID));
}

I'll come back to this sometime whenever I make solid zones possible from the menus or decide to add push zones

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants