Raised This Month: $ Target: $400
 0% 

Enable/Disable


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 04-29-2012 , 10:59   Re: Enable/Disable
Reply With Quote #5

Something like this... You don't even need a variable.

PHP Code:
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "hud"
#define VERSION "1.0"
#define AUTHOR "good."
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /show_hud","cmd_showhud")
    
register_clcmd("say /hide_hud","cmd_hidehud")
    
    
set_task(1.0"ShowHud",123,.flags "b")
}
public 
cmd_showhud(id)
{
    if(
task_exists(123)) return
    
set_task(1.0"ShowHud",123,.flags "b")
}
public 
cmd_hidehud(id)
{
    if(!
task_exists(123)) return
    
remove_task(123)
}
public 
ShowHud()
{
    new 
currmap[31], NextMap[32];
    
get_mapname(currmap30)
    
get_cvar_string"amx_nextmap" NextMap 31 );
    
set_hudmessage(025500.010.2506.01.0)
    new 
iTimeLeft get_timeleft();
    if(
get_cvar_num("mp_timelimit") == 0)
    {
        
show_hudmessage(0"Server: %s^nTrenutna mapa: %s^nSledeca mapa: %s^nMapa se menja nakon ove runde!",get_cvar_pointer("hostname"), currmapNextMap)
    }
    else
    {
        
show_hudmessage(0"Server: %s^nTrenutna mapa: %s^nSledeca mapa: %s^nVreme do sledece mape: %d:%d",get_cvar_pointer("hostname"), currmapNextMapiTimeLeft 60iTimeLeft 60)
    }

__________________
<VeCo> is offline
 



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 07:46.


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