-
Posts
6,097 -
Joined
-
Last visited
-
Days Won
218
Everything posted by IIYAMA
-
White image gets black borders when scaling down height
IIYAMA replied to John Smith's topic in Scripting
P.s. a week ago I did a test with loading images in to textures, these are the test results: Converted 1000x images to textures. Converted to: dxt5 and mipmap Format: png (uncompressed) Load time: 2262ms Filesize: 64,2kB Format: dds Load time: 2093ms Filesize: 64,1kB Format: dds + mipmap Load time: 2000ms Filesize: 85,4kB Format: dds + dxt5 Load time: 1024ms Filesize: 16,1kB Format: dds + dxt5 + mipmap Load time: 470ms Filesize: 21,4kB Compressed dds textures files with embedded mipmap, can be converted 4 times faster to optimised render images(with mipmap) than the default png files. Load time: 470ms VS Load time: 2262ms (1000x loading) Test image(png): 128 x 128 While loading the textures in to the memory. Converted to: dxt5 (and mipmap) Format: dds + dxt5 + mipmap Filesize: 21,4kB VS Converted to: (mipmap) Format: png (uncompressed) Filesize: 64,2kB -
White image gets black borders when scaling down height
IIYAMA replied to John Smith's topic in Scripting
To be honest, I have no idea why this is happening. It might be because of the complexity, but at the end the reader and converter is resonsible for it. There is one last format you can try. It is called: dds Which is a format that can be used directly in to the memory of your video card. https://en.m.wikipedia.org/wiki/DirectDraw_Surface The biggest down side of this format is the filesize It also has the option to pre-compress them with dxt 1, 3 or 5.(quality will drop of course) (Must be a power of two. e.g. 128, 256) . Read this page for more information: https://wiki.multitheftauto.com/wiki/DxCreateTexture Converter to dds: https://nightly.multitheftauto.com/files/shaders/DxTex.zip -
White image gets black borders when scaling down height
IIYAMA replied to John Smith's topic in Scripting
To prevent the gray borders, save the image as >png8<. https://helpx.adobe.com/photoshop-elements/using/optimizing-images-gif-or-png.html As you have only white, you will not have problems with the color limitations of png8. -
It can't be sorted because the indexes of the array are strings. The indexes are now: "player1", "player2", "player3", "player4", "player5" Because: { player1 = {points = 25, playerName = "RandomNick1"} } -- is them same as { ["player1"] = {points = 25, playerName = "RandomNick1"} } Before you can sort them , you need the indexes to be the ones of an array: 1, 2, 3, 4, 5 So you need to transform the keys from one form to another. simpleTable = { player1 = {points = 25, playerName = "RandomNick1"}, -- < item player2 = {points = 1, playerName = "RandomNick2"}, player3 = {points = 13, playerName = "RandomNick3"}, player4 = {points = 27, playerName = "RandomNick4"}, player5 = {points = 7, playerName = "RandomNick5"} } -- Make a new empty table. newSimpleTable = {} -- Use the pairs loop. (not the ipairs loop, because that one can't read the items with custom keys) for key, data in pairs(simpleTable) do -- Insert all items into the new table. newSimpleTable[#newSimpleTable + 1] = data end -- Now you can sort them. table.sort (newSimpleTable, function (a, b) return a.points > b.points end)
- 1 reply
-
- 2
-
-
This one: https://wiki.multitheftauto.com/wiki/FadeCamera
-
It isn't limited. But you may lose overview if you spam it from too many different components.
-
local vehicleHealth = getElementHealth(source) outputChatBox("My vehicle health is: " .. tostring(tonumber(vehicleHealth) or "?"))
-
You are setting the angleAmount to 1 and not to 45. Use 5e argument and not 3e argument. 1, 2, 3, 4, 5, ... posX, posY, radius, width, angleAmount dxDrawCircle( 200, 200, 45, 5, HERE, 0, 90 )
-
I can't look at it and help you, if you don't post it.
-
angleAmount 360 / 8 = 45 Just play with it and debug it. It is the only way to understand it...
-
You can make a hexagon with circle math. Just limit the points to 8. https://wiki.multitheftauto.com/wiki/DxDrawCircle If you also want fill it, you can use the local mta browser to draw svg.
-
Option 1. You will have to inject wrapper code in to the map. The meta can identify if it needs the injection yes and no. This could be applied directly after the gamemode has started and before the gamemode map has been loaded. (Option 2) Maybe it helps, maybe it doesn't. (not sure if there are changes in this, when different textures are applied. It might also only return the replacement names, not sure.) I have never used it before. https://wiki.multitheftauto.com/wiki/EngineGetModelTextureNames
-
How about starting with the map meta.xml itself? https://wiki.multitheftauto.com/wiki/Resource:Mapmanager onGamemodeMapStart function loadMap(startedMap) https://wiki.multitheftauto.com/wiki/GetResourceName https://wiki.multitheftauto.com/wiki/XmlLoadFile https://wiki.multitheftauto.com/wiki/XmlNodeGetChildren https://wiki.multitheftauto.com/wiki/XmlNodeGetName Node name: file Attribute: src And check for extensions.
-
That is because resourceRoot is a child of the root. But in this case the one that is accepted is the child and the one that is send is the parent. Childs do not accept parents, parents only accept childs or itself. But you already knew that didn't you? https://wiki.multitheftauto.com/wiki/File:Tre.png
-
local data = {0, 2, 4, 0, 0} local definition = {"w", "d", "h", "min", "sec"} local theString = "" for i=1, #data do local item = data[i] if item ~= 0 then theString = theString .. definition[i] .. item .. " " end end print(theString) Prototype.(mobile) WARNING: [gameplay]/killcount-scoreboard/server.lua 62. bad argument @ 'getAccountName' [Expected element at argument 1] [DUP x11] . This means that the variable you tried to get account data from isn't an element. Validate your data before using it.
-
For every message from client to Server, validate if the user is Admin. And do not insert things directly in your db string, but let MTA escape them.(mysql injections)
-
https://wiki.multitheftauto.com/wiki/GetCommandsBoundToKey https://wiki.multitheftauto.com/wiki/GetKeyBoundToCommand Damn, why I am posting on a very old topic!!! No..no... @Salem...
-
How to know whether the world objects have been loaded
IIYAMA replied to John Smith's topic in Scripting
Maybe you find something here: https://wiki.multitheftauto.com/wiki/DxGetStatus The textures are the last thing in the world to load. -
How to know whether the world objects have been loaded
IIYAMA replied to John Smith's topic in Scripting
That will probably happen when this doesn't get activated so much: https://wiki.multitheftauto.com/wiki/OnClientElementStreamIn -
https://wiki.multitheftauto.com/wiki/AddEventHandler Optional Arguments getPropagated: A boolean representing whether the handler will be triggered if the event was propagated down or up the element tree (starting from the source), and not triggered directly on attachedTo (that is, handlers attached with this argument set to false will only be triggered if source == this).
-
For starters, how about you are going to look at it from `helper` perspective. What does the helper need, to solve the issue? When does the helper actually takes time to help somebody? So: What did you try?(lua) How you organized your meta.xml? How you organized your files? (How does your website looks like in the default browser?) Etc. How am I suppose to figure out what your problem is, if I can't match the problem, with the thing that creates the problem in the first place? I am not going to ask you to do those things mate, you have to do those automatic.
