Selavi Posted March 5, 2015 Share Posted March 5, 2015 Witam, wprowadziłem funkcję do 'wheels moda' który po wciśnięciu F1 wyłącza się lub włącza. Chciałbym wprowadzić ograniczenie do tej funkcji ( 5 sec ). Aby wyłączyć/włączyć można było dopiero po 5 sekundach. state = true function rWheels() state = not state if state then for _,v in pairs(wheels) do engineRestoreModel(v[2]) end outputChatBox('You chose original car wheels') else replace() outputChatBox('You chose modified car wheels') end end bindKey ( "F1", "down", rWheels ) Link to comment
WhoAmI Posted March 5, 2015 Share Posted March 5, 2015 Po włączeniu unbinduj klawisz F1 i ustaw timer, żeby się znowu zbindował po 5s. Link to comment
Bober Posted March 10, 2015 Share Posted March 10, 2015 state = true tick = getTickCount () - 5000 function rWheels() if getTickCount () - tick > 5000 then state = not state if state then for _,v in pairs(wheels) do engineRestoreModel(v[2]) end outputChatBox('You chose original car wheels') else replace() outputChatBox('You chose modified car wheels') end tick = getTickCount () end end bindKey ( "F1", "down", rWheels ) 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