Raised This Month: $ Target: $400
 0% 

The plugin doesnt show the hud msg


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
GarbageBox
Senior Member
Join Date: Feb 2010
Old 06-23-2011 , 05:41   The plugin doesnt show the hud msg
Reply With Quote #1

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
GarbageBox is offline
 


Thread Tools
Display Modes

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 23:32.


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