MRThinker Posted September 12, 2018 Share Posted September 12, 2018 what is BindKey ? bindKey is client side or server side ? how to use this function ? plz help me! Link to comment
Z4Zy Posted September 12, 2018 Share Posted September 12, 2018 Go and read this, https://wiki.multitheftauto.com/wiki/BindKey bindKey is a shared function. So, it can be use in both client and server sides. Better to refer above wiki link for more info + examples. Link to comment
JeViCo Posted September 12, 2018 Share Posted September 12, 2018 it's a shared function. The main difference between server and client: server contains player variable. client-side example: bindKey("g","down",function() -- your function here end) -- "g" - key to press -- "down" - key pressed ("up" if key released) server-side example: addEventHandler("onPlayerLogin",getRootElement(),function() bindKey(source,"g","down",function() -- your function here end) end) -- source - player variable in this event -- "g" - key to press -- "down" - key pressed ("up" if key released) @MRThinker Link to comment
MRThinker Posted September 12, 2018 Author Share Posted September 12, 2018 1 hour ago, JeViCo said: it's a shared function. The main difference between server and client: server contains player variable. client-side example: bindKey("g","down",function() -- your function here end) -- "g" - key to press -- "down" - key pressed ("up" if key released) server-side example: addEventHandler("onPlayerLogin",getRootElement(),function() bindKey(source,"g","down",function() -- your function here end) end) -- source - player variable in this event -- "g" - key to press -- "down" - key pressed ("up" if key released) @MRThinker oh thanks now i know bindKey 1 Link to comment
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