Jayceon

Members
  • Content count

    59
  • Joined

  • Last visited

Community Reputation

9 Neutral

5 Followers

About Jayceon

  • Rank
    Snitch

Recent Profile Visitors

1,418 profile views
  1. Graffiti resource malfunctioning

    Problem solved in the 1.0.6 version.
  2. Graffiti resource malfunctioning

    Today i fix it. 😎
  3. function elementOffset(matrix, x, y, z) return x * matrix[1][1] + y * matrix[2][1] + z * matrix[3][1] + matrix[4][1], x * matrix[1][2] + y * matrix[2][2] + z * matrix[3][2] + matrix[4][2], x * matrix[1][3] + y * matrix[2][3] + z * matrix[3][3] + matrix[4][3] end Use the getElementMatrix and the elementOffset function to get the material start/end and facing toward position. Like this: local vehicleMatrix = getElementMatrix(vehicleElement) local x1, y1, z1 = elementOffset(vehicleMatrix, 0, 1, 0) local x2, y2, z2 = elementOffset(vehicleMatrix, 0, -1, 0) local x3, y3, z3 = elementOffset(vehicleMatrix, 0, 1, 0.5) dxDrawMaterialLine3D(x1, y1, z1, x2, y2, z2, data.renderTarget, 2, tocolor(lightColor[1],lightColor[2],lightColor[3],lightColor[4]), x3, y3, z3) Or another way (not tested): local vehiclePosX, vehiclePosY, vehiclePosZ = getElementPosition(vehicleElement) local _, _, vehicleRotation = getElementRotation(vehicleElement) vehicleRotation = math.rad(vehicleRotation) local rotatedX = math.cos(vehicleRotation) * 1.05 local rotatedY = math.sin(vehicleRotation) * 1.05 local hit, hitPosX, hitPosY, hitPosZ = processLineOfSight(vehiclePosX, vehiclePosY, vehiclePosZ + 1, vehiclePosX, vehiclePosY, vehiclePosZ - 1, true, false, false, false, false) hitPosZ = hitPosZ + 0.02 dxDrawMaterialLine3D(hitPosX + rotatedX, hitPosY + rotatedY, hitPosZ, hitPosX - rotatedX, hitPosY - rotatedY, hitPosZ, data.renderTarget, 2, tocolor(lightColor[1],lightColor[2],lightColor[3],lightColor[4]), hitPosX, hitPosY, hitPosZ + 1) Play with the values
  4. Serverside variable

    local isNumKey = tonumber(button) if press and (isNumKey and isNumKey >= 0 and isNumKey <= 9) then --trigger or something end
  5. [HELP] Reading a table within a table within a table

    E: local groups = { fondatori = { name = "Fondator|Dev |", ids = {1, 3, 54, 85}, RGB = {0, 153, 255} }, fondatori2 = { name = "Fondator|Hosting", ids = {2}, RGB = {0, 153, 255} } } function isPlayerIDInGroup( id, IDsTable ) for i=1, #IDsTable do if IDsTable[i] == tonumber(id) then return true end end return false end local groupFound = false for _,group in pairs(groups) do if isPlayerIDInGroup( playerID, group.ids ) then groupFound = group break end end if groupFound then local r,g,b = unpack(groupFound.RGB) outputChatBox(groupFound.name.." ..:D%G:.. says: Hello World", r, g, b ) else outputChatBox("Civilian | ..:D%G:.. says: Hello World", 255, 255, 0 ) end
  6. 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.)
  7. 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" />
  8. 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")
  9. 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/)
  10. Someone have this math function?

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

    I just need an example please
  14. 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)
  15. 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