-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathcmd_kick.lua
More file actions
29 lines (25 loc) · 841 Bytes
/
cmd_kick.lua
File metadata and controls
29 lines (25 loc) · 841 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
function HandleKickCommand(Split, Player)
local Response
local Reason
local KickPlayer = function(OtherPlayer)
if KickPlayer(Split[2], Reason) then
Response = SendMessageSuccess(Player, "Successfully kicked player \"" .. OtherPlayer:GetName() .. "\"")
else
Response = SendMessageFailure(Player, "Failed to kick player \"" .. OtherPlayer:GetName() .. "\"")
end
end
if not Split[2] then
Response = SendMessage(Player, "Usage: " .. Split[1] .. " <player> [reason ...]")
else
if Split[3] then
Reason = table.concat(Split, " ", 3)
end
if Split[2] == "" or not cRoot:Get():FindAndDoWithPlayer(Split[2], KickPlayer) then
Response = SendMessageFailure(Player, "Player \"" .. Split[2] .. "\" not found")
end
end
return true, Response
end
function HandleConsoleKick(Split)
return HandleKickCommand(Split)
end