SetWeaponTarget: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ {{Client function}} Weapon target information: * There are three types of targets: ** Position - Fires at a position in the world ** Entity - Fires at an entity ( eithe...")
 
No edit summary
Line 59: Line 59:


==See Also==
==See Also==
{{Client weapon functions}}
{{Client weapon creation functions}}

Revision as of 10:47, 26 August 2012

Weapon target information:

  • There are three types of targets:
    • Position - Fires at a position in the world
    • Entity - Fires at an entity ( either the COM or the component position provided )
    • Rotational - Fires where the weapon points

Syntax

bool setWeaponTarget ( weapon theWeapon, element theTarget, int iComponentID )

Required Arguments

  • theWeapon: The weapon to set the target of.
  • theTarget: The target entity of the shot to shoot at.
  • iComponentID: The component position to fire at.
    • Vehicles:
      • 0 - front left tire
      • 1 - front right tire
      • 2 - rear left tire
      • 3 - rear right tire
      • 255 - none
    • Peds:
      • See ped bones
      • 255 - none

Returns

Returns true on success, false otherwise.

Fires a weapon at the specified entity ( this never misses... ever )

Syntax 2

Fires a weapon at the specified position ( this never misses... ever )

bool setWeaponTarget ( weapon theWeapon, float targetX, float targetY, float targetZ )

Required Arguments

  • theWeapon: The weapon to set the target of.
  • targetX: The target X.
  • targetY: The target Y.
  • targetZ: The target Z.

Returns

Returns true on success, false otherwise.

Syntax 3

Sets the weapon back to rotation based targeting.

bool bool setWeaponTarget ( weapon theWeapon, nil )

Required Arguments

  • theWeapon: The weapon to clear the target of.

Returns

Returns true on success, false otherwise.


Requirements

This template will be deleted.

See Also