Ugh, fixed Linux build for real by removing stray underscores.
3 * =============================================================================
4 * SourceMod Sound Commands Plugin
5 * Implements basic sound commands.
7 * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
8 * =============================================================================
10 * This program is free software; you can redistribute it and/or modify it under
11 * the terms of the GNU General Public License, version 3.0, as published by the
12 * Free Software Foundation.
14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
19 * You should have received a copy of the GNU General Public License along with
20 * this program. If not, see <http://www.gnu.org/licenses/>.
22 * As a special exception, AlliedModders LLC gives you permission to link the
23 * code of this program (as well as its derivative works) to "Half-Life 2," the
24 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
25 * by the Valve Corporation. You must obey the GNU General Public License in
26 * all respects for all other code used. Additionally, AlliedModders LLC grants
27 * this exception to all derivative works. AlliedModders LLC defines further
28 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
29 * or <http://www.sourcemod.net/license.php>.
38 public Plugin:myinfo =
40 name = "Sound Commands",
41 author = "AlliedModders LLC",
42 description = "Sound Commands",
43 version = SOURCEMOD_VERSION,
44 url = "http://www.sourcemod.net/"
47 public OnPluginStart( )
49 LoadTranslations("common.phrases");
50 LoadTranslations("sounds.phrases");
52 RegAdminCmd("sm_play", Command_Play, ADMFLAG_GENERIC, "sm_play <#userid|name> <filename>");
55 public Action:Command_Play(client, args)
59 ReplyToCommand(client, "[SM] Usage: sm_play <#userid|name> <filename>");
60 return Plugin_Handled;
63 new String:Arguments[PLATFORM_MAX_PATH + 65];
64 GetCmdArgString(Arguments, sizeof(Arguments));
67 new len = BreakString(Arguments, Arg, sizeof(Arg));
69 /* Make sure it does not go out of bound by doing "sm_play user "*/
72 ReplyToCommand(client, "[SM] Usage: sm_play <#userid|name> <filename>");
73 return Plugin_Handled;
76 /* Incase they put quotes and white spaces after the quotes */
77 if (Arguments[len] == '"')
80 new FileLen = TrimString(Arguments[len]) + len;
82 if (Arguments[FileLen - 1] == '"')
84 Arguments[FileLen - 1] = '\0';
88 decl String:target_name[MAX_TARGET_LENGTH];
89 decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml;
91 if ((target_count = ProcessTargetString(
96 COMMAND_FILTER_NO_BOTS,
101 ReplyToTargetError(client, target_count);
102 return Plugin_Handled;
105 for (new i = 0; i < target_count; i++)
107 ClientCommand(target_list[i], "playgamesound \"%s\"", Arguments[len]);
108 LogAction(client, target_list[i], "\"%L\" played sound on \"%L\" (file \"%s\")", client, target_list[i], Arguments[len]);
113 ShowActivity2(client, "[SM] ", "%t", "Played sound to target", target_name);
117 ShowActivity2(client, "[SM] ", "%t", "Played sound to target", "_s", target_name);
120 return Plugin_Handled;