GhostXoP Posted December 2, 2012 Share Posted December 2, 2012 Which functions can i use to, get the players current weapon in hand, and what that weapon is and its ammo? getPedWeaponSlot for getting current weapon getPedWeapon getPedTotalAmmo? Link to comment
Castillo Posted December 3, 2012 Share Posted December 3, 2012 getPedWeapon -- To get the player weapon ID. getPedAmmoInClip -- To get weapon ammo in clip. getPedTotalAmmo -- To get total weapon ammo. Link to comment
Tete omar Posted December 3, 2012 Share Posted December 3, 2012 I made a little example for you here you go : function Weapon_example() local weapon = getPedWeapon(localPlayer) -- gets your current weapon in hands local ammo = getPedTotalAmmo(localPlayer) -- gets the current weapon ammo local ammoInClip = getPedAmmoInClip(localPlayer) -- gets the current weapon ammo in clip if(weapon~=0)then -- if the weapon isn't [fist] then outputChatBox("You're carrying "..getWeaponNameFromID(weapon).." and the ammo is "..ammo.."-"..ammoInClip) -- outputs your weapon info end end addCommandHandler("myWeapon",Weapon_example) -- adds 'myWeapon' as a command that you can type in the console[f8] switch to some weapon and just type in the console myWeapon. Link to comment
GhostXoP Posted December 3, 2012 Author Share Posted December 3, 2012 Your fine, i know how to script Link to comment
Salem Posted December 21, 2017 Share Posted December 21, 2017 (edited) How to get the only one weapon I currently use? This function returns all weapons I have in all slots. Ok, found it: int getPedWeaponSlot ( ped thePed ) Edited December 21, 2017 by Salem found an answer 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