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
}