Closed Esterze closed 1 year ago
Hi @Zzeyy, FiveM doesn't have get coords of player camera .
This feature is possible, though.
Take inspiration from the RayCastCoords script.
https://docs.fivem.net/natives/?_0x377906D8A31E5586 local player = PlayerPedId() local playerCoords = GetEntityCoords(player) local raycast = StartExpensiveSynchronousShapeTestLosProbe(playerCoords.x, playerCoords.y, playerCoords.z, GetOffsetFromEntityInWorldCoords(player, 0.0, 100.0, 0.0), 10, player, 0) local , , , , result = GetShapeTestResult(raycast) if result ~= nil then local hitCoords = _0x377906D8A31E5586(result) print("Hit coordinates: " .. hitCoords.x .. ", " .. hitCoords.y .. ", " .. hitCoords.z) else print("Raycast did not hit anything.") end
A little bit of formatting couldn't hurt. But yeah, something like this.
Also instead of printing the coordinates make it copy them.
@nutria22 You're mistaken. I am suggesting this as a new feature for the anticheat. I already use raycasts.
I work on that and test it not bad idea
I tested this but nothing good option for anti cheat in this code I don't have any good idea for this code
Add a raycast that tells you the coords of where you're looking at. Could be useful.