GetWeaponOwner: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Added OOP syntax)
(Added more explanatory text)
Line 2: Line 2:
{{Client function}}
{{Client function}}
{{Needs_Example}}
{{Needs_Example}}
This function gets the owner of a [[Element/Weapon|custom weapon]]. Please refer to [[setWeaponOwner]] for details.
This function gets the owner of a [[Element/Weapon|custom weapon]]. Weapon ownership system was, however, disabled, so this function always returns ''false''. Please refer to [[setWeaponOwner]] for details.


==Syntax==
==Syntax==
<syntaxhighlight lang="lua">player getWeaponOwner ( weapon theWeapon )</syntaxhighlight>
<syntaxhighlight lang="lua">boolean getWeaponOwner ( weapon theWeapon )</syntaxhighlight>
{{OOP||[[Element/Weapon|weapon]]:getOwner|owner|setWeaponOwner}}
{{OOP|Pair is completely disabled at the moment (its value is ''[[nil]]'').|[[Element/Weapon|weapon]]:getOwner|owner|setWeaponOwner}}


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


===Returns===
===Returns===
Returns the ''[[player]] element'' of the [[Element/Weapon|custom weapon]] owner, ''false'' otherwise.
This function was intended to return the [[player]] which owns the [[Element/Weapon|custom weapon]], and ''false'' if an error occured. However, at the moment it always returns ''false''.


==Example==
==Example==

Revision as of 18:04, 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. Weapon ownership system was, however, disabled, so this function always returns false. Please refer to setWeaponOwner for details.

Syntax

boolean getWeaponOwner ( weapon theWeapon )

OOP Syntax Help! I don't understand this!

Note: Pair is completely disabled at the moment (its value is nil).
Method: weapon:getOwner(...)
Variable: .owner
Counterpart: setWeaponOwner


Required Arguments

  • theWeapon: The weapon to get the owner of.

Returns

This function was intended to return the player which owns the custom weapon, and false if an error occured. However, at the moment it always returns false.

Example

--TODO

Requirements

This template will be deleted.

See also