Added amb<536> requested for using sm_kick without putting quotes around reason.

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401217
This commit is contained in:
Phong Dang 2007-07-29 19:20:42 +00:00
parent 64d7fd751a
commit c01022585b

View File

@ -565,7 +565,6 @@ public Action:Command_Kick(client, args)
decl String:arg[65]; decl String:arg[65];
GetCmdArg(1, arg, sizeof(arg)); GetCmdArg(1, arg, sizeof(arg));
new target = FindTarget(client, arg); new target = FindTarget(client, arg);
if (target == -1) if (target == -1)
{ {
@ -573,20 +572,23 @@ public Action:Command_Kick(client, args)
} }
decl String:name[65]; decl String:name[65];
GetClientName(target, name, sizeof(name)); GetClientName(target, name, sizeof(name));
decl String:reason[256]; decl String:reason[256];
if (args < 2) if (args < 2)
{ {
/* Safely null terminate */ /* Safely null terminate */
reason[0] = '\0'; reason[0] = '\0';
} else { } else {
GetCmdArg(2, reason, sizeof(reason)); GetCmdArgString(reason, sizeof(reason));
new len = BreakString(reason, arg, sizeof(arg));
strcopy(reason, sizeof(reason), reason[len]);
} }
ShowActivity(client, "%t", "Kicked player", name); ShowActivity(client, "%t", "Kicked player", name);
LogMessage("\"%L\" kicked \"%L\" (reason \"%s\")", client, target, reason); LogMessage("\"%L\" kicked \"%L\" (reason \"%s\")", client, target, reason);
KickClient(target, "%s", reason); KickClient(target, "%s", reason);