Jump to content

JAY.ANN

Members
  • Posts

    70
  • Joined

  • Last visited

  • Days Won

    1

JAY.ANN last won the day on August 19 2022

JAY.ANN had the most liked content!

1 Follower

About JAY.ANN

  • Birthday March 7

Recent Profile Visitors

2,160 profile views

JAY.ANN's Achievements

Transformer

Transformer (11/54)

8

Reputation

  1. Well, I used mED to get objects coordinates. It works with .IPL files Thank you, solved
  2. Hi, I would like to get an original SA object's coordinates. Is it even possible? As I know, getElementsByType() and getElementPosition() is only for server-created elements.
  3. That's a brilliant one! Exactly what I've been looking for! Thanks a lot This topic can be closed
  4. Quite interesting but it doesn't fit
  5. The ray will end at the weapon range maximum getPedTartgetEnd() "Returns three floats, x,y,z, representing the position where the ped's target ends according to his range, or false if it was unsuccessful". I need to continuous it or make it less I've tried all MTA functions and events that may help to me but nothing works correct. I guess it's all about the math or matrix I still think that the best solution is to use triangles similarity stuff
  6. I already tried all the suggestions. Nothing works fine to me It still has no correct Z coordinate
  7. That's what I used tho. That resource has a weapon range limitations and a collision one
  8. I'm not going to create infinite ray from getPedTargetCollision() - that's the debug stuff in my script for now I'm going to use offset to create my ray, but the trouble is in Z coordinate
  9. It will return false if there's no collision or if it's not loaded
  10. ray = {} addEventHandler( "onClientPlayerWeaponFire", getRootElement(), function( _, tAmmo, cAmmo, hX, hY, hZ, hElement, sX, sY, sZ ) local rx, ry, rz = getElementRotation( source ) local muzzleX, muzzleY, muzzleZ = getPedWeaponMuzzlePosition( source ) local muzzle_eX, muzzle_eY, muzzle_eZ = getPedTargetEnd( source ) if not getPedTargetCollision( source ) then local offset = math.rad( rz + 90 ) local l_sX, l_sY, l_sZ = muzzleX, muzzleY, muzzleZ local l_eX, l_eY, l_eZ = ( muzzle_eX + 50 * math.cos( offset ) ), ( muzzle_eY + 50 * math.sin( offset ) ), muzzle_eZ table.insert( ray, { l_sX, l_sY, l_sZ, l_eX, l_eY, l_eZ } ) else local l_sX, l_sY, l_sZ = muzzleX, muzzleY, muzzleZ local l_eX, l_eY, l_eZ = getPedTargetCollision( source ) table.insert( ray, { l_sX, l_sY, l_sZ, l_eX, l_eY, l_eZ } ) end end) function drawRays() for i, v in ipairs( ray ) do dxDrawLine3D( v[ 1 ], v[ 2 ], v[ 3 ], v[ 4 ], v[ 5 ], v[ 6 ], tocolor( 255, 0, 0, 100 ), 2 ) end end addEventHandler( "onClientRender", root, drawRays ) That's the script. I want to draw a ray from weapon's muzzle XYZ to (XYZ + range) but if i use getPedTargetEnd() it has a weapon's range limitations and I can't change that correctly because of RenderWare engine and MTA limits
  11. When I'll back from job, yes
  12. I guess it won't work cuz there's no Z coordinate
  13. It returns a face to face rotations, but I guess I can try this one The problem is a Z coordinate, not the XY or an angle I guess the solution is a similarity of triangles, but how can I implement that?
  14. I don't need a ground position, the ray may end in the air What we've got: start XYZ, end X1Y1 found by random angle. We need to get Z1 from that angle, XY and X1Y1
  15. Hello everybody. I need a help. I have a ray that casts from XY to X₁Y₁ with random angle. I need to get a Z₁ coordinate from X₁Y₁. How can I do it? Help me, please, I'll be very grateful for that!
×
×
  • Create New...