AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   countdown sound. (https://forums.alliedmods.net/showthread.php?t=95147)

One 06-20-2009 07:32

countdown sound.
 
hi,

im writig my first plugin :D yea no mod anymore & i have a mini problem.

i catch the freetime & give a countdown on screen.
so i want now to add the sounds. but the freezetime can be changed. how can i know howmany sounds schould be played?

PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <screenfade_util>

new time_s

public plugin_init() 
{
    
register_plugin("Freezetime Countdown""1.0""One")
    
register_event("HLTV""event_round_start""a""1=0""2=0")
}
public 
event_round_start()
{
    
set_task(1.0"Start_countdown")
    new 
freezetime get_cvar_num("mp_freezetime")
    
time_s freezetime 2
}
public 
Start_countdown(id)

    
set_hudmessage(17900, -1.00.2820.021.00.010.110); 
    
show_hudmessage(0"New round begin in %i!!"time_s); 
    
UTIL_ScreenFade(id,{255,0,0},1.0,0.0,200)
    --
time_s;
    
    if(
time_s >= 0)
    {
        
set_task(1.0"Start_countdown")
    }  
    if(
time_s == 0)
    {
        
set_task(1.0"Start_countdown1")
    }  
}  
public 
Start_countdown1(id)
{
    
set_hudmessage(255255255, -1.00.2820.021.00.010.110); 
    
show_hudmessage(0"Go"time_s);
    
UTIL_ScreenFade(id,{0,255,0},1.0,0.0,200)


i thinked with case but i dont think that its a good idea. any ideas?

One 06-20-2009 10:38

Re: countdown sound.
 
ok i got it. but how can i add a cvar for fade color?

i tried so :

new g_freezefade

g_freezefade = register_cvar("amx_freezecolor", "255,0,0")

UTIL_ScreenFade(id,{get_pcvar_num(freezefade) },1.0,0.0,200)

any ideas?

TitANious 06-20-2009 13:56

Re: countdown sound.
 
First plugin? :o

One 06-20-2009 14:07

Re: countdown sound.
 
yop. first plugin that i release. i worked only on mods. for me is there a big diffrent between plug-in & mod. so /topic.

i couldnt fix this :(


All times are GMT -4. The time now is 15:37.

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