I need for Deathrun block spawn after some seconds when round allready started.. i tested this Plugin, but dont work correct. Anyone can help me with another Plugin? Please without orpheu!
Код
/* 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"
#define SetUserSpawned(%1) g_bSpawnedOnce |= 1<<(%1 & 31)
#define ResetUserSpawn(%1) g_bSpawnedOnce &= ~( 1<<(%1 & 31) )
#define HasUserSpawnedOnce(%1) ( g_bSpawnedOnce & 1<<(%1 & 31) )
new g_bSpawnedOnce
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 Event_HLTV_New_Round()
{
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 client_connect(id)
{
ResetUserSpawn(id)
}
public Player_Spawn_Pre(id)
{
if( HasUserSpawnedOnce( id ) == 0 )
{
SetUserSpawned( id )
return HAM_IGNORED
}
if( g_fMaxSpawnGameTime && g_fMaxSpawnGameTime < get_gametime() )
{
return HAM_SUPERCEDE
}
return HAM_IGNORED
}