Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/01/21 in all areas

  1. @IIYAMA Perfect! You're the best!
    1 point
  2. The checkPassiveTimer from the wiki page: https://wiki.multitheftauto.com/wiki/CheckPassiveTimer do local passiveTimerGroups = {} local cleanUpInterval = 240000 local nextCleanUpCycle = getTickCount() + cleanUpInterval local onElementDestroyEventName = triggerServerEvent and "onClientElementDestroy" or "onElementDestroy" local function isEventHandlerAdded( eventName, elementAttachedTo, func ) -- https://wiki.multitheftauto.com/wiki/GetEventHandlers local attachedFunctions = getEventHandlers( eventName, elementAttachedTo ) if #attachedFunctions > 0 then for i=1, #attachedFunctions do if attachedFunctions[i] == func then return true end end end return false end --[[ Remove passive timers of elements that are destroyed ]] local function removeDeletedElementTimer () for timerName, passiveTimers in pairs(passiveTimerGroups) do if passiveTimers[this] then passiveTimers[this] = nil if not next(passiveTimers) then passiveTimerGroups[timerName] = nil end end end removeEventHandler(onElementDestroyEventName, this, removeDeletedElementTimer) end --[[ Make a clean up cycle to prevent a memory leak ]] local function checkCleanUpCycle (timeNow) if timeNow > nextCleanUpCycle then nextCleanUpCycle = timeNow + cleanUpInterval local maxExecutionTime = timeNow + 3 for timerName, passiveTimers in pairs(passiveTimerGroups) do for key, executionTime in pairs(passiveTimers) do if timeNow > executionTime then if isElement(key) and isEventHandlerAdded(onElementDestroyEventName, key, removeDeletedElementTimer) then removeEventHandler(onElementDestroyEventName, key, removeDeletedElementTimer) end passiveTimers[key] = nil end end if not next(passiveTimers) then passiveTimerGroups[timerName] = nil end --[[ Just making sure that during the clean-up cycle no lag spike occur. ]] if getTickCount() >= maxExecutionTime then break end end end end function checkPassiveTimer (timerName, key, timeInterval) if type(timerName) ~= "string" then error("bad argument @ 'checkPassiveTimer' [Expected string at argument 1, got " .. type(timerName) .. "]", 2) elseif key == nil then error("bad argument @ 'checkPassiveTimer' [Expected anything except for nil at argument 2, got nil]", 2) end local intervalType = type(timeInterval) if intervalType == "string" then timeInterval = tonumber(timeInterval) if not timeInterval then error("bad argument @ 'checkPassiveTimer' [Expected a convertible string at argument 3]", 2) end elseif intervalType ~= "number" then error("bad argument @ 'checkPassiveTimer' [Expected number at argument 3, got " .. type(timeInterval) .. "]", 2) end --[[ Set-up the timer ]] local passiveTimers = passiveTimerGroups[timerName] if not passiveTimers then passiveTimers = {} passiveTimerGroups[timerName] = passiveTimers end local timeNow = getTickCount() local executionTime = passiveTimers[key] if executionTime then if timeNow > executionTime then passiveTimers[key] = timeNow + timeInterval checkCleanUpCycle(timeNow) return true, 0 end checkCleanUpCycle(timeNow) return false, executionTime - timeNow end if isElement(key) and not isEventHandlerAdded(onElementDestroyEventName, key, removeDeletedElementTimer) then addEventHandler(onElementDestroyEventName, key, removeDeletedElementTimer, false, "high") end passiveTimers[key] = timeNow + timeInterval checkCleanUpCycle(timeNow) return true, 0 end end
    1 point
  3. Hi. We hope that all of you are safe and healthy. The year of 2020 is finally coming to an end, so here is our traditional "A year in Recap" post for you. Below you can find the summary of what has happened during this year and a handful of other things that might be interesting to you. ?️ 2020 in Recap Surely, it is hard to mention this year without mentioning the COVID-19 pandemic. Many lives were lost and millions of people had to deal (and still cope) with the consequences of the disease. The pandemic had locked many of us down in our homes and forced us to change our lifestyles. These were the times when MTA:SA had seen the biggest number of players ever recorded. The achieved popularity growth still seems to be present even today, when you compare this year's numbers to the ones from a year before. April has marked the third anniversary of the opening of our Discord and a lot of things have changed since then. We have introduced more regional channels and made it easier to contact our team if you had an important matter to discuss. We have also made it easier for new users to check and accept our Discord Rules in their language. Our server has over 15.000 members nowadays (even after a little miss-click on the Purge users button during the year ?) and we are still working towards getting even more members. Some work has been done on reviving the AMX Compatibility Layer module. It can be used for running the existing PAWN gamemodes, filterscripts and plugins in MTA:SA. There is a public beta build for the Windows server if you would like to try it out. The module is open source - so you are more than welcome to contribute to it too. We have released Multi Theft Auto: San Andreas 1.5.8 in October. The changes in this release were mostly community contributions, improvements and bugfixes. It took us more time than usual to publish it, as nearly 407 days have passed since the last release. We hope that it was a polished enough build to be worthy of the wait. Aside of that, we have been experimenting with doing some MTA:SA related streaming on our Twitch channel for a while. Woovie has done an excellent job on these streams and covered a bunch of topics, such as the community servers and gamemodes reviews, Lua scripting and doing code reviews and QA. If you have not seen them, we have put some of them on our YouTube channel. Our Forums were overhauled this year. In addition to that, one of our community members has recently made a brief post about how the Forums have changed over the years. It is nice to see that there are people out there who are interested in the historical side of things too. ?️ A bunch of interesting MTA:SA-related YouTube videos from this year [DM] Disaster ft. BriaN - ABZU by Gerc & others Bullet physics in mta, progress by CrosRoad95 MASSACRE | NON-STOP MTA DAYZ by supraaa & others MTA Racing Tutorials || PART 3 || Useful ways for San Andreas racing. by Vilgefortz & others MTA: SAAW Star Wars - Kamino map pre-Alpha rare leaked footage by Einheit-101 MTA: Lumiverse: Atlas - Server - Dashboard (In-Depth Analysis) by lumiverse Rabbit hunt script for MTASA with extra map & skin mod by "Press start to begin" / True_Killuminati ! Epilepsy warning ! [DM] NeiT Vol.9 - Image Distortion by RRecords & others ? Current player counts and version fragmentation statistics Type Amount of players Date / Time Recent peak number of concurrent unique players 38 696 players 2020.12.19 (at 18.00 GMT) Highest recorded number of concurrent unique players 52 098 players 2020.04.02 (at 18.00 GMT) Recent number of daily unique players 153 033 players 2020.12.20 (Sunday) Highest recorded number of daily unique players 185 818 players 2018.02.03 (Saturday) Recent number of monthly unique players 647 317 players November, 2020 Highest recorded number of monthly unique players 805 903 players January, 2018 The numbers are slightly bigger than in the last year. Some of the records were not beaten, but were a really close call. For example, nearly 800 000 unique players had played this year in April! And our recent concurrent unique players peaks are bigger than our last year's records for that. How does this compare to modern games, you may ask? You can check it yourself by visiting the Steam Stats page. Powerhouses like GTA V, CS:GO, PUBG and Cyberpunk 2077 have much higher peak players numbers, but we are surely close to some of the other well-known games - for instance Civilization VI, Terraria, Euro Truck Simulator 2 or Garry's Mod. We are even surpassing the recent player counts of games, such as Left 4 Dead 2, Europa Universalis IV or Borderlands 3 (at least on Steam). MTA:SA version or series Percentage of players using that version or series as of 23rd of December, 2020 1.6.0 (alpha; custom) 0.1% 1.5.8 98% 1.5.7 1.7% 1.5.6 (and older) 0.1% 1.4.x + 1.3.x 0.1% The latest versions are the most popular ones so the version fragmentation is not much of a problem. ? Status updates In terms of the mod development, we have been mostly monitoring the situation after the recent release for now. We have also received some nice contributions from the community developers, like the work done by fastman92 to improve MTA:SA's compatibility with fastman92 limit adjuster. Patrik has been putting a lot of effort into designing the new Community site - we would love to see those designs replace the old site one day. Team-wise, we are in process of doing major inner changes in order to improve the transparency and the quality of our work. These changes will be hard to notice at first, as they are strictly related to our Team's organization and policies (they will especially affect the Moderators Team). After a while though, you might be able to see their effects for yourself as well. That's it for now. ? ? Happy Holidays and best wishes to all of you! Let's hope that 2021 will be better than 2020. ?️ ? -- MTA Team
    1 point
  4. @Otavionão se usa source como parâmetro de função. @[C]outofaça o script server-side, com onVehicleExit e utilizando o parâmetro do assento para saber se foi o motorista que saiu do veículo. function desblindar (thePed, seat) if (seat == 0) then if (getElementData (thePed, "Modo Passivo")) then setVehicleDamageProof (source, false) outputChatBox ("Seu veículo agora está destrutível.", thePed) end end end addEventHandler ("onVehicleExit", root, desblindar)
    1 point
  5. Correct - Magic TXD is very easy to use. You can still use TXD Workshop, but only to extract the .txd file into a folder. From there, open Magic TXD and open the .txd file that you extracted. You can then choose 'extract to PNG' and it's done. صحيح - Magic TXD سهل الاستخدام للغاية. لا يزال بإمكانك استخدام TXD Workshop ، ولكن فقط لاستخراج ملف .txd إلى مجلد. من هناك ، افتح Magic TXD وافتح ملف txd الذي قمت باستخراجه. يمكنك بعد ذلك اختيار "extract to PNG" ويتم ذلك.
    1 point
  6. Make sure that you have TXD Workshop 5.3. تأكد من أن لديك TXD Workshop 5.3. https://www.gtagarage.com/mods/show.php?id=8320 However, there's a much better program for creating or editing .txd files. It's called Magic TXD. You will need to extract the .txd files first though, as it cannot open .img file, unlike TXD Workshop. ومع ذلك ، هناك برنامج أفضل بكثير لإنشاء ملفات .txd أو تحريرها. إنه يسمى Magic TXD. ستحتاج إلى استخراج ملفات .txd أولاً ، لأنه لا يمكن فتح ملف .img ، على عكس TXD Workshop. https://www.gtagarage.com/mods/show.php?id=27862
    1 point
  7. weak scripts, but big price, no offence
    1 point
  8. isso, desta maneira !. Boa @ber
    1 point
  9. function onClick(button, state) if button == "left" then if state == "down" then tick = getTickCount() elseif state == "up" then if (getTickCount() - tick) >= 3000 then --PROSSIGA SEU SCRIPT AQUI else outputChatBox("Você precisa pressionar o botão por 3 segundos") end end end end addEventHandler("onClientClick", root, onClick)
    1 point
  10. local pressing = false bindKey("k", "both", function(_, state) if state == "down" then if not pressing then pressing = getTickCount() end elseif state == "up" then if pressing and pressing + 3000 >= getTickCount() then pressing = false outputChatBox("* Erro: você deve segurar por 3 segundos.", 255, 0, 0) else pressing = false -- executa a função que você quer end end end) pega este exemplo tente elaborar uma lógica.
    1 point
  11. I back to work on BP! I Successfully added support for multithreading, so simulation will work smooth until you get crazy. Also set of function get changed, old function has changed and new get added. Here's current progress:
    1 point
×
×
  • Create New...