MakePedUseGun: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (Replaced template deprecated with DeprecatedWithAlt)
Line 26: Line 26:


==Example==
==Example==
This page lacks an example.
<syntaxhighlight lang="lua">
--ToDo
</syntaxhighlight>


==See Also==
==See Also==
{{Client_ped_functions}}
{{Client_ped_functions}}

Revision as of 16:13, 19 July 2013

Template:DeprecatedWithAlt This function is used to force a ped to use a gun. This function does not appear to work, to make a ped use a weapon use setPedControlState instead.

Syntax

bool makePedUseGun ( ped thePed, int useType, element target )

Required Arguments

  • thePed: The ped you wish to force the use of a gun upon.
  • useType: How the weapon should be used, will accept the following values:
    • 0: Do nothing
    • 1: Aim weapon
    • 2: Fire
    • 3: Burst-fire
    • 4: Reload
    • 5: Pistolwhip (Weapon melee)
    • 6: Cancel use
    • 7: Cancel use immediately
  • target: An element referring to the target that the ped will use its weapon against.

Returns

Returns true if the command was successful, false otherwise.

Example

--ToDo

See Also