Raised This Month: $ Target: $400
 0% 

[SOLVED][HOW]to adding sound


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sabrioz
Senior Member
Join Date: Apr 2009
Old 08-31-2009 , 02:05   [SOLVED][HOW]to adding sound
Reply With Quote #1

hello all

i find this script by bugsy..i have try to adding the sound (20seconds remain) but it failed..
here i attach the original script by bugsy

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

#define PLUGIN "Round End Explode"
#define VERSION "1.0"
#define AUTHOR "bugsy"

new g_SyncHud;
new 
g_RoundEnded;

//round-time
new Float:g_newround_time
new Float:g_roundstart_time
new Float:g_bombplanted_time
new Float:g_freezetime
new Float:g_roundtime
new Float:g_c4timer
new g_playtime 1
new pcvar_roundtime
new pcvar_freezetime
new pcvar_c4timer

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_logevent("evRoundEnd"2"1=Round_End"
    
register_logevent("evRoundStart"2"1=Round_Start")  
    
    
//round-time
    
register_event("TextMsg""eRestart""a""2&#Game_C""2&#Game_w")
    
register_event("HLTV""eNewRound""a""1=0""2=0")
    
register_event("SendAudio","eSendAudio","a","2=%!MRAD_BOMBPL")
    
pcvar_roundtime get_cvar_pointer("mp_roundtime")
    
pcvar_freezetime get_cvar_pointer("mp_freezetime")
    
pcvar_c4timer get_cvar_pointer("mp_c4timer")
    
    
set_task0.9 "CountDown" _,_,"b");
    
    
g_SyncHud CreateHudSyncObj();
}

public 
CountDown()
{
    static 
iTimeLeft;
    
    
iTimeLeft get_remaining_seconds();
    
    if( (
iTimeLeft 25) || (iTimeLeft 0) )
        return 
PLUGIN_HANDLED;
    
    
set_hudmessage(255,255,255, -1.0, -1.016.05.0 0.5 0.5);
    
    if( 
19 <= iTimeLeft <= 21)
        
ShowSyncHudMsg(0g_SyncHud"20 seconds left in round!")
    
    else if( (
iTimeLeft <= 10) && !g_RoundEnded )
        
ShowSyncHudMsg(0g_SyncHud"%d seconds left in round!"iTimeLeft )
    
    return 
PLUGIN_HANDLED;
}

public 
get_remaining_seconds() 
{
    switch(
g_playtime)
    {
        case 
0: return 0
        
case 1: return floatround( ( get_gametime() - g_newround_time ) - g_freezetime floatround_ceil )
        case 
2: return floatroundg_roundtime - ( get_gametime() - g_roundstart_time ) , floatround_ceil )
        case 
3: return floatroundg_c4timer - ( get_gametime() - g_bombplanted_time ) , floatround_ceil )
    }
    return 
0
}

public 
eRestart()
{
    
g_playtime 0;
}

public 
eNewRound() 
{
    
g_playtime 1

    
new Float:freezetime get_pcvar_float(pcvar_freezetime)
    if(
freezetime)
    {
        
g_newround_time get_gametime()
        
g_freezetime freezetime
    
}
    
g_c4timer get_pcvar_float(pcvar_c4timer)
    
g_roundtime floatmul(get_pcvar_float(pcvar_roundtime), 60.0) - 1.0
}

public 
evRoundStart()
{
    
g_RoundEnded 0;
    
g_playtime 2

    g_roundstart_time 
get_gametime()
}

public 
eSendAudio() 
{
    
g_playtime 3

    g_bombplanted_time 
get_gametime()
}

public 
evRoundEnd()
{
    new 
iPlayers[32];
    new 
iPlayersNum;
    
    
get_playersiPlayersiPlayersNum"a");
    
g_playtime 0;
    
g_RoundEnded 1;    

hope someone can help me

Last edited by sabrioz; 01-17-2010 at 03:25. Reason: Problem solved
sabrioz is offline
hzqst
Senior Member
Join Date: Jul 2008
Old 08-31-2009 , 07:48   Re: [HOW]to adding sound
Reply With Quote #2

PHP Code:
engfunc(EngFunc_EmitSoundindexchannelsoundVOL_NORMATTN_NORM0PITCH_NORM
hzqst is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 08-31-2009 , 08:43   Re: [HOW]to adding sound
Reply With Quote #3

Just add this, where it show the text with "20 seconds left..." ->
PHP Code:
client_cmd(0"spk ^"vox/twenty seconds remaining^""); 
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
sabrioz
Senior Member
Join Date: Apr 2009
Old 09-01-2009 , 04:07   Re: [HOW]to adding sound
Reply With Quote #4

ok thanks all..
thanks for the script
now its working..
sabrioz is offline
Reply


Thread Tools
Display Modes

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 15:03.


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