0 Üye ve 1 Ziyaretçi konuyu incelemekte.
Reyiz, sunucunda mbloader varsa içini çok doldurmuşsundur eğer yoksa araç scriptlerinin bikaçını sil (tercihen mbsi yüksek olanları)Ha eğer benim arabalarım çok iyi silmek istemiyorum dersende setTimer'e koy araçlarını
Evet mbloader kullanıyorum.Nasıl yapacağım setTimer olayını?
aynı sorun bende var settimer nasıl oluyor
mb loaderde çok araç/skin olduğundan kaynaklıdır.
--https://forum.mtasa.com/topic/54787-simple-sleep-function/function callFunctionWithSleeps(calledFunction, ...) local co = coroutine.create(calledFunction) --we create a thread coroutine.resume(co, ...) --and start its execution end function sleep(time) local co = coroutine.running() local function resumeThisCoroutine() --since setTimer copies the argument values and coroutines cannot be copied, co cannot be passed as an argument, so we use a nested function with co as an upvalue instead coroutine.resume(co) end setTimer(resumeThisCoroutine, time, 1) --we set a timer to resume the current thread later coroutine.yield() --we pause the execution, it will be continued when the timer calls the resume function end -----------example----------- function pauseExample(a, b, c) outputChatBox("Started the execution. a value: "..tostring(a)) sleep(5000) outputChatBox("Waited 5 seconds. b value: "..tostring(b)) sleep(5000) outputChatBox("Waited 10 seconds, finishing the execution. c value: "..tostring(c)) end callFunctionWithSleeps(pauseExample, 1, 2, 3)
Kod--https://forum.mtasa.com/topic/54787-simple-sleep-function/function callFunctionWithSleeps(calledFunction, ...) local co = coroutine.create(calledFunction) --we create a thread coroutine.resume(co, ...) --and start its execution end function sleep(time) local co = coroutine.running() local function resumeThisCoroutine() --since setTimer copies the argument values and coroutines cannot be copied, co cannot be passed as an argument, so we use a nested function with co as an upvalue instead coroutine.resume(co) end setTimer(resumeThisCoroutine, time, 1) --we set a timer to resume the current thread later coroutine.yield() --we pause the execution, it will be continued when the timer calls the resume function end -----------example----------- function pauseExample(a, b, c) outputChatBox("Started the execution. a value: "..tostring(a)) sleep(5000) outputChatBox("Waited 5 seconds. b value: "..tostring(b)) sleep(5000) outputChatBox("Waited 10 seconds, finishing the execution. c value: "..tostring(c)) end callFunctionWithSleeps(pauseExample, 1, 2, 3) Merhabalar, hiç setTimer gibi saçmalıklara gerek yok dostum bir for döngüsü oluşturup Asenkron olarak 1100 Milisaniye de bir (sleep(1100)) modları yüklersen herhangi bir fps düşüklüğü yaratmayacaktır. (bu ortalama oyuncular için) Eğer istersen bunu biraz daha geliştirip kullanıcının vRAM miktarına göre milisaniyeyi arttırabilir ya da düşürebilirsin. Değiştirmen gereken kısım replaceDFF ve replaceTXD olan kısmı geriye kalan loadTXD ve loadDFF herhangi bir sorun işgal etmemekte.