Raised This Month: $51 Target: $400
 12% 

Block Spray sound


Post New Thread Reply   
 
Thread Tools Display Modes
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 02-06-2012 , 14:53   Re: Block Spray sound
Reply With Quote #11

hmmmmmmmm

*ou yea, you can override "sm_spray_hear" to another admin flag. Default is b(generic)


PHP Code:
#include <sdktools>

public OnPluginStart()
{
    
AddNormalSoundHook(SprayHook);
}



public 
Action:SprayHook(clients[64], &numClientsString:sample[PLATFORM_MAX_PATH], &entity, &channel, &Float:volume, &level, &pitch, &flags)
{
    if(
StrEqual(sample"player/sprayer.wav")) // Is spray sound
    
{
        new 
client// temporary pick player index here
        
new numplayer// Count players again

        
for(new 0numClientsi++) // Loop client array
        
{
            
client clients[i]; // pick player index temporary
            
if(CheckCommandAccess(client"sm_spray_hear"ADMFLAG_GENERIC))
            {
                
clients[numplayer] = client// Add player again in array top
                
numplayer++; // Count
            
}
        }

        if(
numplayer 0// There list players
        
{
            
numClients numplayer// Set new player count
            
return Plugin_Changed;
        }
        else 
// No players in list, block sound from everyone
        
{
            return 
Plugin_Handled;
        }
    }

    return 
Plugin_Continue;


Last edited by Bacardi; 02-06-2012 at 15:13. Reason: confusing
Bacardi is offline
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 02-06-2012 , 15:52   Re: Block Spray sound
Reply With Quote #12

Perfect. Thanks.

Last edited by Debesėlis; 02-06-2012 at 16:25.
Debesėlis is offline
Abb4ertW
BANNED
Join Date: Feb 2012
Old 02-07-2012 , 04:05   Re: Block Spray sound
Reply With Quote #13

bump to first page..

Last edited by Abb4ertW; 02-07-2012 at 04:10.
Abb4ertW is offline
Reply



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 18:39.


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