Jump to content

Need help with weapon functions


Gad_boy

Recommended Posts

Client side:

addCommandHandler( "weapon", 
    function( ) 
        local weapon = getPedWeapon( localPlayer ) 
        outputChatBox( "You have weapon"..tostring( weapon ).." id, ammo "..tostring( getPedTotalAmmo( localPlayer,getPedWeaponSlot( localPlayer ) ) ) ) 
    end 
)    

Code updated

Link to comment
addEventHandler("onClientPlayerSpawn", root, 
    function ( ) 
        local ammo = getPedTotalAmmo ( source ) 
        local wtype = getPedWeapon ( source ) 
        outputChatBox( "Weapon "..tostring( wtype ).." id, ammo "..tostring( ammo ) ) 
    end 
) 

Why you need check root?

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...