object.set_pickup_permissions

This function allows you to control which players are allowed to pick up a given weapon. It only works on weapons (including flags, bombs, and skulls) and does nothing when used on other objects, such as vehicles and grenades.

The typical use case for this is to prevent teams from interacting with objective weapons, e.g. preventing a team from moving their own flag in Capture the Flag, or preventing a team from moving the enemy bomb in Assault.

Arguments

who

A group of players.

Example

--
-- Do not allow Elites to pick up Assault Rifles.
--
for each player do
   if current_player.biped.is_of_type(elite) then
      for each object do
         if current_object.is_of_type(assault_rifle) then
            current_object.set_pickup_permissions(mod_player, current_player, 0)
         end
      end
   end
end

See also