AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Bad Spawn Preventer that works? (https://forums.alliedmods.net/showthread.php?t=331872)

Ark_Procession 04-10-2021 23:08

Bad Spawn Preventer that works?
 
Hi all

Anyone has a working bad spawn preventer?


https://forums.alliedmods.net/showthread.php?t=114857
https://forums.alliedmods.net/showthread.php?t=102903

This two doesn't work anymore.

fysiks 04-10-2021 23:13

Re: Bad Spawn Preventer that works?
 
Have you considered just fixing the map instead? It's a better solution in the end.

Ark_Procession 04-10-2021 23:20

Re: Bad Spawn Preventer that works?
 
Thanks for the quick answer!

I considered it yes. thats why i use in all my maps the spawn editor... and it has a safe distance you can put but players keep dying anyway.

DJEarthQuake 04-11-2021 05:57

Re: Bad Spawn Preventer that works?
 
Quote:

Originally Posted by Ark_Procession (Post 2743735)
Thanks for the quick answer!

I considered it yes. thats why i use in all my maps the spawn editor... and it has a safe distance you can put but players keep dying anyway.

I updated the approved 'spawn protection script'. That will cut down on spawn deaths from over-stacking.

Ark_Procession 04-11-2021 09:23

Re: Bad Spawn Preventer that works?
 
Quote:

Originally Posted by DJEarthQuake (Post 2743758)
I updated the approved 'spawn protection script'. That will cut down on spawn deaths from over-stacking.

Thanks man! i tested it and they still die at the same "rate" as without the plugin. I'm using this to make spawns:

https://forums.alliedmods.net/showthread.php?p=371317

It should be safe if i respect the green line but when i add 30 bots for test, some of them will die anyway.

tarsisd2 04-12-2021 04:59

Re: Bad Spawn Preventer that works?
 
which maps are you using? is it de_ maps or some other mod? in my servers i never use spawn editor or such plugins as all of my maps are over 40 spawn slots, if you want i can give some maps that are giving you trouble with more spawn if it is normal maps

DJEarthQuake 04-12-2021 08:38

Re: Bad Spawn Preventer that works?
 
Quote:

Originally Posted by Ark_Procession (Post 2743776)
Thanks man! i tested it and they still die at the same "rate" as without the plugin. I'm using this to make spawns:

https://forums.alliedmods.net/showthread.php?p=371317

It should be safe if i respect the green line but when i add 30 bots for test, some of them will die anyway.

Set the CVAR to 60 until you use the Spawn Editor.

Ark_Procession 04-12-2021 21:24

Re: Bad Spawn Preventer that works?
 
Quote:

Originally Posted by tarsisd2 (Post 2743853)
which maps are you using? is it de_ maps or some other mod? in my servers i never use spawn editor or such plugins as all of my maps are over 40 spawn slots, if you want i can give some maps that are giving you trouble with more spawn if it is normal maps

Hi! i use mostly vanilla maps and custom like de_emir or de_alexandra

my problem is with small maps mostly, like fy_iceworld2k if the spawn editor checks green in distance, they shouldn't be dying... but i still wanted a plugin so i made sure no one died...
I would welcome a link for more maps tho. also, how do you prevent them from not dying?

Ark_Procession 04-12-2021 21:25

Re: Bad Spawn Preventer that works?
 
Quote:

Originally Posted by DJEarthQuake (Post 2743869)
Set the CVAR to 60 until you use the Spawn Editor.

Sorry which cvar are you talking about? and what do you mean until i use spawn editor? i already use it.

tarsisd2 04-13-2021 06:46

Re: Bad Spawn Preventer that works?
 
in case you use rehlds + regame i have a plugin that adds spawn near other spawn automatically, just in case

PHP Code:

#include < amxmodx >
#include < hamsandwich >
#include < fakemeta >
#include < reapi >

#pragma semicolon 1

#define TEAM_SPAWNPOINTS_COUNT            20

new boolg_bFixFirstSpawnMAX_PLAYERS ];

new 
HamHookg_HamHook_PlayerIsPlayer;

public 
plugin_init( )
{
    
register_plugin"Spawns add auto""1.0.""dev" );

    
RegisterHookChainRG_CBasePlayer_Spawn"@CBasePlayer__Spawn_Pre"false );
    
RegisterHookChainRG_CBasePlayer_Spawn"@CBasePlayer__Spawn_Post"true );

    
DisableHamForward( ( g_HamHook_PlayerIsPlayer RegisterHamPlayerHam_IsPlayer"@CBasePlayer__IsPlayer_Pre"false ) ) );

    
AddSpawnPoints"info_player_deathmatch" );
    
AddSpawnPoints"info_player_start" );
}

public 
client_putinserveriPlayer )
{
    
g_bFixFirstSpawniPlayer ] = true;
}

@
CBasePlayer__Spawn_PreiPlayer )
{
    new 
TeamNameiTeam get_memberiPlayerm_iTeam );

    if( 
iTeam == TEAM_TERRORIST || iTeam == TEAM_CT )
    {
        if( 
g_bFixFirstSpawniPlayer ] )
        {
            
g_bFixFirstSpawniPlayer ] = false;
            return;
        }
    }
    else
        return;

    
// Using this only for selection spawn point (prevent the bugs with a player)
    
EnableHamForwardg_HamHook_PlayerIsPlayer );
}

@
CBasePlayer__Spawn_PostiPlayer )
{
    
DisableHamForwardg_HamHook_PlayerIsPlayer );
}

// HACK: prevent the death of a player
@CBasePlayer__IsPlayer_PreiEntity )
{
    
SetHamReturnIntegerfalse );
    return 
HAM_SUPERCEDE;
}

AddSpawnPoints( const sClassname[ ] )
{
    new 
FloatvecOrigin];
    new 
FloatvecAngles];

    new 
FloatvecOriginLast];
    new 
FloatvecMidOrigin];
    new 
FloatvecMidAngles];

    new Array: 
aSpawnPoints ArrayCreate);

    new 
iSpot MaxClients;

    while( ( 
iSpot rg_find_ent_by_classiSpotsClassnametrue ) ) )
    {
        
ArrayPushCellaSpawnPointsiSpot );

        
get_entvariSpotvar_originvecOrigin );
        
get_entvariSpotvar_anglesvecAngles );

        
vecMidOrigin] += vecOrigin] - vecOriginLast];
        
vecMidOrigin] += vecOrigin] - vecOriginLast];

        
vecMidAngles] += vecAngles];
        
vecMidAngles] += vecAngles];

        
vecOriginLast] = vecOrigin];
        
vecOriginLast] = vecOrigin];
    }

    new 
iSpotsCount ArraySizeaSpawnPoints );

    if( 
iSpotsCount >= TEAM_SPAWNPOINTS_COUNT )
        return;

    new 
FloatflSpotsCount floatiSpotsCount );

    
vecMidOrigin] /= flSpotsCount;
    
vecMidOrigin] /= flSpotsCount;

    
vecMidAngles] /= flSpotsCount;
    
vecMidAngles] /= flSpotsCount;

    new 
iAllSpawns iSpotsCount;
    new 
FloatflDistance floatsqrootvecMidOrigin] * vecMidOrigin] + vecMidOrigin] * vecMidOrigin] );

    for( new 
iIndex 0iIndex ArraySizeaSpawnPoints ); iIndex++ )
    {
        
iSpot ArrayGetCellaSpawnPointsiIndex );

        
get_entvariSpotvar_originvecOrigin );

        
iSpot CreateSpawnPointsClassnamevecOriginvecMidAnglesflDistance );

        if( 
iSpot == NULLENT )
            continue;

        
ArrayPushCellaSpawnPointsiSpot );

        if( ++
iAllSpawns >= TEAM_SPAWNPOINTS_COUNT )
            break;
    }

    
ArrayDestroyaSpawnPoints );

    if( 
iAllSpawns >= TEAM_SPAWNPOINTS_COUNT )
        return;

    
server_print"FAILED: not all ^"%s^". Added %d"sClassnameTEAM_SPAWNPOINTS_COUNT iAllSpawns );
}

CreateSpawnPoint( const sClassname[ ], FloatvecOrigin], FloatvecAngles], FloatflDistance )
{
    new 
FloatvecOffset][ ] = { { -1.00.0 }, { 1.00.0 }, { 0.0, -1.0 }, { 0.01.0 }, { -1.0, -1.0 }, { 1.01.0 }, { -1.01.0 }, { 1.0, -1.0 } };

    new 
FloatflRange;
    new 
FloatflFraction;
    new 
FloatvecSelect];

    
vecSelect] = vecOrigin];

    for( new 
iDeepLevel 0jiDeepLevel <= 4iDeepLevel++ )
    {
        switch( 
iDeepLevel )
        {
            case 
0flRange flDistance;
            case 
1flRange flDistance 0.5;
            case 
2flRange flDistance 1.5;
            case 
3flRange flDistance 2.0;
            case 
4flRange flDistance 2.5;
        }

        for( 
0sizeof vecOffsetj++ )
        {
            
vecSelect] = vecOrigin] + flRange vecOffset][ ];
            
vecSelect] = vecOrigin] + flRange vecOffset][ ];

            
engfuncEngFunc_TraceLinevecOriginvecSelectDONT_IGNORE_MONSTERS, -1);

            
get_tr20TR_flFractionflFraction );

            if( 
flFraction != 1.0 )
                continue;

            
engfuncEngFunc_TraceHullvecSelectvecSelect0HULL_HUMAN, -1);

            if( 
get_tr20TR_StartSolid ) || get_tr20TR_AllSolid ) || !get_tr20TR_InOpen ) )
                continue;

            new 
iEntity rg_create_entitysClassnametrue );

            if( 
is_nullentiEntity ) )
                continue;

            
engfuncEngFunc_SetOriginiEntityvecSelect );
            
set_entvariEntityvar_anglesvecAngles );

            return 
iEntity;
        }
    }

    return 
NULLENT;


here i have a lot of maps with over 40 spawns on them, so if you use them you dont need any plugin such as spawn editor:

https://disk.yandex.com/d/cauwFLLp3PR6Bx

the files has a password, wich i sent to you by pm


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

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