forked from mtcontrib/factions
Fixed /f kick
This commit is contained in:
parent
0a47417e77
commit
e8c9fb3f7e
|
@ -250,12 +250,12 @@ factions.register_command("kick", {
|
||||||
description = "Kick a player from your faction.",
|
description = "Kick a player from your faction.",
|
||||||
on_success = function(player, faction, pos, parcelpos, args)
|
on_success = function(player, faction, pos, parcelpos, args)
|
||||||
local victim = args.players[1]
|
local victim = args.players[1]
|
||||||
if factions.players[victim.name] == faction.name
|
if factions.players[victim:get_player_name()] == faction.name
|
||||||
and victim.name ~= faction.leader then -- can't kick da king
|
and victim:get_player_name() ~= faction.leader then -- can't kick da king
|
||||||
faction:remove_player(player)
|
faction:remove_player(player)
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
send_error(player, "Cannot kick player "..victim.name)
|
send_error(player, "Cannot kick player "..victim:get_player_name())
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user