AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED][HOW]to adding sound (https://forums.alliedmods.net/showthread.php?t=102225)

sabrioz 08-31-2009 02:05

[SOLVED][HOW]to adding sound
 
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

hzqst 08-31-2009 07:48

Re: [HOW]to adding sound
 
PHP Code:

engfunc(EngFunc_EmitSoundindexchannelsoundVOL_NORMATTN_NORM0PITCH_NORM


Alka 08-31-2009 08:43

Re: [HOW]to adding sound
 
Just add this, where it show the text with "20 seconds left..." ->
PHP Code:

client_cmd(0"spk ^"vox/twenty seconds remaining^""); 


sabrioz 09-01-2009 04:07

Re: [HOW]to adding sound
 
ok thanks all..
thanks for the script
now its working..


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

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