GetPlayerWeapon: Difference between revisions

From Onset Developer Wiki
(Created page with "{{Info|Function|Server|1.0}} {{FuncDescription|__EDIT_ME__}} {{FuncSyntax|GetPlayerWeapon(player [, weaponslot])}} {{FuncParameters}} {{FuncParam|player |__EDIT_ME__}} {{Fu...")
 
No edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Info|Function|Server|1.0}}
{{Info|Function|Server & Client|1.0}}


{{FuncDescription|__EDIT_ME__}}
{{FuncDescription|Returns the specified player's weapon id, ammo, ammo in magazine in the specified weapon slot.}}


{{FuncSyntax|GetPlayerWeapon(player [, weaponslot])}}
{{FuncSyntax|GetPlayerWeapon(player [, weaponslot])}}
{{FuncSyntaxClient|GetPlayerWeapon(weaponslot)}}


{{FuncParameters}}
{{FuncParameters}}
{{FuncParam|player |__EDIT_ME__}}
{{FuncParam|player|The player identifier.}}
{{FuncParamOptional|weaponslot|__EDIT_ME__}}
{{FuncParamOptional|weaponslot|The weapon slot.}}


{{FuncReturnValue|__EDIT_ME__}}
{{FuncReturnValue|Returns weapon id, ammo.}}
{{FuncReturnValueClient|Returns weapon id, ammo, ammo in magazine.}}


== Example ==
== Example ==
__EDIT_ME__
<syntaxhighlight lang="Lua">
print("Weapon: " .. GetPlayerWeapon(player))
</syntaxhighlight>


{{RelatedFunctions}}
{{RelatedFunctions}}
__EDIT_ME__
* [[SetPlayerWeapon]]

Latest revision as of 14:49, 26 June 2021

GetPlayerWeapon

Type: Function
Context: Server & Client
Introduced: v1.0

Description

Returns the specified player's weapon id, ammo, ammo in magazine in the specified weapon slot.

Syntax

GetPlayerWeapon(player [, weaponslot])
Client Syntax
GetPlayerWeapon(weaponslot)

Parameters

  • player
    The player identifier.
  • weaponslot (optional)
    The weapon slot.

Return Value

  • Returns weapon id, ammo.

Client Return Value

  • Returns weapon id, ammo, ammo in magazine.

Example

print("Weapon: " .. GetPlayerWeapon(player))

See also