manve1 Posted November 17, 2012 Share Posted November 17, 2012 How could i get what kind of weapon a person has in his hands? Like for example, if i have 'AK-47' in my hand, i would see it on a label. Link to comment
Castillo Posted November 17, 2012 Share Posted November 17, 2012 getPedWeapon getWeaponNameFromID Link to comment
manve1 Posted November 17, 2012 Author Share Posted November 17, 2012 I never used them, i had 7 or 8 tries to make it work, but i failed, here is the script: weap = guiCreateLabel( 0.2, 0.2, 0.1, 0.1, 'Weapon: ', true ) function weapname ( ) setTimer( function() local weaponType = getPedWeapon ( localPlayer ) if ( weaponType ) then guiSetText( weap, 'Weapon: '.. getWeaponNameFromID ( weaponType ) ) end end, 50, 0 ) end Link to comment
Castillo Posted November 17, 2012 Share Posted November 17, 2012 weap = guiCreateLabel( 0.2, 0.2, 0.1, 0.1, 'Weapon: ', true ) setTimer ( function ( ) local weaponType = getPedWeapon ( localPlayer ) if ( weaponType ) then guiSetText ( weap, 'Weapon: '.. getWeaponNameFromID ( weaponType ) ) end end ,50, 0 ) Link to comment
manve1 Posted November 17, 2012 Author Share Posted November 17, 2012 Thank you. (( I just noticed that after all i made it correct, just for some reason added function )) 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