2013-07-27 16:24:03 +01:00
|
|
|
function HandleKickCommand( Split, Player )
|
2013-08-11 16:00:53 +01:00
|
|
|
|
2013-07-27 16:24:03 +01:00
|
|
|
if( #Split < 2 ) then
|
2013-08-11 16:00:53 +01:00
|
|
|
SendMessage( Player, "Usage: /kick [Player] <Reason>" )
|
2013-07-27 16:24:03 +01:00
|
|
|
return true
|
|
|
|
|
end
|
2013-08-11 16:00:53 +01:00
|
|
|
|
2013-07-27 16:24:03 +01:00
|
|
|
local Reason = "You have been kicked"
|
2013-08-11 16:00:53 +01:00
|
|
|
if ( #Split > 2 ) then
|
|
|
|
|
Reason = table.concat( Split, " ", 3 )
|
2013-07-27 16:24:03 +01:00
|
|
|
end
|
2013-08-11 16:00:53 +01:00
|
|
|
|
2013-07-27 16:24:03 +01:00
|
|
|
if( KickPlayer( Split[2], Reason ) == false ) then
|
2013-08-11 16:00:53 +01:00
|
|
|
SendMessageFailure( Player, "Could not find player " .. Split[2] )
|
2013-07-27 16:24:03 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return true
|
2013-08-11 16:00:53 +01:00
|
|
|
|
2013-07-27 16:24:03 +01:00
|
|
|
end
|