Jayceon

Members
  • Content count

    54
  • Joined

  • Last visited

Community Reputation

6 Neutral

4 Followers

About Jayceon

  • Rank
    Snitch

Recent Profile Visitors

930 profile views
  1. triggerClientEvent

    In the server side code, change the source argument to another. (The source of this event is the colshape that got hit by a player or vehicle.)
  2. failed to call 'fall_log:createLog'

    Not good format. The correct format is: <export function="addLog" type="server" /> <export function="saveLog" type="server" /> <export function="createLog" type="server" />
  3. 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")
  4. 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/)
  5. Someone have this math function?

    With a little transformation, but work. Thanks
  6. 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
  7. 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.
  8. Someone have this math function?

    I just need an example please
  9. 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)
  10. 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
  11. 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
  12. Someone have this math function?

    We have some pass marks, so i can not 360-value every single time
  13. 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
  14. Someone have this math function?

    Yes.. works perfectly, but not for my code. (Don't get all directions (left/right - like highways exit)
  15. 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.)