Jump to content

Search the Community

Showing results for tags 'dxdrawline3d'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • 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

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

Found 2 results

  1. The problem is that there is a ped that runs straight, and there are also drawn lines that show how the ped is looking. And I would like to make this ped when it notices an obstacle with a given line "processOfLineSight" to paint it red from the green line. But unfortunately when the ped runs and sees an obstacle on the right side, the middle line lights up instead of the one on the right side. It's the same with the rest, the middle line, when it notices something, the left line lights up and so on. Can someone help me with this? local direction = 0 local testPed = createPed(0,2480.52344, -1649.07202, 103.77657, direction) local lineLength = -10 local distanceOfStart = 0 local color = {{255, 0, 0},{0, 255, 0}} local colorSet = 2 function drawLineFromHead(ped, angle) if isElement(ped) and getElementType(ped) == "ped" then local pedX, pedY, pedZ = getElementPosition(ped) local pedRotation = getPedRotation(ped) + angle local pedRotationRad = math.rad(pedRotation) local lineEndX = pedX + lineLength * math.sin(pedRotationRad) local lineEndY = pedY - lineLength * math.cos(pedRotationRad) dxDrawLine3D(pedX, pedY, pedZ + distanceOfStart, lineEndX, lineEndY, pedZ+ distanceOfStart, tocolor(color[colorSet][1], color[colorSet][2], color[colorSet][3]), 2) local hit = processLineOfSight(pedX, pedY, pedZ + distanceOfStart, lineEndX, lineEndY, pedZ+ distanceOfStart, true, false, false) if hit then colorSet = 1 else colorSet = 2 end end end function drawLinesForPerspective(ped) drawLineFromHead(ped, -45) drawLineFromHead(ped, 0) drawLineFromHead(ped, 45) end setPedControlState(testPed, "forwards", true) -- Main Loop addEventHandler("onClientRender", root, function() drawLinesForPerspective(testPed) local x, y, z = getElementPosition(getLocalPlayer()) end)
  2. Olá estou querendo fazer que o dxDrawLine3D aparecer após ligar o script tentei de uma forma e nao consigui é a primeira vez mexendo com o dxDraw fico agradecido a quem me ajuda function lineaeropuerto() dxDrawLine3D(1492.86328125, 1191.3876953125, 10, 1492.86328125, 1697.3671875, 10, tocolor(0, 255, 0, 255), 25)--verde dxDrawLine3D(1477.4365234375, 1223.2587890625, 10, 1477.4365234375, 1697.3671875, 10, tocolor(255, 0, 0, 255), 25)--rojo dxDrawLine3D(1462.0029296875, 1191.3876953125, 10, 1462.0029296875, 1697.3671875, 10, tocolor(0, 255, 0, 255), 25)--verde end addEventHandler("onClientRender", root, lineaeropuerto)
×
×
  • Create New...