Jump to content

IIYAMA

Moderators
  • Posts

    6,060
  • Joined

  • Last visited

  • Days Won

    208

Everything posted by IIYAMA

  1. 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.
  2. 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
  3. 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.
  4. 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
  5. 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.
  6. 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)
  7. 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...
  8. Maybe you find something here: https://wiki.multitheftauto.com/wiki/DxGetStatus The textures are the last thing in the world to load.
  9. That will probably happen when this doesn't get activated so much: https://wiki.multitheftauto.com/wiki/OnClientElementStreamIn
  10. 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).
  11. Use the <a href="url"></a>. https://developer.mozilla.org/nl/docs/Web/HTML/Element/a
  12. 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.
  13. I am posting informative content. If you want help, then do the same.
  14. Add the html file (and other web files) in to your meta.xml Follow the example of this page: https://wiki.multitheftauto.com/wiki/GuiCreateBrowser Enable: isLocal: Sets whether the browser can only show local content or content from the internet (see examples over here for more information) loadBrowserURL(webBrowser, "http://mta/local/index.html") This is your root: http://mta/local/ And you are ready to go!
  15. getPedAnimation Isn't available serverside. It clearly says: Client-only function
  16. It should do the same thing, even though removeElementData would do a quicker job. At least forcing it to be removed.
  17. Then there is no difference I think.
  18. hmm, interesting. That is a very big difference. And what happens if you change this: local prepareLargePacket1 = {} local prepareLargePacket2 = {} for i=1, 1000 do prepareLargePacket1[i] = false prepareLargePacket2[i] = nil end -- NEW -- prepareLargePacket1[#prepareLargePacket1 + 1] = 1 prepareLargePacket2[#prepareLargePacket2 + 1] = 1 --------- It should check if the there are any nil parameters removed before sending.
  19. This is not a lua question, but more like a MTA question. Because MTA responsible for sending the data. If you want to know which one uses less data, then this is one of the ways to do this: (I am not sure if lua in elementdata is used differently in the network in compare to trigger events, but I don't think so.) Client local prepareLargePacket1 = {} local prepareLargePacket2 = {} for i=1, 1000 do prepareLargePacket1[i] = false prepareLargePacket2[i] = nil end triggerLatentServerEvent ("test1", resourceRoot, unpack(prepareLargePacket1)) local eventHandles = getLatentEventHandles() local eventHandle1 = eventHandles[#eventHandles] local status1 = getLatentEventStatus(eventHandle1) if status1 then iprint("status1 totalSize:", status1.totalSize) end --------------------------------------------------------- --------------------------------------------------------- triggerLatentServerEvent ("test2", resourceRoot, unpack(prepareLargePacket2)) local eventHandles = getLatentEventHandles() local eventHandle2 = eventHandles[#eventHandles] local status2 = getLatentEventStatus(eventHandle2) if status2 then iprint("status2. totalSize:", status2.totalSize) end Server addEvent("test1", true) addEvent("test2", true) Let me know what the answer is!
  20. onClientResourceStart > triggerServerEvent > get all the paintjobs from a table > triggerClientEvent
  21. The gui of the freeroam gamemode is uncompiled. https://community.multitheftauto.com/index.php?p=resources&s=details&id=43 If you want another version, then you should ask the owner of that version.
  22. Replace line 31: addCommandHandler ( 'reloadcar', replaceModel)
  23. Ah, don't worry about the garbage collector. It is an automatic system that removes inaccessible objects and content when it's buffer is full. Just script how you want! The readability is after al your performance!
  24. @Fist Why do you declare the variable outside of the function? (Just wondering) In lua there is no performance difference if you declare them inside or outside of a function.(unlike some other languages) You just want them as fast as possible out of your memory.
×
×
  • Create New...