Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 27/08/23 in all areas

  1. About Prime Freeroam is an advanced Freeroam server with roleplay features! It has been in development since 2017. If you find any bugs please report them on our discord. Server IP: mtasa://149.28.237.162:22003 Discord: https://discord.gg/Xz9NUAq NPC features We have an extensive NPC system that is fully synchronised and includes features such as: A wanted system with more and harder law enforcement spawning in the greater your wanted level. Traffic - pedestrians, cars and boats. You will find special pedestrians around the map - some easter eggs! Restricted areas such as Area 51 have military, hidden secrets and also tanks (For all your rampage needs!). And much more! Shops and minigames You can spend your money at all the shops in GTA SA Ammunation, Food shops, Hardware store and Strip clubs - and a few more! Time trials, drift challenges and races are located around the map. Taxi, Pizza and Trucking missions to earn money. Casino games including pool where you can compete against other players. Gangs You can join the classic gangs from GTA SA or create your own crew. You can recruit and spawn followers to command. You can even do drivebys! Take gang territories by attacking peds or players in their zone to initiate a gang war. You will have to hold the hill while fighting off waves of enemies. Freeroam To explore you can warp around the map, and spawn vehicles and customise them. We have synchronised vehicle radio, jukeboxes and ped sounds! Media https://streamable.com/tlf8ye
    3 points
  2. My suggestion: Use getCameraMatrix to get the x, y, z position of camera. Use getWorldFromScreenPosition on position of the cursor, with depth being the maximum distance you want to reach, to get the cursor's 3D position at that distance. Use processLineOfSight between camera and cursor coordinates to find the 3D position of the vehicle's surface point where the cursor is pointing. Transform that surface point from world coordinate space to vehicle's local coordinate space with the help of getElementMatrix. This one is a bit tricky since the element matrix allows transforming from local to world space easily, using matrix x vector multiplication, but doing the opposite (world to local) requires multiplying the inverse of that matrix by vector, and there doesn't seem to be a built-in function for calculating the inverse of a matrix in MTA. I could do that in Lua, since it's not very complicated, but still easy enough to make a mistake. Luckily, the vehicles have a scale of 1 and no shearing transformations (unless some glitch with Monster truck wheels occurs which does exactly that kind of crap to other vehicles), which makes the rotation matrix (the 3x3 part of element matrix) orthogonal, which in turn makes its inverse equal to transpose. This is my attempt to transform the coordinates: -- wx, wy, wz are the coordinates in world space local m = getElementMatrix(vehicle) local rx, ry, rz = wx-m[4][1], wy-m[4][2], wz = m[4][3] local lx = m[1][1]*rx + m[1][2]*ry + m[1][3]*rz local ly = m[2][1]*rx + m[2][2]*ry + m[2][3]*rz local lz = m[3][1]*rx + m[3][2]*ry + m[3][3]*rz Unless I screwed something up, lx, ly, lz should be wx, wy, wz relative to the vehicle. By transforming the cursor's 3D position like that, you can get the cursor's position with respect to the vehicle, which sounds like what you need.
    0 points
×
×
  • Create New...