Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 29/07/19 in all areas

  1. I want to share this tool and method to optimize PNG files, which are used a lot in gamemodes. This topic will focus on a tool called ZopfliPNG (which I built from source and will provide a file download for) - refer to the bottom of this topic, step 2 for that. https://github.com/google/zopfli Because of the intensive usage of PNG in MTA, optimizing them will benefit total download size for players and performance. 1) use Paint.NET software (https://www.getpaint.net/) to resize your image's resolution (CTRL + R), for example half it with the power of 2, like 256 x 256 to 128 x 128. Depending on the type of image or how far whatever script zooms it, you can go beyond that and make it even lower. Use default settings for saving it, you don't have to worry about size optimization yet. Drawing a lot of high resolution images or textures will affect client performance, and cause lag on low-end PC's. So following this step is highly recommended. You can always gauge the quality outcome while you're saving it using a lower resolution. Note: you can skip this step, if you care more about file & DL size rather than client rendering/memory performance, or if the type or usage of your image(s) result in rapid deterioration in quality upon resizing. By not doing this, and sticking to the main subject of this guide, ZopfliPNG from step 2, you will keep the same quality but only get a file size reduction. After doing the initial optimization with Paint.NET, which is the part that matters to client (rendering) performance, you'd usually think that is the end of it, that the file size Paint.NET outputs (on the various saving profiles, like bit depths, you compare) is the best you can get. But you're wrong, since advanced software like ZopfliPNG can squeeze more out of it, notably most of all without any quality decrease. It's software that assembles PNG format compression from scratch, with all pixels matching 100%. So there's no reason not to do it, also if you didn't initially use step 1) about Paint.NET resizing/actual image tweaks. So, to get a lower size, it's not neccesary to compromise more of your image quality using editing, like resize even more in Paint.NET. So now to get to the point of this guide; 2) ZopfliPNG Download it from: LINK (click) Usage instructions are in the README.txt files in either 32-bit or 64-bit version folders. It's a command-line utility, you can use it in the simplest way by entering this into cmd from the binary's location (after copying your png files): This will optimize the file using default configuration, which guarantees 100% matching pixels (absolutely no worse quality) and usually a huge reduction in file size. As I mentioned in one of the notes, you will benefit also if you won't "pre-process" your PNG's using Paint.net, but only use ZopfliPNG, to not possibly impact your quality but still get a lower resources download size. As you can see here; I made sure to document its usage (README.txt) and included mass optimization (multiple files at once) .bat files, their usage also explained in README.txt. Unfortunately this is as close we can get to mass-optimizing files, because i built zopflipng.exe from original ZopfliPNG source code (https://github.com/google/zopfli) and it doesn't currently feature it in a more convenient way (without having to edit/specify ranges of file names to optimize). Here's some additional information on ZopfliPNG and why it is so groundbreaking over other compression tools: https://ariya.io/2016/06/using-zopfli-to-optimize-png-images https://blog.codinghorror.com/zopfli-optimization-literally-free-bandwidth/ No other tool can theoretically achieve this, let alone with 100% quality preservation. It's state-of-the-art technology. Edit (25th Dec 2019): updated ZopfliPNG binaries (re-built from latest official repository version)
    1 point
  2. 1 point
  3. سلام عليكم ورحمة الله آخخبااركم ان شاء الله طيبين ------------------------------------- في هذا الموضوع عندي مود متجر يشتغل بالنقاط يعني عندك نقاط تشتري بها اسلحه ودم ودرع الخخ لمعرفة كل شي عن المود في هذا الرابط / الفيديو وبالتـــوفييقء ~~  |~ الإهداءات ~| @!#DesTroyeR_,) @Kareem Amer @MrKAREEM @Mr.Falcon @DABL @KillerX @NX_CI @[AcM] - Major . @MR_Mahmoud @Ahmed Ly @MR.Mosa @N3xT @Abu-Solo @SuperX @#BrosS @iMr.WiFi..! @Mr.CnTroL @Abdul KariM @Hakan @!#NssoR_) @Simple. @Abdo Nour و جميع أعضاء المنتدى
    1 point
  4. سلام عليكم ورحمة الله آخخبااركم ان شاء الله طيبين ------------------------------------- في هذا الموضوع عندي مود الميني مسج يعني تقدر ترسل رساله لشخص محدد بمبلغ من المال ض2 لمعرفة كل شي عن المود في هذا الرابط / الفيديو وبالتـــوفييقء ~~  |~ الإهداءات ~| @!#DesTroyeR_,) @Kareem Amer @MrKAREEM @Mr.Falcon @DABL @KillerX @NX_CI @[AcM] - Major . @MR_Mahmoud @Ahmed Ly @MR.Mosa @N3xT @Abu-Solo @SuperX @#BrosS @iMr.WiFi..! @Mr.CnTroL @Abdul KariM @Hakan @!#NssoR_) @Simple. @Abdo Nour @MR-HERO و جميع أعضاء المنتدى
    1 point
  5. Leia: https://wiki.multitheftauto.com/wiki/PT-BR/Manual_do_Servidor https://wiki.multitheftauto.com/wiki/PT-BR/Recursos @Pedro mayeer
    1 point
  6. Thanks! Everything works.
    1 point
  7. Thanks! Everything works.
    1 point
  8. It seems like you copied some wrong (invisible) characters in to your code. (can happen with the forum text editor, not sure what the issue is) I cleaned it for you. addEvent("PlayerCheck", true) function PlayerCheck(player, username, password) if type(username) == "string" and type(password) == "string" then local qh_account = dbQuery(db, "SELECT * FROM accounts WHERE username=? LIMIT 1", username) local result_account = dbPoll(qh_account, -1)[1] if result_account then if result_account.password == password then else end else end end end addEventHandler("PlayerCheck", root, PlayerCheck)
    1 point
  9. @Mr. Maxilian Afaik yes, but you still need to (manually) debug it in order to figure out it is 100% working. As being a human I can overlook things after all.
    1 point
  10. Correctly? addEvent("PlayerCheck", true) function PlayerCheck(player, username, password) if type(username) == "string" and type(password) == "string" then local qh_account = dbQuery(db, "SELECT * FROM accounts WHERE username=? LIMIT 1", username) local result_account = dbPoll(qh_account, -1)[1] if result_account then if result_account.password == password then-- success else-- wrong password  end else-- wrong username  end end end addEventHandler("PlayerCheck", root, PlayerCheck)
    1 point
  11. Ah yea. (and I also wrote a wrong example. ops sorry) How about something like this? if type(username) == "string" and type(password) == "string" then local qh_account = dbQuery(db, "SELECT * FROM accounts WHERE username=? LIMIT 1", username) local result_account = dbPoll(qh_account, -1)[1] if result_account then if result_account.password == password then -- success else -- wrong password end else -- wrong username end end
    1 point
  12. Nice vídeo bro thanks
    1 point
  13. local selection = dbQuery(db, "SELECT * FROM accounts WHERE username=? AND password=? LIMIT 1", username, password) P.s. you shouldn't never save un-hashed passwords in the database. Yet, one step at the time.
    1 point
  14. Ele está procurando isso na linha 9. local rand = math.random(1, 5) Mas não prestei atenção se foi removido de propósito.
    1 point
  15. Ae mano consegui obrigado a todos que me ajudaram.
    1 point
  16. É por causa da linha 17. Aqui está o código corrigido:
    1 point
  17. Já tentou com onResourceStop?
    1 point
  18. Não seria melhor ter feito tudo junto? SpawnM = createMarker (-2396.8295898438, -617.03546142578, 131.75123596191, "cylinder", 1.5, 255, 255, 255, 50) function msg (player) if (player) and (getElementType (player) == "player") then outputChatBox ("Você foi congelado até iniciar o Round!!", player, 255, 255, 255) setElementFrozen (player, true) end end addEventHandler ("onMarkerHit", SpawnM, msg)
    1 point
  19. Salut les gars, Finalement avec l'aide de mon collègue nous avons parvenu à fonder ce fameux script ! Merci encore !
    1 point
  20. Não vai deixar lento. Tente: function getPlayer(player, cmd, id) if tonumber(id) then local mx, my, mz = getElementPosition(player) local player2 = getPlayerFromID ( tonumber(id) ) if not player2 or not isElement(player2) then return outputChatBox( "Player Offline", player ) end local trplayername = getPlayerName(player):gsub("#%x%x%x%x%x%x","") setElementPosition(player2, mx+rand, my+rand, mz + 1) for i, p in ipairs(getElementsByType("player")) do local xp, yp, zp = getElementPosition ( p ) if getDistanceBetweenPoints3D ( mx, my, mz, xp, yp, zp ) <= 50 then outputChatBox ( "#c9c9c9[#1a6cefFW-COMANDO#c9c9c9]O #1a6cef".. trplayername .."#c9c9c9 Puxou o #1a6cef".. tostring(id), p, 255, 0, 0, true ); end end end end addCommandHandler("tr", getPlayer)
    1 point
  21. Você só pode estar usando o comando kick como eu falei, por isso tá sempre kickando mesmo com a função banPlayer. Teste o meu código e use /kickar que vai funcionar.
    1 point
  22. kick é um comando do resource admin, vai executar ele quando usar o comando. Mude para outro nome ou remova o kick do admin. Tente isto: function kikarplayer ( source, commandName, kickedName, ... ) if isPlayerInACL(source, "Admin") or isPlayerInACL(source, "SuperModerator") or isPlayerInACL(source, "Console") then local r = {...} if not kickedName or #r == 0 then return outputChatBox ("#bf2e2e* Erro: /kick [nick] [motivo]", source, 255, 255, 255, true) end local kickerName = getPlayerName(source):gsub("#%x%x%x%x%x%x","") local kickedPlayer = getPlayerFromPartialName(kickedName) if not isElement(kickedPlayer) then return outputChatBox ("#bf2e2e* Erro: Player Invalido!", source, 255, 255, 255, true) end local reason = table.concat(r," ") outputChatBox ( "#c9c9c9[#1a6cefFW-INFORMA#c9c9c9]O #1a6cef"..kickerName.." #c9c9c9Kickou o Player #1a6cef" ..getPlayerName(kickedPlayer):gsub("#%x%x%x%x%x%x","").. "#c9c9c9 | Motivo #1a6cef" ..reason.. "#c9c9c9", getRootElement(), 255, 0, 0, true ) kickPlayer ( kickedPlayer, source, reason ) else outputChatBox ("#bf2e2e* Erro: Você Não tem Permissão!", source, 255, 255, 255, true) end end addCommandHandler("kickar", kikarplayer) function isPlayerInACL(player, acl) local accountName = getAccountName( getPlayerAccount(player) ) if accountName ~= "guest" and type( aclGetGroup(acl) ) == "userdata" then return isObjectInACLGroup( "user."..accountName, aclGetGroup(acl) ) end return false end function getPlayerFromPartialName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end
    1 point
  23. Hello, We, the eXo-Reallife team, would like to release a module that is also used on our server. It is a pathfinding module developed by Jusonex and StiviK. The module uses the A * algorithm. (https://en.wikipedia.org/wiki/A*_search_algorithm) We use this for our GPS: Why did we develop a module for this and did not simply write a script? This has a very simple reason. The module calculates the routes in your own threads, which has the advantage that it is much faster than a script, and secondly, you can calculate how much routes as you want side by side. This will not cause any lags etc.! What are the features of the module? The module can load several graphs / nodes side by side The module calculates the routes in its own threads Very useful API functions (such as findNodeAt or getNodeNeighbors) What are the main features? int loadPathGraph (String pathToGraphFile) This function loads the graph from the given file and returns a GraphId which you need for all other functions. If something does not work, false is returned. bool findShortestPathBetween (int graphId, float startX, float startY, float startZ, float endX, float endY, float endZ, function callback) This function finds the shortest route between the points. (Unfortunately, no vectors can be handed over!) The callback function is called when the calculation is finished. As an argument, either a table is returned that contains all nodes, or false if no route is found. bool unloadPathGraph (int graphId) You can use this function if you no longer need and want to unload the graph, it returns true if everything is fine, false if an error has occurred. You will find all the other functions that are included in our documentation. Why is the eXo team releasing all this? Well, that has the simple reason, we want to share our work with others and not just keep it for us! We hope we can enrich you with it and vlt. Even help! Where can I download the module? The whole module is open-source and can be viewed in our GitHub organization. It's released under the MIT License. GitHub organization: https://github.com/eXo-MTA Repository: https://github.com/eXo-MTA/ml_pathfind Download the module (Windows / Linux): https://github.com/eXo-MTA/ml_pathfind/releases Nodes of all roads in SA: https://github.com/eXo-MTA/ml_pathfind/blob/master/test/sa_nodes.json If you find any mistakes or suggestions, you can simply create a new issue and we will look into it. So now that's it, have fun with the module! - StiviK and the eXo-Reallife team (Original thread in German: https://www.mta-sa.org/thread/36365-release-mta-sa-pathfinding-module/?postID=407938#post407938)
    1 point
×
×
  • Create New...