Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 28/05/20 in all areas

  1. function removeHex(str) local nString = str while string.find(nString, "#%x%x%x%x%x%x") do nString = string.gsub(nString, "#%x%x%x%x%x%x", "") end return nString end Código correto que deve ser usado, para que os jogadores não possam burlar, usando duas cores.
    2 points
  2. 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
  3. يأنها ملفات أو هاك , اذا ملفات امسح جراند (GTA SA) وحملها مره اخرى ..
    1 point
  4. usar string.gsub addEventHandler("onPlayerJoin", getRootElement(), function() local nome = getPlayerName(source) local novoNome = string.gsub( nome, '#%x%x%x%x%x%x', '' ) if (novoNome ~= nome) then setPlayerName(source, novoNome) end end
    1 point
  5. you can add a command for it so people can bind the command with whatever key they are comfortable with in game using /bind key commandName addCommandHandler("inventory", inventory)
    1 point
  6. Pq vc colocou no meta o tipo client mas o script é server. Dai não vai funcionar mesmo.
    1 point
×
×
  • Create New...