Jump to content

Get all player weapons


izstas

Recommended Posts

Best bet is to use the client-side variant, yes.

function getAllPlayerWeapons(player)
local table = {}
for i=0,13 do
local weapon = getPlayerWeapon(player,i)
if weapon and getPlayerTotalAmmo(player,i) ~= 0 then
table[#table+1] = weapon
end
end
 
return table
end
 
local myWeapons = getAllPlayerWeapons(getLocalPlayer())

Not tested, but I think this should work.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...