Jump to content

IIYAMA

Moderators
  • Posts

    6,089
  • Joined

  • Last visited

  • Days Won

    216

Everything posted by IIYAMA

  1. This one: https://wiki.multitheftauto.com/wiki/GetChatboxLayout
  2. Hmm, I was never angry. But my words choice might be a little bit incorrect. My apologize for the inconvenience. I meant: Don't be afraid to just copy, it will save you time. If it works, you can analyse it later. Keep up the good work!
  3. If you didn't post this topic, you wouldn't have access to a possible solution. But not scrolling down the page to the replies, (most of the time a gold mine), is actually something you should consider doing next time. ?
  4. My reply on that same topic, might give you a hand in figuring out how position things on the screen. Everything is already ready for you to copy and past. Please be lazy for once in your life. See:
  5. Yes, I wouldn't agree more. Also this one? Because afaik the issue lies more with width of the element, which will result in a wrong button position. \/ Your relative function is not suited for pixel perfect designs. It is only useful to get the job quickly done. [Note: I am currently very busy, so will not be able to create examples for you]
  6. https://wiki.multitheftauto.com/wiki/TestLineAgainstWater A line that detects the surface of the water. I am sure that you are creative enough to make it with that function.
  7. Use timestamp. Check the docs. And no I currently can't give any examples as I am extremely busy with a real life project that is killing all the hours I have. Please ask somebody else.
  8. This is a memory leak, most likely created by one of your scripts. Use the performance browser to find the responsible resource: (Category - Lua memory???) https://wiki.multitheftauto.com/wiki/Resource:Performancebrowser Best of luck
  9. With: https://wiki.multitheftauto.com/wiki/SetElementFrozen
  10. @SuperM Open your map file in your text editor. Search for the id. And give the node the attribute: frozen="true". (Check if the attribute is already added) Add it like that: (don't copy/past) <object frozen="true"></object> https://wiki.multitheftauto.com/wiki/Element/Object
  11. IIYAMA

    TGA Reader

    @XaskeL Unfortunately I can't answer this question. But one thing I noticed is you are making it too complex and putting stress on your MTA application. If you want to read and write pixels, why not let a secondary application take care of that? You are just blocking your MTA thread after all. https://www.npmjs.com/package/@rgba-image/pixel https://www.npmjs.com/package/get-pixels (Also you might find an answer to your question in the source code of those two node applications) Do with it what you want, best of luck!
  12. This information might also be useful for you: local x, y, z = 0, 0, 10 local rx, ry, rz = 0, 0, 0 -- test rx, ry, rz = (rx + math.random(3)) % 360, (ry + math.random(3)) % 360, (rz + math.random(3)) % 360 -- local m = createMatrix(x, y, z, rx, ry, rz ) local startX, startY, startZ = getPositionFromMatrixOffset(m, 0, 1, 0) local endX, endY, endZ = getPositionFromMatrixOffset(m, 0, -1, 0) local faceTowardX, faceTowardY, faceTowardZ = getPositionFromMatrixOffset(m, 1, 0, 0) (functions are on that topic)
  13. For this you indeed need to use dxDrawMaterialLine3D. This is actually not the right section for details about COLS (collision files). (unless it is only for the replacement code) You will have more luck with that in: https://forum.multitheftauto.com/forum/177-modelling/ + you can figure out which people have knowledge about it.
  14. Are you going to create lights under the ped his feet? Or a shadow as image? Hmmmhmmhmmmmm Could work, but it is still not clear what the ultimate goal is. Btw. See also this function: https://wiki.multitheftauto.com/wiki/ProcessLineOfSight It it doesn't only tell you if the line is clear, it also detects the collision position. (And much more: material, surfaces orientation, vehicle parts)
  15. See also: https://wiki.multitheftauto.com/wiki/OnPlayerContact
  16. @playerpocket https://forum.multitheftauto.com/forum/127-programação-em-Lua/ General MTA > Other languages > Portuguese / Português > Programação em Lua = https://forum.multitheftauto.com/forum/71-scripting/ MTA Community > Scripting (+ Língua portuguesa) = Thank you, IIYAMA
  17. I just looked in to your source code, because I got curious. (I haven't tried the resource, no time for now) But the variable alapLo, where is it defined? Just wondering. Anyway, keep up the nice work!
  18. This might help you: (based on these examples) function createMatrix(x, y, z, rx, ry, rz) rx, ry, rz = math.rad(rx), math.rad(ry), math.rad(rz) local matrix = {} matrix[1] = {} matrix[1][1] = math.cos(rz)*math.cos(ry) - math.sin(rz)*math.sin(rx)*math.sin(ry) matrix[1][2] = math.cos(ry)*math.sin(rz) + math.cos(rz)*math.sin(rx)*math.sin(ry) matrix[1][3] = -math.cos(rx)*math.sin(ry) matrix[1][4] = 1 matrix[2] = {} matrix[2][1] = -math.cos(rx)*math.sin(rz) matrix[2][2] = math.cos(rz)*math.cos(rx) matrix[2][3] = math.sin(rx) matrix[2][4] = 1 matrix[3] = {} matrix[3][1] = math.cos(rz)*math.sin(ry) + math.cos(ry)*math.sin(rz)*math.sin(rx) matrix[3][2] = math.sin(rz)*math.sin(ry) - math.cos(rz)*math.cos(ry)*math.sin(rx) matrix[3][3] = math.cos(rx)*math.cos(ry) matrix[3][4] = 1 matrix[4] = {} matrix[4][1], matrix[4][2], matrix[4][3] = x, y, z matrix[4][4] = 1 return matrix end function getPositionFromMatrixOffset(m, offX, offY, offZ) local x = offX * m[1][1] + offY * m[2][1] + offZ * m[3][1] + m[4][1] -- Apply transform local y = offX * m[1][2] + offY * m[2][2] + offZ * m[3][2] + m[4][2] local z = offX * m[1][3] + offY * m[2][3] + offZ * m[3][3] + m[4][3] return x, y, z -- Return the transformed point end With this you can calculate from every orientation the matrix and offset positions. Feel free to apply a different rotation value, so that the offset is also turning. Optional method: (but might not be 100% accurate) Between 2 positions in front of you can rotate the camera, see: https://wiki.multitheftauto.com/wiki/InterpolateBetween I hope this will make you see the light, it did for me when doing complex 3D calculations.
  19. To be honest, I haven't encountered any issues with it yet. But I am pretty sure that it can have issues when memory has been wiped because of an <unknown situation>. I would suggest following Awang his suggestion: If applied, you probably do not need that onClientRestore event. It might also improve performance, because it is static. local texture = dxCreateTexture(dxGetTexturePixels(rt)) dxSetShaderValue(theShader, "gTexture", texture)
  20. Just don't render it with renderContent. Shaders applied to game elements do not require updates every frame. (Unless you want to update them with Lua > update the texture or update the shader values)
  21. @Overkillz You can do it with 1 shader, and just before drawing, switch the texture value of it foreach player. But I am not sure, how high the performance penalty is. So both ways will work, but I am not sure which one is the best one.
  22. IIYAMA

    UNBINDKEY

    With this function: (Included examples) https://wiki.multitheftauto.com/wiki/ToggleControl See here the list of control names you can enabled and disable: https://wiki.multitheftauto.com/wiki/Control_names
  23. That is for you to find out. https://wiki.multitheftauto.com/wiki/GetCamera https://wiki.multitheftauto.com/wiki/GetElementRotation local camera = getCamera () local rx, ry, rz = getElementRotation(camera) Also you can just attach the camera element to the ped or vehicle. ?
×
×
  • Create New...