Raised This Month: $ Target: $400
 0% 

10 Sec and break.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 10-09-2010 , 12:00   Re: 10 Sec and break.
Reply With Quote #8

Try this:

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <engine>
#include <fakemeta>

#define PLUGIN "Countdown - Glass"
#define VERSION "1.0"
#define AUTHOR "Xalus"

#define ACCESS ADMIN_KICK

new cCountdown;
new 
Float:g_fStartTime;

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
/* Cvar */
    
cCountdown     register_cvar("countdown_status""10");
    
    
/* Say Commands */
    
register_clcmd("say /countdown""Handler");
    
register_clcmd("say countdown""Handler");
}
/*
CountDown Glass:
    - Handler
*/
public Handler(id) {
    if(
get_user_flags(id) & ACCESS) {
        
g_fStartTime get_gametime()
        
StartCountdown()    
    }
}
/*
CountDown Glass:
    - CountDown
*/
public StartCountdown() {
    new 
Float:fRemainingTime = (get_gametime() - g_fStartTime)
    
    if(
get_pcvar_float(cCountdown) <= fRemainingTime) {
        
client_cmd("spk radio/com_go")
        new 
ent 0
        
while((ent find_ent_by_class(ent,"func_breakable")) != 0) {
            new 
target[32]; pev(entpev_targetnametarget31); 
            if(
equal(target"breakable")) {
                
ExecuteHamBHam_TakeDamageent009999.0DMG_GENERIC )
            }
        }
    } else {
        new 
Time floatround(get_pcvar_float(cCountdown) - fRemainingTime)
        new 
szTime[32]
        
        
num_to_word(TimeszTime31)
        
        if(
Time <= 10)
            if(
Time)
                
client_cmd(0,"speak ^"vox/%s^""szTime)
                
        
set_hudmessage(random(255), random(255), random(255), -1.00.0506.01.00.00.0, -2);
        
show_hudmessage(0"[Glass Break in: %d Seconds]"Time)
        
// timer
        
set_task(1.0"StartCountdown")
    }
    
    return 
PLUGIN_CONTINUE;

__________________
Retired.

Last edited by Xalus; 10-09-2010 at 12:40.
Xalus 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 10:23.


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