Element/Pickup: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
 
(9 intermediate revisions by 7 users not shown)
Line 6: Line 6:
==XML syntax==
==XML syntax==
<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
<pickup id="" posX="" posY="" posZ="" type="" weapon="" ammo="" respawn=""/>
<pickup posX="" posY="" posZ="" type="" amount="" respawn="" model=""/>
</syntaxhighlight>
</syntaxhighlight>


Line 13: Line 13:
* '''posY''': A float representing the Y position of the pickup.
* '''posY''': A float representing the Y position of the pickup.
* '''posZ''': A float representing the Z position of the pickup.
* '''posZ''': A float representing the Z position of the pickup.
* '''type''': A string indicating the type of the pickup. The acceptable values are:
* '''type''': A string indicating the type of the pickup. This can either be "health", "armor", "custom", or an integer representing the [[Weapon|weapon ID]] of the pickup..
** '''"weapon"''': A weapon pickup. Note: this type should be used with the '''ammo''' attribute.
** '''"health"''': A health pickup.
** '''"armor"''': An armor pickup.
* '''weapon''': An integer representing a [[Weapon|weapon ID]] if the pickup is a weapon, or the amount of health/armor points if the pickup is health or armor.


===Optional Attributes===
===Optional Attributes===
* '''ammo''': An integer representing the amount of ammo the weapon pickup has (default: 50). Note: this attribute is only useful for weapon pickups.
* '''amount''': An integer representing a the amount in a pickup.  For health or armor, this represents the number of hit points for the pickup. For weapons, this represents the amount of ammo
* '''respawn''': An integer representing the number of milliseconds until the pickup reappears after it has been picked up (default: 30000).
* '''respawn''': An integer representing the number of milliseconds until the pickup reappears after it has been picked up (default: 30000).
* '''model''': If the pickup is a custom model, this is the model id to use.


==Related scripting functions==
==Related scripting functions==
{{Pickup functions}}
{{Pickup functions}}
[[Category:Element Types]]
[[en:Element/Pickup]]
[[ru:Element/Pickup]]
[[hu:Element/Pickup]]

Latest revision as of 11:40, 26 February 2024

The pickup class represents weapon, health, or armor pickups in the GTA world. Pickups can be picked up by players when they are walked over. Players will not be given health or armor pickups if their health or armor is already full.

The element type of this class is "pickup".

XML syntax

<pickup posX="" posY="" posZ="" type="" amount="" respawn="" model=""/>

Required Attributes

  • posX: A float representing the X position of the pickup.
  • posY: A float representing the Y position of the pickup.
  • posZ: A float representing the Z position of the pickup.
  • type: A string indicating the type of the pickup. This can either be "health", "armor", "custom", or an integer representing the weapon ID of the pickup..

Optional Attributes

  • amount: An integer representing a the amount in a pickup. For health or armor, this represents the number of hit points for the pickup. For weapons, this represents the amount of ammo
  • respawn: An integer representing the number of milliseconds until the pickup reappears after it has been picked up (default: 30000).
  • model: If the pickup is a custom model, this is the model id to use.

Related scripting functions