Wiki

Clone wiki

EFLC-MP LUA / getPlayerWeapons

Description

Returns a table with the player weapons and ammo. This information is updated by using requestPlayerWeapons.

Parameters

Int playerid
Int player: ID of the player

Return values

table weaponData

Example

#!lua
function playerSwitchWeapons(playerid)
    requestPlayerWeapons(playerid)
end
registerEvent("playerSwitchWeapons", "onPlayerSwitchWeapons")

function weaponsArrived(playerid)
    local weapons = getPlayerWeapons(playerid)
    --Now loop weapons
end
registerEvent("weaponsArrived", "onPlayerWeaponsArrived")

Updated