Raised This Month: $ Target: $400
 0% 

Say Sounds (including Hybrid Edition) (4.0.8)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
omgiafs
Junior Member
Join Date: Jul 2008
Location: Russia
Old 02-02-2009 , 09:48   Re: Say Sounds (including Hybrid Edition) (3.1.0)
Reply With Quote #11

I found method to play sound at teamplay_round_end . In this plugin -
http://forums.alliedmods.net/showthread.php?p=694273

Just hook teamplay_round_win and play sound for every real player.

PHP Code:
new Handle:cvarSoundName;
new 
String:soundFileName[MAX_FILE_LEN];

public 
OnPluginStart()
{
     
cvarSoundName CreateConVar("sm_end_sound""endmusic/endround7.mp3""The sound to play at the end of map");
     
GetConVarString(cvarSoundNamesoundFileNameMAX_FILE_LEN);
     
HookEvent("teamplay_round_win"EndEvent);
}


public 
EndEvent(Handle:event,const String:name[],bool:dontBroadcast)
{
               for(new 
1<= GetMaxClients(); i++)
               if(!
IsFakeClient(i))
           {
                    
decl String:buffer[255];
            
Format(buffersizeof(buffer), "play %s", (soundFileName), SNDLEVEL_GUNFIRE);
                
ClientCommand((i), buffer);
               }
        
}

public 
OnEventShutdown()
{
    
UnhookEvent("teamplay_round_win"EndEvent);

Code is bad, but it works! On ctf_turbine after last intel arrived on your base it play your sound without default sound, just what you need.

Please use this method in your plugin.

How ancients says, all the great things are simple !!!

Just PLAY command. Awesome.

Last edited by omgiafs; 02-02-2009 at 09:54.
omgiafs is offline
Send a message via ICQ to omgiafs Send a message via Skype™ to omgiafs
 



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 22:04.


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