This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

C4 timer and Sound


Post New Thread Reply   
 
Thread Tools Display Modes
P1raten
Senior Member
Join Date: Feb 2010
Old 12-01-2012 , 15:13   Re: C4 timer and Sound
Reply With Quote #21

You should change this:
PHP Code:
public bomb_planted(planter
{
    new 
Name[32]
    new 
id task_sound

    
if(get_pcvar_num(g_Cvar))
    {
        
get_user_name(planterName31)  
        
        new 
time get_pcvar_num(g_C4)
        
        
float(time)
        
set_task( (time 10.0) , "Zero"task_sound+id)
        
set_task( (time 9.0) , "one"task_sound+id)
        
set_task( (time 8.0) , "two"task_sound+id)
        
set_task( (time 7.0) , "three"task_sound+id)
        
set_task( (time 6.0) , "foor"task_sound+id)
        
set_task( (time 5.0) , "five"task_sound+id)
        
set_task( (time 4.0) , "six"task_sound+id)
        
set_task( (time 3.0) , "seven"task_sound+id)
        
set_task( (time 2.0) , "eigth"task_sound+id)
        
set_task( (time 1.0) , "nine"task_sound+id)
    }
    return 
PLUGIN_CONTINUE  
}

public 
Zero()  
{
    
client_cmd(0"spk C4Female/ten.wav" )  
    return 
PLUGIN_CONTINUE  
}

public 
one()  
{
    
client_cmd(0"spk C4Female/nine.wav" )  
    return 
PLUGIN_CONTINUE  
}

public 
two()  
{
    
client_cmd(0"spk C4Female/eight.wav")  
    return 
PLUGIN_CONTINUE  
}

public 
three()  
{
    
client_cmd(0"spk C4Female/seven.wav")  
    return 
PLUGIN_CONTINUE  
}

public 
foor()  

    
client_cmd(0"spk C4Female/six.wav"  )  
    return 
PLUGIN_CONTINUE  
}

public 
five()  
{
    
client_cmd(0"spk C4Female/five.wav" )  
    return 
PLUGIN_CONTINUE  
}

public 
six()  
{
    
client_cmd(0"spk C4Female/four.wav" )  
    return 
PLUGIN_CONTINUE  
}

public 
seven()  
{
    
client_cmd(0"spk C4Female/three.wav")  
    return 
PLUGIN_CONTINUE  
}

public 
eigth()  
{
    
client_cmd(0"spk C4Female/two.wav"  )  
    return 
PLUGIN_CONTINUE  
}

public 
nine()  
{
    
client_cmd(0"spk C4Female/one.wav")  
    return 
PLUGIN_CONTINUE  
}

public 
RoundEnd()
{
    new 
id task_sound
    remove_task
(task_sound+id)

To something like this:

PHP Code:
public bomb_planted(planter
{
    new 
Name[32]
    new 
id task_sound

    
if(get_pcvar_num(g_Cvar))
    {
        
get_user_name(planterName31)  
        
        new 
time get_pcvar_num(g_C4)
        
        
set_time(1.0"count_down")
    }
    return 
PLUGIN_CONTINUE  
}

public 
count_down()
{    
    new 
speak[0][] = { "C4Female/one.wav""C4Female/two.wav""C4Female/three.wav""C4Female/four.wav""C4Female/five.wav""C4Female/six.wav""C4Female/seven.wav""C4Female/eight.wav""C4Female/nine.wav""C4Female/ten.wav" }

    
emit_sound0CHAN_VOICEspeak[countdown], 1.0ATTN_NORM0PITCH_NORM )
    
countdown--
    
    --
time_s;
        
    if(
time_s >= 1)
    {
        
set_task(1.0"count_down")
    }

__________________
No salvation. Only madness.
P1raten is offline
kwpd
AlliedModders Donor
Join Date: Mar 2009
Location: panama
Old 12-02-2012 , 22:04   Re: C4 timer and Sound
Reply With Quote #22

Quote:
Originally Posted by P1raten View Post
You should change this:]
ok I'll try the code.
__________________

Last edited by kwpd; 12-02-2012 at 23:17.
kwpd is offline
Old 12-02-2012, 23:17
kwpd
This message has been deleted by YamiKaitou. Reason: wait 14 days before you bump
P1raten
Senior Member
Join Date: Feb 2010
Old 12-03-2012 , 18:20   Re: C4 timer and Sound
Reply With Quote #23

Quote:
Originally Posted by kwpd View Post
ok I'll try the code.
Note that I used emit_sound instead of client_cmd.

I did this since emit_sound comes with more options on how to manipulate the audio.
__________________
No salvation. Only madness.
P1raten is offline
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 09:34.


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