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()
{
AddFileToDownloadsTable( FULL_SOUND_PATH );
FakePrecacheSound( RELATIVE_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 i = 1; i <= MAXPLAYERS; i++)
{
if (IsClientConnected(i) && !IsFakeClient(i))
{
if (GetClientTeam(i) == client_team)
{
GetClientName(client, name1, sizeof(name1));
PrintToChat(i, "%s is reloading", name1);
EmitSoundToClient(client,RELATIVE_SOUND_PATH);
}
}
}
}
stock FakePrecacheSound( const String:szPath[] )
{
AddToStringTable( FindStringTable( "soundprecache" ), szPath );
}
__________________