Jump to content

Search the Community

Showing results for tags 'rotation'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



About Me





Found 17 results

  1. Hello, I would like to know how to set npc rotation towards the player (To NPC just look at the player) preferably using the command "getElementPosition" (client resource)
  2. I decided to dive into the world of rotations. I know this might be incomplete and even incorrect: function openCapo() local theVeh = getPedOccupiedVehicle(localPlayer) local value1 = guiScrollBarGetScrollPosition(caposcroll) if theVeh and value1 then setVehicleComponentRotation (theVeh, bonnet_dummy, value1, rY, rZ) end end I've a GUI already created, and the visibility key bound. The first scrollbar (caposcroll) should affect the bonnet_dummy. This was made with absolute basic thinking process: "if I want doors to open, I need to get the position of the scrollbar". However,
  3. Olá senhores. Bom, estou precisando fazer um objeto apontar para outro como se ele estivesse fazendo um Look At. Mas não sei como calcular o ângulo da rotação Z com base nas posições. Exemplo. Objeto A está na posição 0, 0, 0. Objeto B está na posição 1, 1, 0. Ilustrações: Aplicando o Look At no Objeto A para o B, deve fazer o objeto A "mirar" no Objeto B, colocando a rotação Z do objeto A em 315. Mas como calculo isso? Obs: A rotação é com base nas posições, não importa a rotação do objB.
  4. Hello! I have question: "Is possible to create a rotation of image made by "dxDrawMaterialLine3D ?? "". Please fast return message.
  5. Hello forums! I've been working on a project of mine, and I'm in need of a function which is similar to getPositionFromElementOffset (scroll down to examples). I can't wrap my head around matrices at all, and I would love to have a similar function, but with rotations instead (getting a rotation offset from an element). Would someone be able to help me out? I'd be very thankful!
  6. I'm working on a type of RTS camera style and I encounter a problem. The camera can rotate on the same axis without problem, it can zoom and thats about it, but it needed to be looking at an element. Now I'm working on a freecam mode where by getting to the edges of the screen you can move to north, east, west or south. It is easy when the camera rotation is 0, because you know that the top of the screen will be allways X cardinal position, it looked something like this: local camSpeed = 0.2 local sx, sy = getCursorPosition() local x, y, z = getElementPosition(camElement) if sy == 0
  7. Hello again, I'm trying to spawn the player onto an element. This element has a non-fixed rotation. I'm just wondering if the function getPointFromDistanceRotation isn't enough to do this? Player details can be found here and the ships details are here I'm currently using this snippet (to try) to get the explained result: addCommandHandler("boat", function(player, cmd) local x, y, z = getElementPosition(player) local _, _, r = getElementRotation(player) outputChatBox("player pos: "..x..","..y..","..z..","..r, player) local ship = createShip(x, y, z, r) -- retur
  8. Hi all, I'm in search for a component/library having positioning controls like on the pic shown. Here's a samp's "Attached object editor" screenshot, but I've seen the same solutions being 100% lua-implemented on several MTA (many of them were not that "professionally built") servers, this "editor mode" looked the same everywhere, so I guess there could be an open-source issue.
  9. hi guys i have a problem to set ped rotation like player rotation always i mean if you change yor rotation the ped change his rotation too sorry for bad English here is the code local pylonid = 2662 local pylon_x, pylon_y = 0, 0.5 local pylon_c, pylon_v = 0, 0 local pylonheight = 0 local pylonscale = 1.3 local function pylonHead(player, command) if not pylon or pylon == nil then local px, py, pz = getElementPosition( player ) pylon = createObject( pylonid, px, py, pz) attachElements(pylon, player, pylon_x-1, pylon_y, pylonheight, 0, 0, 180) setObjectScale( p
  10. السلام عليكم المشكلة باختصار انه انا اريد اسوي بيد (ped) واخلي الروتيشن حقه مثل الروتيشن حق اللاعب يعي يتغير باستمرار قصدي من يفتر اللاعب يفتر معاه البيد يعني من يغير اللاعب الروتيشن حقه ابي يسوي البيد setElementRotation(thePed, (getPlayerRotation (thePlayer) ) ) بس حاليا المشكلة اني ما اعرف كيف اجيب كود انه اذا تغير روتيشن اللاعب ولعلمكم انا مخلي ped attached with player pedc = createPed( 105, px, py, pz) attachElements( pedc, player, pylon_c-2, pylon_v-1, pylonheight) setPedAnimation(pedc, "wuzi", "wuzi_walk")
  11. KillaBeatZ


    Hi! 1. Question: I Would like to ask, how could i set the vehicle rotation (facing angle) in my vehicle spawning command? So i want to set vehicle rotate to my Character Facing Angle Rotation.. I'm literally newbie with LUA language. This is my first command: addCommandHandler("sv", function(player, command, model) if tonumber(model) and tonumber(model) >= 400 and tonumber(model) < 609 then local vx,vy,vz = getElementPosition(player) local vhle = createVehicle(model,vx,vy,vz) outputChatBox("Vehicle spawned!", player) warpPedIntoVehicle(player,vhle, 0
  12. Good evening fellows, Recently, I've been trying to find the rotation of one part or side of a random object but I couldn't really find the function or the way to do so therefore I'm stuck. If you did not understand the idea, I'll explain it below; A cube is made of 6 sides or faces, generally in MTA if we have an object with a shape of cube or any other shape, we can get its rotation by just using getElementRotation. But, if we want to get the rotation of one face of its faces it is only possible with couple mathmatic calculations which is a bit complicated when this object is
  13. Hey there, is there anyway to get an element bounding box with its rotation? How to do it? Thanks for reading and hope you can awnser my question. Edit: Is posible to get it when an element is not streamed?
  14. Hey, anyone knows how to make the function https://wiki.multitheftauto.com/wiki/GetElementBoundingBox work with a rotated vehicle/object? If I get the position of a vehicle and add the values returned by this function, they are only at the correct position if the vehicle isn't rotated. How do I make it take the rotation into account? Bonsai
  15. Hi! I want to create a fuel system. But I don't know how to calculate the cap's position. I know, that I can do it with getElementPosition, getElementRotation and Offset. But how?
  16. Why does the setElementAttachedOffsets (in server side) not work? i got no debugscript client function onEnter2(player,seat) local model = getElementModel(source) if player == localPlayer and (model == 602) and seat == 0 then local veh = getPedOccupiedVehicle(localPlayer) local x,y,z = getElementPosition(veh) local object = createObject ( 357, x,y,z) attachElements(object, veh, 0,0,1,0,0,0) createWeapon_c(veh,object) setElementData(localPlayer,"object", object) addEventHandler('onClientRender', root, rotate_object ) end end addEventHandler("onClientVehicleEnter", root,
  17. Xwad


    I have a big problem with this code. When i enter a vehicle then the camera is attaching, and the free cam is also working. But when i rotate the vehicles x position 180 degree then the camera is at the same position. I want to attach the camera to a fix point on the vehicle. So my problem is that its not attaching the camera to that point 100 %. its a really strange bug. I could not explain it correctly, maybe you can test it, and then you will see the bug. So i want to attach it like in the bone attach resource. local vvx, vvy, vvz = 0,0,0 function vehicle_cam(screenX, screenY,
  • Create New...