Raised This Month: $ Target: $400
 0% 

Emit sound to specific team


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 04-22-2017 , 06:52   Re: Emit sound to specific team
Reply With Quote #2

Create a variable that will hold player's team, loop through all players and check if looped player's team isn't equal to the player who is reloading, if true use continue, else emit_sound with the variable that you looped.
Code:
new g_iMaxPlayers ; public plugin_init( ) {     g_iMaxPlayers = get_maxplayers( ) ; } public Event_OnReload ( const i_Ent ) {     static id; id = pev ( i_Ent, pev_owner );         new iTeam = get_user_team( id ) ;         if ( UTIL_IsWeaponReloading ( id, i_Ent ) )     {           for( new i = 1 ; i <= g_iMaxPlayers ; i++ ) {                         if( ! is_user_connected( i ) )             continue ;             if( iTeam != get_user_team( i ) )             continue ;                         emit_sound ( i, CHAN_AUTO, SoundList[ random_num( 0, sizeof SoundList - 1 ) ], 1.0, ATTN_NORM, 0, PITCH_NORM );         }     }         return PLUGIN_CONTINUE ; }
__________________

Last edited by edon1337; 04-22-2017 at 08:24.
edon1337 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 17:47.


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