-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkick.lua
More file actions
31 lines (28 loc) · 1.16 KB
/
Copy pathkick.lua
File metadata and controls
31 lines (28 loc) · 1.16 KB
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
30
31
-- kick.lua
-- Implements the /kick command.
function HandleKickCommand(Split, Player)
if(#Split < 2) then
SendMessage(Player, cChatColor.LightGray .. "Usage: " .. Split[1] .. " <player> [reason]")
return true
end
local Reason = cChatColor.Gray .. "(╯°□°)╯︵ ┻━┻" .. cChatColor.LightGray .. "\n\n" .. "Kicked you from the server."
if (#Split > 2) then
Reason = cChatColor.Gray .. "(╯°□°)╯︵ ┻━┻" .. cChatColor.LightGray .. "\n\n" .. "Kicked you from the server." .. cChatColor.Gray .. "\n\n" .. cChatColor.LightGray .. "\"" .. table.concat(Split, " ", 3) .. "\""
end
local IsPlayerKicked = false
local Kick = function(OtherPlayer)
if (OtherPlayer:GetName() == Split[2]) then
IsPlayerKicked = true
KickPlayer(Split[2], Reason)
end
end
cRoot:Get():FindAndDoWithPlayer(Split[2], Kick)
if (IsPlayerKicked) then
cRoot:Get():BroadcastChat(cChatColor.LightGray .. cChatColor.Italic .. "Kicked the player " .. Split[2] .. " at request of staff.")
return true
end
if (IsPlayerKicked == false) then
SendMessageFailure(Player, "Could not find that player (" .. Split[2] .. "), are they online?")
return true
end
end