GetWeaponOwner: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Added an example section and added this function to "Needs Example" template.)
(Added OOP syntax)
Line 2: Line 2:
{{Client function}}
{{Client function}}
{{Needs_Example}}
{{Needs_Example}}
Get the owner of the custom weapon (used for lag compensation.)
This function gets the owner of a [[Element/Weapon|custom weapon]]. Please refer to [[setWeaponOwner]] for details.


==Syntax==
==Syntax==
<syntaxhighlight lang="lua">player getWeaponOwner ( weapon theWeapon )</syntaxhighlight>
<syntaxhighlight lang="lua">player getWeaponOwner ( weapon theWeapon )</syntaxhighlight>
{{OOP||[[Element/Weapon|weapon]]:getOwner|owner|setWeaponOwner}}


===Required Arguments===
===Required Arguments===
Line 11: Line 12:


===Returns===
===Returns===
Returns the ''player element'' of the custom weapon owner, ''false'' otherwise.
Returns the ''[[player]] element'' of the [[Element/Weapon|custom weapon]] owner, ''false'' otherwise.


==Example==
==Example==
Line 19: Line 20:
{{Requirements|n/a|1.3.0-9.04555|}}
{{Requirements|n/a|1.3.0-9.04555|}}


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

Revision as of 16:28, 23 December 2014

Accessories-text-editor.png Script Example Missing Function GetWeaponOwner needs a script example, help out by writing one.

Before submitting check out Editing Guidelines Script Examples.

This function gets the owner of a custom weapon. Please refer to setWeaponOwner for details.

Syntax

player getWeaponOwner ( weapon theWeapon )

OOP Syntax Help! I don't understand this!

Method: weapon:getOwner(...)
Variable: .owner
Counterpart: setWeaponOwner


Required Arguments

  • theWeapon: The weapon to get the owner of.

Returns

Returns the player element of the custom weapon owner, false otherwise.

Example

--TODO

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