Raised This Month: $ Target: $400
 0% 

Play MP3 to victims teammates only


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 05-15-2010 , 13:15   Re: Play MP3 to victims teammates only
Reply With Quote #7

Quote:
Originally Posted by Voi View Post
untested, but this should work like you want it:
<code>
No.

Code:
#include <amxmodx> #include <cstrike> new mp3list[][] = {     "file1.mp3",     "file2.mp3",     "file3.mp3",     "file4.mp3" } new bool:b_Allow[33] public plugin_init() {     register_plugin( "Sounds", "1.1", "Wrecked" )         register_logevent( "LogEventRoundEnd", 2, "1=Round_End" )     register_event( "DeathMsg", "EventDeathMsg", "a" )         register_clcmd( "say /allowmusic", "CmdSwitchAllow" )     register_clcmd( "say_team /allowmusic", "CmdSwitchAllow" ) } public client_connect( id ) {     b_Allow[id] = true } public CmdSwitchAllow( id ) {     b_Allow[id] = b_Allow[id] ? false : true         client_print( id, print_chat, "Death Sounds Enabled: %s", b_Allow[id] ? "Enabled" : "Disabled" )         return PLUGIN_HANDLED; } public LogEventRoundEnd() {     client_cmd( 0, "mp3 stop" ) } public EventDeathMsg() {     new victim = read_data( 2 )     new CsTeams:victeam = cs_get_user_team( victim )         new iPlayers[32]     new iNum         get_players( iPlayers, iNum )         new id         new rnum = random( sizeof mp3list )         for( new i = 0; i < iNum; i++ )     {         id = iPlayers[i]                 if( is_user_alive( id ) && ( id != victim ) && b_Allow[id] && ( victeam == cs_get_user_team( id ) ) )         {             client_cmd( id, "mp3 play %s", mp3list[rnum] )         }     } }

This one won't play the sound to the victim. You said you only wanted it to the victim's team. If you'd like it to play to the victim as well, just let me know.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT

Last edited by wrecked_; 05-15-2010 at 14:00.
wrecked_ 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 03:49.


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