Jump to content

Recommended Posts

Posted

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.

 

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.

  • Like 1
Posted
В 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.

 

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?

Posted
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);

Posted
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.

Posted
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.

  • Like 1
  • 4 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...