+function ls_cmd_guard(numeric, victim)
+ if not victim then
+ ls_notice(numeric, "Syntax: vote <nick>")
+ return
+ end
+
+ local channel = ls_chan_for_numeric(numeric)
+
+ if not channel then
+ ls_notice(numeric, "You haven't joined any game lobby.")
+ return
+ end
+
+ if not ls_get_trait(channel, numeric, "force") then
+ ls_notice(numeric, "Sorry, you need the force field generator to use this command.")
+ return
+ end
+
+ ls_keepalive(channel, numeric)
+
+ local victimnick = irc_getnickbynick(victim)
+
+ if not victimnick then
+ ls_notice(numeric, "Sorry, I don't know who that is.")
+ return
+ end
+
+ local victimnumeric = victimnick.numeric
+
+ if not ls_get_role(channel, victimnumeric) then
+ ls_notice(numeric, "Sorry, " .. ls_format_player(channel, victimnumeric) .. " isn't playing the game.")
+ return
+ end
+
+ local target
+
+ if victimnumeric == numeric then
+ target = "yourself"
+ else
+ target = ls_format_player(channel, victimnumeric)
+ end
+
+ for _, player in pairs(ls_get_players(channel)) do
+ ls_set_guarded(channel, player, (player == victimnumeric))
+ end
+
+ ls_notice(numeric, "You are now protecting " .. target .. ".")
+end
+