waleedrt Posted May 11, 2016 Posted May 11, 2016 can anyone tell me why is this does not work?? i can start it but it does not do any thing when i press lShift function fanFunction() bindKey ( "lshift","down", function () local sx,sy,sz = getElementVelocity ( vehicle ) setElementVelocity( vehicle ,sx, sy, sz+0.5 ) end ) end addEventHandler("bindme",fanFunction)
BEN. Posted May 11, 2016 Posted May 11, 2016 addEventHandler ( string eventName, element attachedTo, function handlerFunction) addCommandHandler ( string commandName, function handlerFunction)
waleedrt Posted May 11, 2016 Author Posted May 11, 2016 so ..... i should replace addCommandHandler("bindme",fanFunction) with addEventHandler ( string eventName, element attachedTo, function handlerFunction) addCommandHandler ( string commandName, function handlerFunction)
BEN. Posted May 11, 2016 Posted May 11, 2016 use command handler in your code try: addCommandHandler("bindme",fanFunction) in your code
Walid Posted May 11, 2016 Posted May 11, 2016 function fanFunction() bindKey ("lshift","down",yourFunction) end addEvent("bindme",true) addEventHandler("bindme",root,fanFunction) function yourFunction() if isPedInVehicle (localPlayer) then local vehicle = getPedOccupiedVehicle (localPlayer) local sx,sy,sz = getElementVelocity ( vehicle ) setElementVelocity( vehicle ,sx, sy, sz+0.5 ) end end
BEN. Posted May 11, 2016 Posted May 11, 2016 bindKey("lshift","down", function() if isPedInVehicle (localPlayer) then local vehicle = getPedOccupiedVehicle (localPlayer) local sx,sy,sz = getElementVelocity ( vehicle ) setElementVelocity( vehicle ,sx, sy, sz+0.5 ) end end)
waleedrt Posted May 11, 2016 Author Posted May 11, 2016 nope... i can open it without any problem but when i press shift nothing happens
waleedrt Posted May 11, 2016 Author Posted May 11, 2016 http://www49.zippyshare.com/v/ZcmwpAgC/file.html
BEN. Posted May 11, 2016 Posted May 11, 2016 bindKey("lshift","down", function() if isPedInVehicle (localPlayer) then local vehicle = getPedOccupiedVehicle (localPlayer) local sx,sy,sz = getElementVelocity ( vehicle ) setElementVelocity( vehicle ,sx, sy, sz+0.5 ) end end)
waleedrt Posted May 11, 2016 Author Posted May 11, 2016 ye i worked thnx but can u tell me how to make it just for admins without using acl
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