ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. getPedWeaponSlot

Function

getPedWeaponSlot

ServerPedsIdentical to MTA:SA

Returns the slot number (0-12) of the weapon a ped is currently holding. The slot follows from the weapon type: e.g. handguns are slot 2, assault rifles slot 5. When the ped is holding fists it returns 0.

Syntax

int getPedWeaponSlot(ped ped)

Arguments

pedped
A player or an NPC.

Returns

Slot number 0-12.

Example

addCommandHandler("slot", function(player)
    outputChatBox("Aktywny slot: " .. getPedWeaponSlot(player), player)
end)

See also