Raised This Month: $51 Target: $400
 12% 

speak plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hugz`
Veteran Member
Join Date: Jul 2007
Location: In a house
Old 11-06-2007 , 15:36   speak plugin
Reply With Quote #1

A plugin that will count down from 10 to 1
If it can go higher then 10 please make a cvar where you can change the number.. thanks
__________________
hugz` is offline
Send a message via AIM to hugz`
M249-M4A1
I <3 Mac
Join Date: May 2005
Location: Not interested
Old 11-06-2007 , 17:03   Re: speak plugin
Reply With Quote #2

This is an example countdown timer. Make modifications if you wish:

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

#define PLUGIN "Countdown Example"
#define VERSION "1.0"
#define AUTHOR "M249-M4A1"

new gTimethetimer
new number_as_word[32]

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
// the command to start the countdown
    
register_concmd("amx_countdown""initCountDown"0)
    
    
// stops the countdown
    
register_concmd("amx_abort_count""stopCountDown"0)
    
    
thetimer register_cvar("count_timer""10"// <--- 10 second countdown to 0
}

public 
initCountDown(id) {
    if (!
task_exists(92133)) {
        
gTime get_pcvar_num(thetimer)
        
client_print(idprint_chat"[AMXX] Countdown started - Counting from %i to 0..."gTime)
        
set_task(1.0"countdown"92133""0"b")
    }
    else
        
console_print(id"[AMXX] Countdown has not finished! Type amx_abort_count to stop the countdown.")
    return 
PLUGIN_HANDLED
}

public 
countdown() {
    
// this was the same design used in miscstats for the bomb counter
    
if (gTime 0) {
        
// convert the number to a work, to be used with the vox system
        
num_to_word(gTimenumber_as_word31)
        
client_cmd(0"spk ^"vox/%s^""number_as_word)
        
        
// decrement the timer manually
        
gTime--
    }
    else
        
// remove the countdown task, as it shouldve reached 0 by now
    
remove_task(92133)
}

public 
stopCountDown(id) {
    if (!
task_exists(92133)) {
        
console_print(id"[AMXX] There is no countdown!")
    }
    else
    {
        
console_print(id"[AMXX] Countdown has been terminated!")
        
remove_task(92133)
    }
    return 
PLUGIN_HANDLED

__________________
M249-M4A1 is offline
hugz`
Veteran Member
Join Date: Jul 2007
Location: In a house
Old 12-26-2007 , 10:48   Re: speak plugin
Reply With Quote #3

That does not work, I don't hear anything, can you also make it black out CT's screen like in HNS?
__________________
hugz` is offline
Send a message via AIM to hugz`
Reply



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 11:24.


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