Raised This Month: $ Target: $400
 0% 

Countdown timer..


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-09-2008 , 09:34   Re: Countdown timer..
Reply With Quote #14

Yes, but default (when you don't pass a param, channel is set to 4, see amxmodx.inc).

PHP Code:
#include <amxmodx>
#include <amxmisc>

new const PLUGIN_NAME[] = "timer test"

#define TASKID1    164837516

new g_iCounter
new g_HudSyncObj

public plugin_init()
{
    
register_plugin(PLUGIN_NAME"1.0""you")
    
register_clcmd("say /timer""cmdTimer"ADMIN_RCON"starts timer")
}

public 
plugin_cfg()
{
    
g_HudSyncObj CreateHudSyncObj()
}

public 
cmdTimer(idlevelcid)
{
    if( ! 
cmd_access(idlevelcid1) )
    {
        
client_print(idprint_console"Pay for server access :D")
        return 
PLUGIN_HANDLED
    
}

    if(
task_exists(TASKID1))
    {
        
remove_task(TASKID1)
    }

    
g_iCounter 10

    set_task
(1.0"count_down"TASKID1__"b")
    return 
PLUGIN_HANDLED
}
 
public 
count_down(id)
{
    if(!
g_iCounter)
     {
         
client_cmd("spk radio/com_go")
         
client_print(0print_chat"[%s] Go Go Go!"PLUGIN_NAME)
         
remove_task(TASKID1)
         return
     }

    
set_hudmessage(255255255, -1.00.8506.01.0__, -1)
    
ShowSyncHudMsg(0g_HudSyncObj"(%d:%02d)"g_iCounter/60g_iCounter%60)

    static 
szNum[32]
    
num_to_word(g_iCounterszNum31)
    
client_cmd(0,"speak ^"vox/%s^""szNum)

    
g_iCounter--

__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 23:52.


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