1.1 --- a/plugins/basefuncommands.sp Sun Oct 21 20:35:15 2007 +0000
1.2 +++ b/plugins/basefuncommands.sp Sun Oct 21 23:50:37 2007 +0000
1.3 @@ -58,6 +58,7 @@
1.4 public OnPluginStart()
1.5 {
1.6 LoadTranslations("common.phrases");
1.7 + LoadTranslations("basefuncommands.phrases");
1.8
1.9 RegAdminCmd("sm_burn", Command_Burn, ADMFLAG_SLAY, "sm_burn <#userid|name> [time]");
1.10 RegAdminCmd("sm_slap", Command_Slap, ADMFLAG_SLAY, "sm_slap <#userid|name> [damage]");
1.11 @@ -127,12 +128,6 @@
1.12 decl String:Arg[65];
1.13 new len = BreakString(Arguments, Arg, sizeof(Arg));
1.14
1.15 - new target = FindTarget(client, Arg);
1.16 - if (target == -1)
1.17 - {
1.18 - return Plugin_Handled;
1.19 - }
1.20 -
1.21 /* Make sure it does not go out of bound by doing "sm_play user "*/
1.22 if (len == -1)
1.23 {
1.24 @@ -151,13 +146,38 @@
1.25 Arguments[FileLen - 1] = '\0';
1.26 }
1.27 }
1.28 -
1.29 - GetClientName(target, Arg, sizeof(Arg));
1.30 - ShowActivity(client, "%t", "Played Sound", Arg);
1.31 - LogAction(client, target, "\"%L\" played sound on \"%L\" (file \"%s\")", client, target, Arguments[len]);
1.32 -
1.33 - ClientCommand(target, "playgamesound \"%s\"", Arguments[len]);
1.34 +
1.35 + decl String:target_name[MAX_TARGET_LENGTH];
1.36 + decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml;
1.37 +
1.38 + if ((target_count = ProcessTargetString(
1.39 + Arg,
1.40 + client,
1.41 + target_list,
1.42 + MAXPLAYERS,
1.43 + COMMAND_FILTER_NO_BOTS,
1.44 + target_name,
1.45 + sizeof(target_name),
1.46 + tn_is_ml)) <= 0)
1.47 + {
1.48 + ReplyToTargetError(client, target_count);
1.49 + return Plugin_Handled;
1.50 + }
1.51 +
1.52 + for (new i = 0; i < target_count; i++)
1.53 + {
1.54 + ClientCommand(target_list[i], "playgamesound \"%s\"", Arguments[len]);
1.55 + LogAction(client, target_list[i], "\"%L\" played sound on \"%L\" (file \"%s\")", client, target_list[i], Arguments[len]);
1.56 + }
1.57 +
1.58 + if (tn_is_ml)
1.59 + {
1.60 + ShowActivity2(client, "[SM] ", "%t", "Played sound to target", target_name);
1.61 + }
1.62 + else
1.63 + {
1.64 + ShowActivity2(client, "[SM] ", "%t", "Played sound to target", "_s", target_name);
1.65 + }
1.66
1.67 return Plugin_Handled;
1.68 }
1.69 -