Jump to content

Binds help!


razvan2299

Recommended Posts

Something like this maybe:

function reloadGun ( player, command ) 
    reloadPedWeapon ( player ) 
end 
function resourceStart( ) 
    local players = getElementsByType ( "player" ) 
    for k,v in ipairs(players) do 
        bindKey ( v, "r", "down", reloadGun, "Reload" ) 
    end 
end  
function playerJoin( ) 
    bindKey ( source, "r", "down", reloadGun, "Reload" ) 
end 
addEventHandler( "onResourceStart", root, resourceStart ) 
addEventHandler( "onPlayerJoin", root, playerJoin ) 

This is used to bind a function which allow you to reload guns but it's easy to work with and modify for your needs, good luck.

Link to comment

Sure, the bindKey function comes in two shapes, one accept functions and the other accept commands which also trigger a function at the end, so all you need to change is this part:

bindKey ( source, "r", "down", reloadGun, "Reload" ) 

into this:

bindKey ( source, "r", "down", "seatbelt", "Toggle seatbelt" ) 

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