View Single Post
alphaearth
Senior Member
Join Date: Feb 2018
Location: Turkey
Old 02-17-2020 , 18:03   Re: [CS:GO] sound command
Reply With Quote #2

simple

Code:
#define PLUGIN_AUTHOR ""
#define PLUGIN_VERSION "1.0"
#include <sourcemod>
#include <emitsoundany>
#pragma newdecls required

public Plugin myinfo = 
{
	name = "sound music",
	author = PLUGIN_AUTHOR,
	description = "",
	version = PLUGIN_VERSION,
	url = ""
};

public void OnPluginStart()
{
	AddCommandListener(OnSayCmd, "say");
	AddCommandListener(OnSayCmd, "say_team");
	PrecacheSoundAny("musictest.mp3");
	AddFileToDownloadsTable("sound/musictest.mp3");
}

public Action OnSayCmd(int client, char[] command, int argc)
{
	char text[192];
	GetCmdArgString(text, sizeof(text));
	StripQuotes(text);
	TrimString(text);
	if(StrEqual(text, "musictest", true))
	{
		EmitSoundToClientAny(client, "musictest.mp3");
		PrintToChat(client, "Music Test.");
	}
	return Plugin_Continue;
}
__________________
alphaearth is offline