linnik 2 Posted August 20, 2018 Hello to everyone, is it possible to detect type (road, off-road, grass, sand etc.) of ground on current player position? Share this post Link to post Share on other sites
notsosmart 51 Posted August 20, 2018 Two ways (One of them impossible at the moment due to a pointer parameter return). The first is checking the players last hit material. The second is manually doing a raycast with the extended results. (Possible in 0.4) entity.getLastMaterialHitBy(); Will return the hash number of the material hit. You can then check against these values. https://pastebin.com/gyHjsYBK They might have changed however. You can hunt for them in the game files. You might also get away with using mp.game.joaat("concrete_pothole") or mp.game.gameplay.getHashKey("concrete_pothole") for example and see which one is valid. In the next update you can use this set. Which will return a hash number again but isn't dependent on an entity. Then you compare the result against the list again. mp.game.worldprobe.castRayPointToPoint mp.game.worldprobe.getShapeTestResultEx However if you're willing to experiment and try to duplicate the raycast process. You can try spawning an invisible object at the designated location (use mp.raycasting.testPointToPoint and get the hit coordinates) and then using getLastMaterialHitBy() on that object. This might work but I'm not sure. 1 Share this post Link to post Share on other sites
linnik 2 Posted August 22, 2018 В 20.08.2018 в 20:18, notsosmart сказал: Two ways (One of them impossible at the moment due to a pointer parameter return). The first is checking the players last hit material. The second is manually doing a raycast with the extended results. (Possible in 0.4) entity.getLastMaterialHitBy(); Will return the hash number of the material hit. You can then check against these values. https://pastebin.com/gyHjsYBK They might have changed however. You can hunt for them in the game files. You might also get away with using mp.game.joaat("concrete_pothole") or mp.game.gameplay.getHashKey("concrete_pothole") for example and see which one is valid. In the next update you can use this set. Which will return a hash number again but isn't dependent on an entity. Then you compare the result against the list again. mp.game.worldprobe.castRayPointToPoint mp.game.worldprobe.getShapeTestResultEx However if you're willing to experiment and try to duplicate the raycast process. You can try spawning an invisible object at the designated location (use mp.raycasting.testPointToPoint and get the hit coordinates) and then using getLastMaterialHitBy() on that object. This might work but I'm not sure. Vehicle.getLastMaterialHitBy() always returns 0. Why? Share this post Link to post Share on other sites
notsosmart 51 Posted August 27, 2018 On 8/22/2018 at 10:32 AM, linnik said: Vehicle.getLastMaterialHitBy() always returns 0. Why? Use the native version then. mp.game.invoke("0x5C3D0A935F535C4C", vehicle.handle); Share this post Link to post Share on other sites
linnik 2 Posted August 27, 2018 1 час назад, notsosmart сказал: Use the native version then. mp.game.invoke("0x5C3D0A935F535C4C", vehicle.handle); It doesn't work for ground surface but works only when car hits something with it's body. Share this post Link to post Share on other sites
notsosmart 51 Posted August 27, 2018 59 minutes ago, linnik said: It doesn't work for ground surface but works only when car hits something with it's body. Then wait for the 0.4 update which allows you to use custom raycasts. 1 Share this post Link to post Share on other sites