Raised This Month: $ Target: $400
 0% 

Solved Prevent background sound from overlapping between rounds


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
chuttenjr
Member
Join Date: Sep 2018
Location: Saipan
Old 09-28-2018 , 08:28   Re: Prevent background sound from overlapping between rounds
Reply With Quote #9

Changed .wav file to .mp3,file plays on every round start overlapping itself

PHP Code:
#include <amxmodx>

new const lstSound[][] = { "misc/predatortheme.mp3" };

public 
plugin_init() 
{
register_plugin"Round Start Sound""1.0""AMXX Community" );
register_event"HLTV""event_new_round""a""1=0""2=0" );
register_event ("HLTV""EventRoundEnd","a","1")
}

public 
plugin_precache() 
{
new 
CurSnd[128];

copyCurSnd127lstSound[0] );
formatCurSnd127"sound/%s"CurSnd ); 

if ( 
equaliCurSnd[strlen(CurSnd)-4], "predatortheme.mp3" ) ) 
{
if ( 
file_existsCurSnd ) )
precache_genericCurSnd );
}
else 
{
if ( 
file_existsCurSnd ) )
precache_soundCurSnd[6] ); 
}
}

public 
event_new_round()
{
new 
CurSnd[128];

copyCurSnd127lstSound[0] );
formatCurSnd127"sound/%s"CurSnd ); 

if( 
equaliCurSnd[strlenCurSnd ) - ], "predatortheme.mp3" ) )
client_cmd0"mp3 play %s"CurSnd )
else
client_cmd0"spk %s"CurSnd[6] )

}
public 
EventRoundEnd()   
{  
client_cmd(0"mp3 stop");  


Last edited by chuttenjr; 09-28-2018 at 08:50. Reason: Finished testing
chuttenjr 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 06:54.


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