The
game_player_equip
entity allows you to provide the player with specific items when it is triggered. In deathmatch games, this entity can also be used to give items to players upon spawning.
Attributes
- Name (targetname) - Name is a general attribute used to identify entities. Use the name
game_playerspawn
to automatically equip players [re]spawning into the level.
- Team Master (master) - This can be used to limit which team (in a deathmatch game) can receive the items. Takes the name of a
game_team_master
.
To specify what items you want the entity to dispense, you must turn Smart Edit mode off and add attributes. Enter the item's name as the key, and how many of that item you want to give as the value. For example, a key of "
weapon_handgrenade
" with a value of "
2" will equip the player with 10 grenades (as each
weapon_handgrenade
gives 5 grenades).
Flags
- Use Only (1) - No effect. It is checked in the Touch function, but all game_ point entities are not solid and therefore not touch-able.
Notes
- Works in both singleplayer and multiplayer (unless spawnflag 2048 (Not in deathmatch) is checked.)
- The maximum number of entity types to equip per entity is 32.
- The entity must be triggered with a player as the activator. Some entities like
trigger_auto
and trigger_relay
don't have a player reference passed as the activator, causing the game to crash.
- The special entity name
game_playerspawn
automatically equip players [re]spawning into the level. Special entity names are automatically fired by the game with the affected player as the activator. Special entity names requires Half-Life SDK 2.0+.
- This entity is not limited to weapons. Weapons, ammo, and items can all be used, including
item_battery
and item_healthkit
.
- In fact, other entities will work as well, including monsters. As you don't have a way to trigger or specify the properties of these entities, using a
game_player_equip
in that way is likely not useful, but it's worth noting that it is possible.
- The items dispensed are not given directly to the player's inventory — the items are, in fact, spawned on top of the player. Generally, the effect is the same, but it should be noted that if a player is at full capacity for a particular item, the player will not pick up an item of that type when it is spawned. If not used carefully, this could result in items being strewn around the map in an untidy and possibly unbalancing manner.
- To have a physical item that stocks ammo upon touch, use the
weaponbox
entity.
game_playerspawn
to automatically trigger this entity at the start of the map.game_playerspawn
is the targetname you assign to this entity, or any other entity of any classname.the game fires entities of the name
game_playerspawn
on your behalf every time you spawn in a map. another example is if you have agame_text
entity with the namegame_playerspawn
you'll see thegame_text
's text when you spawn.also,
game_*
entities in general are added sometime after retail release so this entity, and the game engine firinggame_playerspawn
would be absent on early WON versions or earlier SDKs.