1.1 --- a/plugins/basefuncommands.sp Sun Jul 29 19:20:42 2007 +0000
1.2 +++ b/plugins/basefuncommands.sp Sun Jul 29 20:42:51 2007 +0000
1.3 @@ -12,7 +12,7 @@
1.4 * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.5 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.6 * GNU General Public License for more details.
1.7 - *
1.8 + *
1.9 * You should have received a copy of the GNU General Public License
1.10 * along with this program; if not, write to the Free Software
1.11 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1.12 @@ -25,7 +25,7 @@
1.13 #include <sourcemod>
1.14 #include <sdktools>
1.15
1.16 -public Plugin:myinfo =
1.17 +public Plugin:myinfo =
1.18 {
1.19 name = "Basic Fun Commands",
1.20 author = "AlliedModders LLC",
1.21 @@ -41,6 +41,35 @@
1.22 RegAdminCmd("sm_burn", Command_Burn, ADMFLAG_SLAY, "sm_burn <#userid|name> [time]");
1.23 RegAdminCmd("sm_slap", Command_Slap, ADMFLAG_SLAY, "sm_slap <#userid|name> [damage]");
1.24 RegAdminCmd("sm_slay", Command_Slay, ADMFLAG_SLAY, "sm_slay <#userid|name>");
1.25 + RegAdminCmd("sm_play", Command_Play, ADMFLAG_GENERIC, "sm_play <#userid|name> [filename]");
1.26 +}
1.27 +
1.28 +public Action:Command_Play(client, args)
1.29 +{
1.30 + if(args < 2)
1.31 + {
1.32 + ReplyToCommand(client, "[SM] Usage: sm_burn <#userid|name> [sound]");
1.33 + }
1.34 +
1.35 + decl String:Arg[65];
1.36 + GetCmdArg(1, Arg, sizeof(Arg));
1.37 +
1.38 + new target = FindTarget(client, Arg);
1.39 + if (target == -1)
1.40 + {
1.41 + return Plugin_Handled;
1.42 + }
1.43 +
1.44 + decl String:SoundFile[PLATFORM_MAX_PATH];
1.45 + GetCmdArg(2, SoundFile, sizeof(SoundFile));
1.46 + GetClientName(target, Arg, sizeof(Arg));
1.47 +
1.48 + ShowActivity(client, "%t", "Played Sound", Arg);
1.49 + LogMessage("\"%L\" played sound on \"%L\" (file \"%s\")", client, target, SoundFile);
1.50 +
1.51 + ClientCommand(target, "playgamesound %s", SoundFile);
1.52 +
1.53 + return Plugin_Handled;
1.54 }
1.55
1.56 public Action:Command_Burn(client, args)
1.57 @@ -49,13 +78,13 @@
1.58 {
1.59 ReplyToCommand(client, "[SM] Usage: sm_burn <#userid|name> [time]");
1.60 return Plugin_Handled;
1.61 - }
1.62 -
1.63 + }
1.64 +
1.65 decl String:arg[65];
1.66 - GetCmdArg(1, arg, sizeof(arg));
1.67 -
1.68 + GetCmdArg(1, arg, sizeof(arg));
1.69 +
1.70 new Float:seconds = 20.0;
1.71 -
1.72 +
1.73 if (args > 1)
1.74 {
1.75 decl String:time[20];
1.76 @@ -64,22 +93,22 @@
1.77 {
1.78 ReplyToCommand(client, "[SM] %t", "Invalid Amount");
1.79 return Plugin_Handled;
1.80 - }
1.81 + }
1.82 }
1.83 -
1.84 +
1.85 new target = FindTarget(client, arg);
1.86 if (target == -1)
1.87 {
1.88 return Plugin_Handled;
1.89 }
1.90 -
1.91 +
1.92 GetClientName(target, arg, sizeof(arg));
1.93 -
1.94 +
1.95 ShowActivity(client, "%t", "Ignited player", arg);
1.96 LogMessage("\"%L\" ignited \"%L\" (seconds \"%f\")", client, target, seconds);
1.97 IgniteEntity(target, seconds);
1.98 -
1.99 - return Plugin_Handled;
1.100 +
1.101 + return Plugin_Handled;
1.102 }
1.103
1.104 public Action:Command_Slap(client, args)
1.105 @@ -88,13 +117,13 @@
1.106 {
1.107 ReplyToCommand(client, "[SM] Usage: sm_slap <#userid|name> [damage]");
1.108 return Plugin_Handled;
1.109 - }
1.110 -
1.111 + }
1.112 +
1.113 decl String:arg[65];
1.114 - GetCmdArg(1, arg, sizeof(arg));
1.115 -
1.116 + GetCmdArg(1, arg, sizeof(arg));
1.117 +
1.118 new damage = 5;
1.119 -
1.120 +
1.121 if (args > 1)
1.122 {
1.123 decl String:arg2[20];
1.124 @@ -103,22 +132,22 @@
1.125 {
1.126 ReplyToCommand(client, "[SM] %t", "Invalid Amount");
1.127 return Plugin_Handled;
1.128 - }
1.129 + }
1.130 }
1.131 -
1.132 +
1.133 new target = FindTarget(client, arg);
1.134 if (target == -1)
1.135 {
1.136 return Plugin_Handled;
1.137 }
1.138 -
1.139 +
1.140 GetClientName(target, arg, sizeof(arg));
1.141 -
1.142 +
1.143 ShowActivity(client, "%t", "Slapped player", arg);
1.144 LogMessage("\"%L\" slapped \"%L\" (damage \"%d\")", client, target, damage);
1.145 SlapPlayer(target, damage, true);
1.146 -
1.147 - return Plugin_Handled;
1.148 +
1.149 + return Plugin_Handled;
1.150 }
1.151
1.152 public Action:Command_Slay(client, args)
1.153 @@ -127,22 +156,22 @@
1.154 {
1.155 ReplyToCommand(client, "[SM] Usage: sm_slay <#userid|name>");
1.156 return Plugin_Handled;
1.157 - }
1.158 -
1.159 + }
1.160 +
1.161 decl String:arg[65];
1.162 - GetCmdArg(1, arg, sizeof(arg));
1.163 -
1.164 + GetCmdArg(1, arg, sizeof(arg));
1.165 +
1.166 new target = FindTarget(client, arg);
1.167 if (target == -1)
1.168 {
1.169 return Plugin_Handled;
1.170 }
1.171 -
1.172 +
1.173 GetClientName(target, arg, sizeof(arg));
1.174 -
1.175 +
1.176 ShowActivity(client, "%t", "Slayed player", arg);
1.177 LogMessage("\"%L\" slayed \"%L\"", client, target);
1.178 ForcePlayerSuicide(target);
1.179 -
1.180 - return Plugin_Handled;
1.181 +
1.182 + return Plugin_Handled;
1.183 }
1.184 \ No newline at end of file