Jump to content

About getWeaponAmmo


Recommended Posts

function ( ) 
if getPedTotalAmmo ( getLocalPlayer(), 7 ) > 1 then 
triggerServerEvent("lol", getLocalPlayer()) 
end 
end 
setTimer(, 100, 0) 

server

  
addEvent("lol") 
addEventHandler("lol", root, 
giveWeapon(source, 38, 1) 
end 
) 

as u see it's a madness

And no idea yet how to get the weapon minigun =/

Link to comment
function ( ) 
    local weapon = getPedWeapon ( localPlayer, 7 ) 
    if ( weapon == 38 ) then 
        if ( getPedTotalAmmo ( localPlayer, 7 ) > 1 ) then 
            triggerServerEvent ( "lol", localPlayer ) 
        end 
    end 
end 
setTimer ( , 100, 0 ) 

Using a timer isn't an efficient method though.

Link to comment

Client side

  
addEventHandler("onClientPlayerWeaponSwitch", getRootElement(),  
function ( ) 
    local weapon = getPedWeapon ( source, 7 ) 
    if ( weapon == 38 ) then 
        if ( getPedTotalAmmo ( source, 7 ) > 1 ) then 
            triggerServerEvent ( "lol", source ) 
        end 
    end 
end 
) 

serverside

addEvent("lol") 
addEventHandler("lol", getRootElement(), 
function ( ) 
giveWeapon ( source, 38, 1 ) 
end 
) 

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