IIYAMA

Scripting Moderators
  • Content Count

    4,965
  • Joined

  • Last visited

  • Days Won

    67

IIYAMA last won the day on October 16

IIYAMA had the most liked content!

Community Reputation

859 MTA Ambassador

About IIYAMA

  • Rank
    Scripting Moderator & User Guide Contributor
  • Birthday 01/01/2016

Details

  • Gang
    [HB]
  • Location
    Netherlands
  • Occupation
    I have never been to the streets of SA... so who knows?
  • Interests
    Design, scripting, UX/UI

Recent Profile Visitors

8,475 profile views
  1. 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.
  2. 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
  3. With: https://wiki.multitheftauto.com/wiki/SetElementFrozen
  4. @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
  5. 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!
  6. 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)
  7. 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.mtasa.com/forum/177-modelling/ + you can figure out which people have knowledge about it.
  8. 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)
  9. See also: https://wiki.multitheftauto.com/wiki/OnPlayerContact
  10. @playerpocket https://forum.mtasa.com/forum/127-programação-em-Lua/ General MTA > Other languages > Portuguese / Português > Programação em Lua = ✅ https://forum.mtasa.com/forum/71-scripting/ MTA Community > Scripting (+ Língua portuguesa) = Thank you, IIYAMA
  11. 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!
  12. 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.
  13. 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)
  14. 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)