Raised This Month: $ Target: $400
 0% 

[REQ CSGO] Reloading with voice sound


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wyd3x
Senior Member
Join Date: Sep 2012
Old 12-18-2014 , 04:05   Re: [REQ CSGO] Reloading with voice sound
Reply With Quote #1

try it:
PHP Code:
#include <sourcemod>
#include <sdktools>

new const String:FULL_SOUND_PATH[] = "sound/custom/reload.mp3";
new const 
String:RELATIVE_SOUND_PATH[] = "*custom/reload.mp3";

public 
OnPluginStart() {
    
HookEvent("weapon_reload"Event_weapon_reload);
}
public 
OnMapStart()
{
    
AddFileToDownloadsTableFULL_SOUND_PATH );
    
FakePrecacheSoundRELATIVE_SOUND_PATH );
}
public 
Action:Event_weapon_reload(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
String:name1[64];
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    new 
client_team GetClientTeam(client);
    
    for(new 
1<= MAXPLAYERSi++)
    {
        if (
IsClientConnected(i) && !IsFakeClient(i))
        {
            if (
GetClientTeam(i) == client_team)
            {
                
GetClientName(clientname1sizeof(name1));
                
PrintToChat(i"%s is reloading"name1);
                
EmitSoundToClient(client,RELATIVE_SOUND_PATH);
            }
        }
    }    
}
stock FakePrecacheSound( const String:szPath[] )
{
    
AddToStringTableFindStringTable"soundprecache" ), szPath );

__________________
my plugins:
deleter v2.1 || [Store] Chat Color (1.2) - csgo || [Store] Award winner team
need a private plugin?
contact with me: PM, EMAIL: [email protected], discord: wyd3x #2096
private plugins: Hunger Games, [Store] Lottery, [Store] Gamble, VIP
wyd3x 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 05:18.


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