Jump to content

Rat32

Members
  • Posts

    121
  • Joined

  • Last visited

Everything posted by Rat32

  1. Hello. Bug with descync trailers is on roadmap, but in MTA 1.6. Some truck servers needs this fix earlier, so i have suggestion: Bring this bugfix from 1.6 version to 1.6.4. Regards
  2. I will create deck gun that will can move this with arrows. moveObject is not good, because I don't know time argument. Any suggestions?
  3. Hello. triggerServerEvent per frame is good way to move object serverside smoothly? I have no idea more.
  4. Rat32

    dxDrawText

    Thank you MrTasty :).
  5. Rat32

    dxDrawText

    Hello. DxDrawText function have other arguments than dxDrawImage or dxDrawRectangle. In text, X and Y is left top corner of the dx. I have to math this to X and Y and width and height like rectangle or image.
  6. Rat32

    Hands holding

    Hello. I trying to find this animation to use it in setPedAnimation. I need block and name.
  7. It works, but returning... -2.2737367544323e-13 0 0 Offset is bad.
  8. Okay, working, but how to get a ped bone (head) matrix using getElementMatrix?
  9. I changed element:getMatrix() to getElementMatrix(). I have error in line 9. ERROR: 9: attempt to perform arithmetic on field "?" (a nil value) function getOffsetFromXYZ( mat, vec ) -- make sure our matrix is setup correctly 'cos MTA used to set all of these to 1. mat[1][4] = 0 mat[2][4] = 0 mat[3][4] = 0 mat[4][4] = 1 mat = matrix.invert( mat ) local offX = vec[1] * mat[1][1] + vec[2] * mat[2][1] + vec[3] * mat[3][1] + mat[4][1] local offY = vec[1] * mat[1][2] + vec[2] * mat[2][2] + vec[3] * mat[3][2] + mat[4][2] local offZ = vec[1] * mat[1][3] + vec[2] * mat[2][3] + vec[3] * mat[3][3] + mat[4][3] return {offX, offY, offZ} end addCommandHandler("ad",function() hx, hy, hz = getPedBonePosition(localPlayer, 8) playerMatrix = localPlayer:getMatrix() newPlayerMatrix = Matrix(Vector3(hx, hy, hz), playerMatrix.rotation) local matrix = localPlayer.matrix outputChatBox(tostring(matrix[1])) local offset = getOffsetFromXYZ(getElementMatrix(localPlayer), Vector3(getElementPosition(getPedOccupiedVehicle(localPlayer)))) outputChatBox(tostring(offset.x)) end)
  10. Hello! I have this code. function getOffsetFromXYZ( mat, vec ) -- make sure our matrix is setup correctly 'cos MTA used to set all of these to 1. mat[1][4] = 0 mat[2][4] = 0 mat[3][4] = 0 mat[4][4] = 1 mat = matrix.invert( mat ) local offX = vec[1] * mat[1][1] + vec[2] * mat[2][1] + vec[3] * mat[3][1] + mat[4][1] local offY = vec[1] * mat[1][2] + vec[2] * mat[2][2] + vec[3] * mat[3][2] + mat[4][2] local offZ = vec[1] * mat[1][3] + vec[2] * mat[2][3] + vec[3] * mat[3][3] + mat[4][3] return {offX, offY, offZ} end addCommandHandler("ad",function() hx, hy, hz = getPedBonePosition(localPlayer, playerMatrix = localPlayer:getMatrix() newPlayerMatrix = Matrix(Vector3(hx, hy, hz), playerMatrix.rotation) local matrix = localPlayer.matrix outputChatBox(tostring(matrix[1])) local offset = getOffsetFromXYZ(matrix, Vector3(getElementPosition(getPedOccupiedVehicle(localPlayer)))) outputChatBox(tostring(offset.x)) end) But when I type /ad i have error: 3: attempt to index field '?' (a nil value)
  11. Rat32

    Calculate Z

    No. I going to get this point relative to vehicle.
  12. Rat32

    Calculate Z

    How I can calculate position of point?
  13. Hello community. I nedd to calculate rotation of element to make "looking for" of this. For example: I have a arrow object, and I must set him rotation to the specifed point (for example player). I need calculate X, Y, Z rotation to make a "looking for" of this object. Very thanks.
  14. Rat32

    Mathing rotation

    I attached getted camera using getCamera() function to vehicle. I must create mouse camera moving using mouse and i have no idea for rotate this camera to looking this to xyz point. I can't use setCameraTarget, because this detaching camera from vehicle.
  15. Rat32

    Mathing rotation

    When I use setCameraTarget my object cam will be detached drom car
  16. This not work because you using a setPlayerName function - function is created already by mta, change function name.
  17. I using getCamera() to get player camera. I can't use setCameraMatrix, becouse I need atach cam to vehicle. How to math camera rotation to set him rotation to xyz to looking a specifed point?. I will make this camera "looking for".
  18. Hey. How to get server-sided timer details on clientside? // trigger not, because i use dxDrawText to draw this details. I need this value updated.
  19. Ah, exatly. OK - thank you very much!
  20. Is on community ModLoader script - it's working like that.
  21. Ok, but how to get all this files without manual checking in script?
  22. I know, but is the way to get files inside the folder? I need function like this: table getFilesInFolder(path) - i know, this function is not exist, but i need function like this.
  23. Hm, okay okay - this is good, but I have another idea - i will create a automatic read files from folder, without insert him to .xml or table. I will create auto-read a folder in the script and auto replacing all files from there. Is the way to make this?
×
×
  • Create New...