Raised This Month: $51 Target: $400
 12% 

To not respawn at first join.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
smiley92
Senior Member
Join Date: Jun 2011
Location: Romania
Old 12-23-2016 , 08:48   To not respawn at first join.
Reply With Quote #1

Is some command to put in server.cfg or plugin created by someone to not respawn player at first team join when he connects to the server?
For example I`m connect to server and after I select team server put me to player, but is not very good that for me because when I`m respawn some players who play can be almost me and I didn't have time neither to buy a gun.
I want to put players spectate if round is started for some time or to not spawn and join me if that round is not be done.
smiley92 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-23-2016 , 09:18   Re: To not respawn at first join.
Reply With Quote #2

No such command.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
smiley92
Senior Member
Join Date: Jun 2011
Location: Romania
Old 12-23-2016 , 09:34   Re: To not respawn at first join.
Reply With Quote #3

But some plugin maybe isn't or someone to make it?
smiley92 is offline
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 12-23-2016 , 10:53   Re: To not respawn at first join.
Reply With Quote #4

Code:
#include < amxmodx >  
#include < hamsandwich >  

// how many seconds after round start are players allowed to spawn  
#define ALLOWED_SPAWN_SECONDS 1.0 

new Float:g_fRoundStart;  
new bool:g_bFreezeTime; 

public plugin_init( ) {  
    register_plugin( "Anti-LateSpawn", "0.0.1", "Exolent" );  
     
    register_event( "HLTV", "EventHLTV", "a", "1=0", "2=0" ); 
    register_logevent( "EventRoundStart", 2, "1=Round_Start" );  
     
    RegisterHam( Ham_Spawn, "player", "FwdPlayerSpawnPost", 1 );  
}  

public EventHLTV( ) { 
    g_bFreezeTime = true; 
} 

public EventRoundStart( ) {  
    g_bFreezeTime = false; 
     
    g_fRoundStart = get_gametime( );  
}  

public FwdPlayerSpawnPost( iPlayer ) {  
    if( !g_bFreezeTime 
    && is_user_alive( iPlayer )  
    && get_gametime( ) > ( g_fRoundStart + ALLOWED_SPAWN_SECONDS ) ) {  
        user_silentkill( iPlayer );  
         
        client_print( iPlayer, print_chat, "You spawned too late into the round." );  
    }  
}
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.

Last edited by ironskillz1; 12-23-2016 at 10:54.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
smiley92
Senior Member
Join Date: Jun 2011
Location: Romania
Old 12-24-2016 , 08:25   Re: To not respawn at first join.
Reply With Quote #5

Thank you ironskillz1, I test plugin you gave me but slay all players at first round...Isn't work properly.

I found something better created by ConnorMcLeod and that have some problems if can someone to repair it when I'm join to some team I can't see that camera or how to say it.Is about when I join to server to can see players "Free Chase Cam", "First Person" etc at first round.

Code:
/*    Formatright © 2009, ConnorMcLeod

    Anti Late Join is free software;
    you can redistribute it and/or modify it under the terms of the
    GNU General Public License as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Anti Late Join; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
*/

#include <amxmodx>
#include <hamsandwich>

new const VERSION[] = "0.0.2"

const MAX_PLAYERS = 32

new g_bFirstSpawn
#define SetUserFirstSpawn(%1)        g_bFirstSpawn |= 1<<(%1 & 31)
#define ClearUserFirstSpawn(%1)    g_bFirstSpawn &= ~( 1<<(%1 & 31) )
#define IsUserFirstSpawn(%1)        g_bFirstSpawn &  1<<(%1 & 31)

new g_pCvarMaxSpawnTime, g_pCvarBuyTime
new Float:g_fBuyTime, Float:g_fMaxSpawnGameTime

public plugin_init()
{
    register_plugin("Anti Late Join", VERSION, "ConnorMcLeod")

    g_pCvarMaxSpawnTime = register_cvar("amx_max_spawn_time", "15")
    g_pCvarBuyTime = get_cvar_pointer("mp_buytime")

    RegisterHam(Ham_Spawn, "player", "Player_Spawn_Pre")

    register_event("HLTV", "Event_HLTV_New_Round", "a", "1=0", "2=0")
    register_logevent("LogEvent_Round_Start", 2, "1=Round_Start")
}

public client_connect(id)
{
    ClearUserFirstSpawn(id)
}

public client_putinserver(id)
{
    SetUserFirstSpawn(id)
}

public Event_HLTV_New_Round()
{
    g_fMaxSpawnGameTime = 0.0
    g_fBuyTime = get_pcvar_float(g_pCvarBuyTime)
}

public LogEvent_Round_Start()
{
    new Float:fSpawnTimeDelay = get_pcvar_float(g_pCvarMaxSpawnTime)

    switch( fSpawnTimeDelay )
    {
        case -1.0:
        {
            g_fMaxSpawnGameTime = get_gametime() + g_fBuyTime * 60.0
        }
        case 0.0:
        {
            g_fMaxSpawnGameTime = 0.0
        }
        default:
        {
            if( fSpawnTimeDelay > 0.0 )
            {
                g_fMaxSpawnGameTime = get_gametime() + fSpawnTimeDelay
            }
            else
            {
                set_pcvar_float(g_pCvarMaxSpawnTime, 0.0)
                g_fMaxSpawnGameTime = 0.0
            }
        }
    }
}

public Player_Spawn_Pre(id)
{
    if( IsUserFirstSpawn(id) )
    {
        ClearUserFirstSpawn(id)

        if( g_fMaxSpawnGameTime && g_fMaxSpawnGameTime < get_gametime() )
        {
            return HAM_SUPERCEDE
        }
    }
    return HAM_IGNORED
}
smiley92 is offline
Reply



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 13:40.


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