Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/08/20 in Posts

  1. If you could go with tables, then do it. From my own experience, i'd say that tables are way more efficient rather than element data. However you should remember about few things, when it comes to passing data (doesn't matter if it's element data or tables). 1) How often data is passed - the less - the better (use timers for reduction, aka buffers; collect pack of data, and then send it after 100-200 ms). 2) How much data do you pass - if you do not need to pass whole data, then don't do it (unless on init). Send certain values. 3) How you pass data - it should be well maintained to avoid issues. With tables it's easier to do. Haven't using using element data for a long time, but i'm pretty sure that: setElementData(client, "data", true) -- equals to 1 triggerClientEvent So every call of element data is one trigger, which is pretty bad. Imagine that you need to set 30 data at once (feels bad). You can see that tables won here local dataTable = {} local playerElement = getPlayerFromName("SERIOUSLY?") dataTable[playerElement] = {} dataTable[playerElement][1] = "First index." dataTable[playerElement][2] = "Second index." triggerClientEvent(root, "onClientDataSync", resourceRoot, dataTable) -- 1 call setElementData(playerElement, "First index", true) -- 1 call setElementData(playerElement, "Second index", true) -- 2 call -- Element data will trigger separately for each call. 4) Don't do those: local players = getElementsByType("player") local playerElement = false for i = 1, #players do playerElement = players[i] triggerClientEvent(playerElement, "onClientEvent", playerElement) end This will cause that triggerClientEvent will be called * count of players. Instead do: local players = getElementsByType("player") triggerClientEvent(players, "onClientEvent", resourceRoot) Since triggerClientEvent accepts table of players. And it would be just one call. Extra code to test by @IIYAMA. local sendingDelay = 100 -- ms local fps = 60 local timeSlice = 1000/fps local dataReduction = sendingDelay/timeSlice print("~"..(dataReduction - 1 ).." x times LESS per "..sendingDelay.."ms") You can see how certain delays affect server when passing data. If you have any other questions, feel free to ask. PS: Recently element data got some update with subscription mode, but i still advice to go for tables if you can
    2 points
  2. Hey, This is a Cinema Gamemode inspired from Garry's Mod (Heavily lol) The building consists of 4 regular sized public theaters, and one big public theater. 3 Pool theaters (Public as well). 6 Private theaters. 1 VIP Theater. Each theater has a preview showing the thumbnail by its door, and its own chat. There is also a global chat and lobby chat. The first person to enter an empty private theater will be able to control it (Kick player, skip video, seek, lock queue and reset theater) Dissimilar: The Cinema uses embed YouTube, which means no ads but some videos may not work I can take requests for adding other services besides YouTube (Twitch can not be implemented because of MTA limitations, all the codes are there but it is switched off because it does not function properly) I do not have a price in mind since the gamemdoe wasn't made to be sold initially, I will take a fair offer.
    1 point
  3. @majqq Keep in mind that even if there is no data added, the triggerClientEvent it's (5x?) packet size is bigger than that from setElementData. And triggerClientEvent is also a lot faster and therefore it's data rate is higher, if no buffer is used, it will cause blocking the network a lot faster than with setElementData. So if you broadcast to all players, triggerClientEvent might not always be the best option, because you do not reduce data. triggerClientEvent Fast data rate / requires a slow interval Run code directly / (with elementdata that is only possible for the second time you set the data) More secure No auto download for new players Specify target players* *Before the beta from below. There is a new function available in the beta for element data, that will help shrink the data usage of players that do not need the data. https://wiki.multitheftauto.com/wiki/AddElementDataSubscriber More information here: https://wiki.multitheftauto.com/wiki/SetElementData
    1 point
  4. Remastered GTA:SA's Classic HUD Preview Download: Github Community Resources
    1 point
  5. Há diversos erros no seu código. attacker não está definido em lugar nenhum; algumas funções utilizam player e outras source (???); a função setTimer, que está dentro da função SetarCaidoComHS, não possui funcionamento nenhum, uma vez que não é passado argumentos; a função setTimer, que está fora da função, também não há função referente à ela; evento na última linha adicionado de forma incorreta. Sugiro aprender a desenvolver seus próprios códigos, com base em códigos que são bem feitos. O código que você está tentando editar é totalmente mal otimizado e possui vários erros. Consertá-los é irrelevante. Não perca tempo. Você também pode aprender mais sobre a linguagem Lua neste link.
    1 point
  6. سيرفرات الرولي بلاي كثرت .. المفروض تلاقون فكرة ثانية غير عن الرول بلاي عموما سيرفرك جميل . بالتوفيق لك
    1 point
  7. Truth - MTA Wiki Discord Bot Since i was in need for a wiki discord bot on a discord server, I decided to make one. I have also created a dashboard to manage the bot's setting on your guild. This bot is open source so feel free to submit PR's or issues. There is a new wiki coming soon(?), so i am planning to convert this bot to use the new version once it releases if there's no official wiki bot available at that time. I hope this bot can be of use to you. Features Wiki article fetching like on MTA's official discord Wiki article searching Function/Event examples Customizable bot output set via dashboard (hide syntax, hide description etc) Links https://truth.afusensi.xyz/ https://github.com/AfuSensi/truth-mta-wiki-bot
    1 point
  8. It's not a false positive, but I won't give you any information; you know exactly what you did.
    0 points
×
×
  • Create New...