Fixed AskPluginLoad would still allowed plugin to load even if it returned false.
3 * Implements basic punishment commands.
4 * This file is part of SourceMod, Copyright (C) 2004-2007 AlliedModders LLC
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28 public Plugin:myinfo =
30 name = "Basic Fun Commands",
31 author = "AlliedModders LLC",
32 description = "Basic Fun Commands",
33 version = SOURCEMOD_VERSION,
34 url = "http://www.sourcemod.net/"
37 public OnPluginStart()
39 LoadTranslations("common.phrases");
41 RegAdminCmd("sm_burn", Command_Burn, ADMFLAG_SLAY, "sm_burn <#userid|name> [time]");
42 RegAdminCmd("sm_slap", Command_Slap, ADMFLAG_SLAY, "sm_slap <#userid|name> [damage]");
43 RegAdminCmd("sm_slay", Command_Slay, ADMFLAG_SLAY, "sm_slay <#userid|name>");
46 public Action:Command_Burn(client, args)
50 ReplyToCommand(client, "[SM] Usage: sm_burn <#userid|name> [time]");
51 return Plugin_Handled;
55 GetCmdArg(1, arg, sizeof(arg));
57 new Float:seconds = 20.0;
62 GetCmdArg(2, time, sizeof(time));
63 if (StringToFloatEx(time, seconds) == 0)
65 ReplyToCommand(client, "[SM] %t", "Invalid Amount");
66 return Plugin_Handled;
70 new target = FindTarget(client, arg);
73 return Plugin_Handled;
76 GetClientName(target, arg, sizeof(arg));
78 ShowActivity(client, "%t", "Ignited player", arg);
79 LogMessage("\"%L\" ignited \"%L\" (seconds \"%f\")", client, target, seconds);
80 IgniteEntity(target, seconds);
82 return Plugin_Handled;
85 public Action:Command_Slap(client, args)
89 ReplyToCommand(client, "[SM] Usage: sm_slap <#userid|name> [damage]");
90 return Plugin_Handled;
94 GetCmdArg(1, arg, sizeof(arg));
100 decl String:arg2[20];
101 GetCmdArg(2, arg2, sizeof(arg2));
102 if (StringToIntEx(arg2, damage) == 0)
104 ReplyToCommand(client, "[SM] %t", "Invalid Amount");
105 return Plugin_Handled;
109 new target = FindTarget(client, arg);
112 return Plugin_Handled;
115 GetClientName(target, arg, sizeof(arg));
117 ShowActivity(client, "%t", "Slapped player", arg);
118 LogMessage("\"%L\" slapped \"%L\" (damage \"%d\")", client, target, damage);
119 SlapPlayer(target, damage, true);
121 return Plugin_Handled;
124 public Action:Command_Slay(client, args)
128 ReplyToCommand(client, "[SM] Usage: sm_slay <#userid|name>");
129 return Plugin_Handled;
133 GetCmdArg(1, arg, sizeof(arg));
135 new target = FindTarget(client, arg);
138 return Plugin_Handled;
141 GetClientName(target, arg, sizeof(arg));
143 ShowActivity(client, "%t", "Slayed player", arg);
144 LogMessage("\"%L\" slayed \"%L\"", client, target);
145 ForcePlayerSuicide(target);
147 return Plugin_Handled;