Raised This Month: $ Target: $400
 0% 

[ZP] Countdown


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Watermelonnable
Member
Join Date: Feb 2017
Old 12-10-2019 , 07:47   Re: [ZP] Countdown
Reply With Quote #6

I improved the code based on OciXCrom comment. It compiled fine but I didn't test it.

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

#define PLUGIN "Plugin Name"
#define VERSION "1.0"
#define AUTHOR "Plugin Author"

new g_CurrentSecond;

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_event("HLTV""event_round_start""a""1=0""2=0");
    
g_CurrentSecond 10;
}

public 
plugin_precache() 
{
    new 
precacheString[32];

    for (new 
011i++) {
        
formatex(precacheStringcharsmax(precacheString), "zombie_plague/%d.wav"i);
        
precache_sound(precacheString);
    }
}

public 
event_round_start() 
{
    
set_task(5.0"Countdown");
}

public 
Countdown() 
{
    
set_task(1.0"RealCountdown"0""0"a"11);
}

public 
RealCountdown()
{
    new 
hudMessage[32];
    new 
playSoundString[32];
    
formatex(hudMessagecharsmax(hudMessage), "-= %d =-^n[**********]"g_CurrentSecond);
    
formatex(playSoundStringcharsmax(playSoundString), "spk zombie_plague/%d"g_CurrentSecond);
    
set_hudmessage(0180255, -1.00.2820.021.00.010.110);
    
show_hudmessage(0hudMessage);
    
client_cmd(0playSoundString);
    
g_CurrentSecond--;


Last edited by Watermelonnable; 12-10-2019 at 07:48.
Watermelonnable 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 18:03.


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