Headshot4Fun Posted August 18, 2011 Share Posted August 18, 2011 Well, the title said it all. I Would like to know if theres a specific client-side function to get all the player weapons, not the one he's currently using; and how can i make it return in a table. Thanks Link to comment
JR10 Posted August 18, 2011 Share Posted August 18, 2011 local playerWeapons = {} for slot = 0, 12 do local weapon = getPedWeapon(player, slot) table.insert(playerWeapons, weapon) end just a start. Link to comment
Castillo Posted August 18, 2011 Share Posted August 18, 2011 function getPlayerWeapons(player) local weaponsTable = {} for index=0, 13 do local weapon = getPedWeapon(player,index) local ammo = getPedTotalAmmo(player,index) if ammo > 0 then table.insert(weaponsTable, {weapon, ammo}) end end return weaponsTable end Should return a table of weapons (weapon model, ammo). Link to comment
Headshot4Fun Posted August 18, 2011 Author Share Posted August 18, 2011 local playerWeapons = {} for slot = 0, 12 do local weapon = getPedWeapon(player, slot) table.insert(playerWeapons, weapon) end just a start. Thanks brother. You help is appreciated Edit: And thank you too Solidsnake14. You help is also appreciated Link to comment
Castillo Posted August 18, 2011 Share Posted August 18, 2011 No problem. P.S: We posted at the same time, nice sync . Link to comment
JR10 Posted August 18, 2011 Share Posted August 18, 2011 3 posts in 1 minutes. btw Max Slot is 12. Link to comment
Headshot4Fun Posted August 18, 2011 Author Share Posted August 18, 2011 3 posts in 1 minutes. btw Max Slot is 12. Well. there are 13 slots. Starts at 0, and goes to 12. But you are right about that. Max slot is 12.And yes, nice sync ^^ Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now