Code:
#include <amxmodx>
#define PLUGIN "Nextmap Countdown"
#define VERSION "1.0"
#define AUTHOR "u"
new hudsync, g_nextMap[32]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar("amx_countdown", "30")
hudsync = CreateHudSyncObj()
}
getNextMapName(szArg[], iMax)
{
new len = get_cvar_string("amx_nextmap", szArg, iMax)
if (is_map_valid(szArg)) return len
len = copy(szArg, iMax, g_nextMap)
set_cvar_string("amx_nextmap", g_nextMap)
return len
}
public client_PreThink(id)
{
if(!is_user_connected(id))
return PLUGIN_CONTINUE
if(!get_cvar_float("mp_timelimit"))
return PLUGIN_CONTINUE
new timeleft = (get_timeleft() + 1)
if(timeleft <= get_cvar_num("amx_countdown"))
{
new name[32]
getNextMapName(name, 31)
new mapname[32]
get_mapname(mapname, 31)
set_hudmessage(50, 255, 50, 0.05, 0.50, 0, 0.1, 0.1, 0.1, 2.0, -1)
ShowSyncHudMsg(0, hudsync, "%s is gonna finish after %d sec, nextmap will be %s.", mapname, timeleft, name)
}
return PLUGIN_CONTINUE
}
__________________
You can be a SUPER coder but you Haven't to say such as "stupid, etc." words to the others