Jump to content

fix code bindkey


Recommended Posts

please i want whan i press key F1 stay do fuction again and again.. and whan up key then stop

this is code

server

function bindTheKeys2(player) 
local x, y, z, rx, ry, rz = getElementAttachedOffsets (car1) 
attachElements ( car1, vehicle [ player ], x, y, z, rx, ry, rz+1 ) 
end 
  
function bindTheKeysd ( player, commandName ) 
  bindKey ( player, "F2", "down", bindTheKeys2 )   
end 
addCommandHandler ( "bindme", bindTheKeysd ) 

Link to comment
local render = { } 
  
function bindTheKeys2(player, key, stats) 
  if (stats == "down") then 
    render[player] = setTimer(function(player) 
        local x, y, z, rx, ry, rz = getElementAttachedOffsets (car1) 
        attachElements ( car1, vehicle[player], x, y, z, rx, ry, rz+1) 
    end, 50, 0, player) 
  elseif (stats == "up") and (isTimer(render[player])) then 
    killTimer(render[player]) 
    render[player] == nil 
  end 
end 
  
function bindTheKeysd(player, commandName) 
  bindKey(player, "F2", "both", bindTheKeys2)   
end 
addCommandHandler("bindme", bindTheKeysd) 

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