CreateWeapon: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
m (engrish)
Line 2: Line 2:
{{Client function}}
{{Client function}}
Creates a custom weapon that can fire bullets not related to player held weapons.
Creates a custom weapon that can fire bullets not related to player held weapons.
'''Note:''' Some weapon types does not work.
'''Note:''' Some weapon types do not work.


==Syntax==
==Syntax==

Revision as of 13:38, 14 October 2012

Creates a custom weapon that can fire bullets not related to player held weapons. Note: Some weapon types do not work.

Syntax

weapon createWeapon ( string theType, float x, float y, float z )

Required Arguments

  • theType: The weapon type which can be:
  • colt 45
  • silenced
  • deagle
  • uzi
  • mp5
  • ak-47
  • m4
  • tec-9
  • rifle
  • sniper
  • minigun

Other weapons can be used but they can't fire. Use createProjectile for projectile based weapons.

  • x: The x position to create the weapon.
  • y: The y position to create the weapon.
  • z: The z position to create the weapon.

Returns

Returns a custom weapon element type and creates a simulated weapon at that position.

Requirements

Minimum server version n/a
Minimum client version 1.3.0-9.04555

Note: Using this feature requires the resource to have the above minimum version declared in the meta.xml <min_mta_version> section. e.g. <min_mta_version client="1.3.0-9.04555" />

See Also