Jump to content

IIYAMA

Moderators
  • Posts

    6,058
  • Joined

  • Last visited

  • Days Won

    208

Everything posted by IIYAMA

  1. See also the reply before this one. @Knuck You can also try to run the older version. Which I have personally validated.
  2. This is also an issue, you are using the wrong syntax when removing the event: removeRenderEvent(renderInventory, "onClientRender") @Knuck
  3. Add some debug lines, so that you can inform me what doesn't work.
  4. This is something you can do yourself, it isn't really that hard...
  5. I just gave you an example?
  6. @Knuck See this tool: It makes it easier to pass arguments. function viewInventory (argument1, argument2) end addRenderEvent(viewInventory, "onClientRender", argument1, argument2) removeRenderEvent(viewInventory, "onClientRender")
  7. @GodKraken Your database must have failed to load. That uncludes more warnings that you have forgot to mention. Make sure to unzip the resource before using it.
  8. There is a huge difference, MTA can create 10000+ of objects and the streamer can only load a part of it. Very hardware limited. The first example I gave you does not fix your issue directly, but it does answer your topic question. (except for the texture layer on the objects)
  9. @Overkillz Objects will only be loaded when they are streamed in. This also means that they can be unloaded and reloaded. for i=550,20000 do removeWorldModel(i,10000,0,0,0) end setOcclusionsEnabled(false) setWaterLevel(-5000) local container = createElement("container") local count = 0 local function elementCounter () count = count + 1 iprint("Streamed in: ", source, ", ", count, "/", #garageObjects) end addEventHandler("onClientElementStreamIn", container, elementCounter) for k,objects in ipairs(garageObjects) do -- garageObjects table is already defined and with values local a,b,c,d,e,f,g,h,i = unpack(objects) local object = createObject ( a,b,c,d,e,f,g ) setObjectScale(object,h or 1) setElementDoubleSided(object, i or false ) setElementDimension(object,arenaCDimension) setElementParent(object, container) -- !important end fadeCamera(true) Keep in mind that this doesn't mean that the texture has been loaded. It doesn't have to be painted to exist. I recommend to use lowLOD objects instead, those will show up faster. https://wiki.multitheftauto.com/wiki/SetLowLODElement See this useful function: https://wiki.multitheftauto.com/wiki/AssignLod function assignLOD(element) local lod = createObject(getElementModel(element),0, 0 ,0, 0, 0, 0, true) setElementDimension(lod,getElementDimension(element)) setElementPosition(lod, getElementPosition(element)) setElementRotation(lod, getElementRotation(element)) setElementCollisionsEnabled(lod,false) setLowLODElement(element,lod) return lod end
  10. Maybe: https://wiki.multitheftauto.com/wiki/GuiSetProperty http://static.cegui.org.uk/static/WindowsLookProperties.html
  11. guiGridListAddRow(scoreBoardGridList, getTeamName(team), getPlayerName(v)) It is not very flexible, but you should consider each row an item with mutiple properties. If the two columns aren't related, then you need two gridlists. @majqq
  12. 1. Try to attach the checkboxes later than the scrollbar. 1. + 2. The scroll bar is on top of the checkboxes. And the checkboxes might be on top of the scrollbar. Which focusing on an element, the order might change. This is incorrect: (main issue) guiPanel[1] = guiCreateCheckBox(0.65, 0.1, 10, 10, "Show HUD", true, true, userPanel) guiPanel[2] = guiCreateCheckBox(0.65, 0.3, 100, 100, "Show GPS", true, true, userPanel) guiPanel[2] = guiCreateCheckBox(0.65, 0.5, 100, 100, "Show Debug", true, true, userPanel) guiPanel[3] = guiCreateCheckBox(0.65, 0.7, 100, 100, "Low blood effect", true, true, userPanel) guiPanel[4] = guiCreateScrollBar(0.02, 0.3, 0.60, 0.070, true, true, userPanel) guiPanel[5] = guiCreateScrollBar(0.02, 0.5, 0.60, 0.070, true, true, userPanel) guiPanel[6] = guiCreateScrollBar(0.02, 0.7, 0.60, 0.070, true, true, userPanel) guiPanelTexts[1] = guiCreateLabel(0.14, 0.23, 30, 30, "Weapon sounds", true, userPanel) guiPanelTexts[2] = guiCreateLabel(0.54, 0.23, 30, 30, "100%", true, userPanel) guiPanelTexts[3] = guiCreateLabel(0.14, 0.43, 30, 30, "Actions sounds", true, userPanel) guiPanelTexts[4] = guiCreateLabel(0.54, 0.43, 30, 30, "100%", true, userPanel) guiPanelTexts[5] = guiCreateLabel(0.14, 0.63, 30, 30, "Radio sounds", true, userPanel) guiPanelTexts[6] = guiCreateLabel(0.54, 0.63, 30, 30, "100%", true, userPanel) 30 = 3000% 100 = 10000% @majqq = 100000000%
  13. Saving??????? This is about loading! Maybe you use it like this: local trabalhotr = playerTraficante[source] I have 0% knowledge about your system. You should know that better than me.
  14. IIYAMA

    xml vs json

    As @Overkillz said, you can wrap Lua(tables in tables) and in JSON (objects/arrays in objects/arrays). Or, you can use XML to manage the JSON/tables as I said before.
  15. playerTraficante = {} Is a table, tables can't be called. playerTraficante ( ) Only functions can be called. The reason why it is table instead of a function is unknown to me. Please ask the one that created the script for the reason why. Or if it is created by yourself, then ask yourself the same question. Also it might be handy to inspect the table first. iprint(playerTraficante) It might give you information about how to use it.
  16. IIYAMA

    xml vs json

    yes, every time you are going to write.
  17. @ryders Try to use this function. (read the wiki carefully) https://wiki.multitheftauto.com/wiki/SetOcclusionsEnabled It needs to be is a script.
  18. IIYAMA

    xml vs json

    Might be the reason for writing incomplete data. The file isn't flushed, so it might handy to do that as well: https://wiki.multitheftauto.com/wiki/FileFlush Oh and empty(recreate) the file each time you start writing data. @majqq The file is incorrect. There has been double written as you can see. (from a few moments before) se ] ] from: false, false ] ] Clean the file and try again.
  19. IIYAMA

    xml vs json

    @majqq That is a perfect result! (debug) But this will write too much JSON:
  20. IIYAMA

    xml vs json

    It looks fine, except for: (not sure if it is your typo) [ [ false, false, false, false, false, false, false, false, false, false ] ]se ] ] What happens if you debug: jsonData ? @majqq P.s don't forget to clean the file before testing again. Oh and use resourceRoot for the even handler ?
  21. Most likely. Unless that person is really good with shaders and can do it without. But I have never created a shader in my life, so I do not know their limits as well. (Which is of course also limited to the hardware, but textures and objects will work on 99%of the video cards unless they run out of vram.)
  22. One of the two points I noted before and most likely a combination of both. (You can attach objects as well to peds with bone attach resource)
  23. IIYAMA

    xml vs json

    @majqq Oke let me explain you the difference between Lua tables and objects / arrays in JavaScript. (JSON = JavaScript Object Notation) Here we have a table with array structure in Lua: local thisArray = {1, 2, 3, 4} Here we have a table with object structure in Lua: local thisObject = {a = 1, b = 2, c = 3, d = 4} Here we have a table with an mixed structure in Lua: local thisMix = {a = 1, b = 2, 3, 4} As you can see those are tables. There is no such thing as arrays or objects in Lua. But if we were to transform them to JavaScript: Array const thisArray = [1, 2, 3, 4]; Object const thisObject = {a: 1, b: 2, c: 3, d: 4}; There is NO mixed in JavaScript! If you insert a mixed Lua table in JSON (JavaScript Object Notation), the structure will be an OBJECT ? Afaik this is what is happening to you, except it doesn't look like you are doing the same thing... local thisMix = {a = 1, b = 2, 3, 4} To JSON .................... From JSON local thisMix = {a = 1, b = 2, ["1"] = 3, ["2"] = 4} -- or local thisMix = {["a"] = 1, ["b"] = 2, ["1"] = 3, ["2"] = 4} So how about try it without defining any keys. Because I really have no other idea why else it would change it to an object. playerData = {playerItems = {false, false, false, false, false, false, false, false, false, false}}
  24. Technical it is not possible. The rule is: 1 model, per 1 model ID. There is only one thing that can overrule the visualization in game without changing models and that is: `shaders`. Unless you find somebody who is a professional with shaders + willing to help you, it will remain an impossible. Another approach I have seen before to create custom cars, is by attaching custom objects to the vehicle which look like vehicle components. That will require a good modeller.
×
×
  • Create New...