Skip to content

Commit

Permalink
/kick
Browse files Browse the repository at this point in the history
  • Loading branch information
mabako committed May 3, 2010
1 parent de2c221 commit b27b8f1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion acl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
<right name="command.modchat" access="true" />
<right name="command.createshop" access="true" />
<right name="command.deleteshop" access="true" />
<right name="command.kick" access="true" />
</acl>
<acl name="Admin">
<right name="general.ModifyOtherObjects" access="true" />
Expand All @@ -162,7 +163,6 @@
<right name="command.refreshall" access="true" />
<right name="command.addaccount" access="true" />
<right name="command.delaccount" access="true" />
<right name="command.kick" access="true" />
<right name="command.ban" access="true" />
<right name="command.banip" access="true" />
<right name="command.unbanip" access="true" />
Expand Down
19 changes: 19 additions & 0 deletions resources/admin/player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,22 @@ addCommandHandler( "goto",
end,
true
)

addCommandHandler( "kick",
function( player, commandName, otherPlayer, ... )
if otherPlayer and ( ... ) then
local other, name = exports.players:getFromName( player, otherPlayer )
if other then
if not hasObjectPermissionTo( other, "command.kick" ) then
local reason = table.concat( { ... }, " " )
kickPlayer( other, player, reason )
else
outputChatBox( "You can't kick this player.", player, 255, 0, 0 )
end
end
else
outputChatBox( "Syntax: /" .. commandName .. " [player] [reason]", player, 255, 255, 255 )
end
end,
true
)

0 comments on commit b27b8f1

Please sign in to comment.