View Single Post
NatalyaAF
Senior Member
Join Date: Dec 2008
Old 05-10-2015 , 10:22   Re: EmitSoundAny - Cross-game sound emitting (aka CS:GO compatible) (1.0.2, 2014-03-1
Reply With Quote #33

Hi, I am working with someone else's plugin, trying to make it use this include. Here's what I've got:

PHP Code:
#include <sourcemod>
#include <sdktools>
#include <sdktools_sound>
#include <emitsoundany>

#pragma semicolon 1
#define MAX_FILE_LEN 80
new Handle:g_CvarSoundName INVALID_HANDLE;
new 
String:g_soundName[MAX_FILE_LEN];

#define PLUGIN_VERSION "1.0"
public Plugin:myinfo 
{
    
name "CS:GO Sound",
    
author "Team-Secretforce.com",
    
description "Join Sound on your CS:GO Server",
    
version PLUGIN_VERSION,
    
url "http://www.Team-Secretforce.com/"
};
public 
OnPluginStart()
{
    
// Create the rest of the cvar's
CreateConVar("sm_welcome_snd_version"PLUGIN_VERSION"CS:GO Sound Version"FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
g_CvarSoundName CreateConVar("sm_start_sound""natalya/server/moon-join-server.mp3""Welcome sound");
}
public 
OnConfigsExecuted()
{
    
GetConVarString(g_CvarSoundNameg_soundNameMAX_FILE_LEN);
    
decl String:buffer[MAX_FILE_LEN];
    
PrecacheSound(g_soundNametrue);
    
Format(buffersizeof(buffer), "sound/%s"g_soundName);
    
AddFileToDownloadsTable(buffer);
}
public 
OnClientPostAdminCheck(client)
{
    
EmitSoundToClientAny(clientg_soundName);

I'm not hearing anything, am I using this right? Or maybe I should play it later when the client gets spawned and then have like a boolean that gets set to true on first spawn and when true it won't play anymore or something like that.
__________________
Talk to me on Steam: natalyaaf
See my website for downloads: www.lady-natalya.info

Natalya: killing someone while they make a plugin
Natalya: perfect analogy
Natalya: for the mayan apocalypse

Last edited by NatalyaAF; 05-10-2015 at 10:23.
NatalyaAF is offline