Jayceon

Members
  • Content count

    52
  • Joined

  • Last visited

Community Reputation

4 Neutral

3 Followers

About Jayceon

  • Rank
    Snitch

Recent Profile Visitors

721 profile views
  1. DX Comboboxes

    Change this: dxDrawText(selectedItem > 0 and contentList[1][selectedItem] or "Select a skin", boxX+20, boxY, boxX+20, boxY+boxH, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "center") To: dxDrawText(selectedItem > 0 and contentList[selectedItem][1] or "Select a skin", boxX+20, boxY, boxX+20, boxY+boxH, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "center")
  2. My scripts website

    "Website dont work anymore" - Use the webarchive. (fast link to crystal website: https://web.archive.org/web/20161127055038/http://crystalmv.net84.net:80/)
  3. Someone have this math function?

    With a little transformation, but work. Thanks
  4. Someone have this math function?

    It is a GPS Navig system, using nodes. Now. There is a start and an endpoint of these. At every endpoint a new node starts. This is everything i know, i want to know if the endpoint is to the left or the right from the start point. If you don't understand I can visualize it. for i, node in ipairs(gpsRoute) do local nextNode = gpsRoute[i + 1] local previousNode = gpsRoute[i - 1] if i > 1 and i < #gpsRoute then for k, v in pairs(node.neighbours) do if previousNode and nextNode and k ~= previousNode.id and k ~= nextNode.id then local nodeAngle = getAngle(node.x - previousNode.x, node.y - previousNode.y, nextNode.x - node.x, nextNode.y - node.y) if math.deg(nodeAngle) > 10 then print("right") break end if math.deg(nodeAngle) < -10 then print("left") end break end end end end
  5. Someone have this math function?

    I have 4 positions. One X-Y pair for the start, one XY pair for the end of the line. I want to get the angle between the starting point and the endpoint of these. But. I need it to be negative if left and positive if right.
  6. Someone have this math function?

    I just need an example please
  7. Someone have this math function?

    Please show me an example code, i shown you mine, just use it and please do an example getAngle function)
  8. Someone have this math function?

    Example: local angle = math.deg(getAngle(currentNode.x - previousNode.x, currentNode.y - previousNode.y, nextNode.x - currentNode.x, nextNode.y - currentNode.y)) if angle > 10 then print("right") elseif angle < -10 then print("left") end
  9. Someone have this math function?

    wtf is rotationOffset ? i have the function, with X Y, X2, Y2 points on the map. I need the angle between them, but it can be negative or positive depending on left or right. n>10 -> right n<-10 -> left so it should work clockwise and counter-clockwise
  10. Someone have this math function?

    We have some pass marks, so i can not 360-value every single time
  11. Someone have this math function?

    We can not use findRotation, because we need left or right angles (it can be -10>n then it's a left turn, if it's 10<n then it's a right turn, if it's between -10 and 10 it is nothing) We have a table with precalculated values (the need field is what we need), but we get different numbers (got field) function getAngle(x1, y1, x2, y2) local angle = math.atan2(x1, y1) - math.atan2(x2, y2) if angle <= -math.pi then angle = angle + 2 * math.pi usedAlg = "hoz" else if angle + 2 * math.pi <= math.pi then angle = angle - 2 * math.pi usedAlg = "min" end end return -math.deg(angle) end pass fail || need: 13.532079523427 || got: -346.46792047657 fail || need: 368.80375654813 || got: 8.8037565481247 fail || need: 270 || got: -90 fail || need: -85.150542731867 || got: -85.150542731865 pass fail || need: 13.532079523427 || got: -346.46792047657 pass pass pass pass but it does not work
  12. Someone have this math function?

    Yes.. works perfectly, but not for my code. (Don't get all directions (left/right - like highways exit)
  13. Someone have this math function?

    Hello dear reader! I'm searching a math function to get the perfect angle. I have one function, but it not whole. function getAngle(x1, y1, x2, y2) while true do while true do if math.atan2(x2, y2) - math.atan2(x1, y1) <= -math.pi then end end end while true do if math.atan2(x2, y2) - math.atan2(x1, y1) + 2 * math.pi > math.pi then end end return math.atan2(x2, y2) - math.atan2(x1, y1) + 2 * math.pi - 2 * math.pi end Thanks the replies. (The findRotation and other simple functions not good for me.)
  14. [RELEASE] MTA:SA Pathfinding Module

    I'm now tried the module in MTA SA 1.4 server and successfully loaded. What the problem with 1.5.4 server?
  15. [RELEASE] MTA:SA Pathfinding Module

    I'm using it in client side, but tried it in server side. Every side return the "attempt to call" I don't know what the problem. I'm using Windows 10 Pro 64 bit, MTA SA server 1.5.4. The console show the module successfully loaded.