SheriFF Posted February 4, 2017 Share Posted February 4, 2017 I'd like to sugest a delay() function because, in my opinion, it will be helpful and it will save you from using plenty of setTimers or any function like that. How can this function can be helpful?: Delay between two actions( switching two images ) Some interesting effects etc... (I'm sorry if this kind of function exists, i didn't notice it) Link to comment
Mr.Solo Posted February 5, 2017 Share Posted February 5, 2017 It would be better if we added timer to Client commands! like /settimer 10000 reconnect Link to comment
keymetaphore Posted February 5, 2017 Share Posted February 5, 2017 5 hours ago, Mr.Solo said: It would be better if we added timer to Client commands! like /settimer 10000 reconnect THIS IS WHAT I ALWAYS WANTED with binds though, like bind 1 f hi bind 1 setTimer(f hi, 100) <-:Oed the syntax, you got it Link to comment
Simple0x47 Posted February 5, 2017 Share Posted February 5, 2017 getTickCount and onClientRender solves the problem. 1 Link to comment
Captain Cody Posted February 5, 2017 Share Posted February 5, 2017 2 hours ago, Gourmet. said: THIS IS WHAT I ALWAYS WANTED with binds though, like bind 1 f hi bind 1 setTimer(f hi, 100) <-:Oed the syntax, you got it It'd actually be possible to script this very easily. Link to comment
Simple0x47 Posted February 7, 2017 Share Posted February 7, 2017 On 5/2/2017 at 14:02, Gourmet. said: THIS IS WHAT I ALWAYS WANTED with binds though, like bind 1 f hi bind 1 setTimer(f hi, 100) <-:Oed the syntax, you got it That would allow people to hack servers easily... Link to comment
keymetaphore Posted February 7, 2017 Share Posted February 7, 2017 30 minutes ago, Simple01 said: That would allow people to hack servers easily... Yep, but getting this feature working like a delayed bind, not setting timers with the functions could make it work. Link to comment
MTA Team sbx320 Posted February 10, 2017 MTA Team Share Posted February 10, 2017 You can already do this with Lua coroutines. function pausableFunction(co) if not co then co = coroutine.create(pausableFunction) coroutine.resume(co, co) return end local function resume() coroutine.resume(co) end local function wait(time) setTimer(resume, time, 1) end outputChatBox("Countdown!") outputChatBox("3...") wait(1000) outputChatBox("2...") wait(1000) outputChatBox("1...") wait(1000) outputChatBox("Go!") end Link to comment
Recommended Posts