Quantcast

Jump to content

» «
Photo

[.NET]Anyway to detect wall impact?

1 reply to this topic
Cloud_Power
  • Cloud_Power

    Player Hater

  • Members
  • Joined: 12 Jul 2016
  • Italy

#1

Posted 12 March 2017 - 10:00 AM Edited by Cloud_Power, 12 March 2017 - 10:02 AM.

Hello guys!

So, I have this snippet of code

if(Game.Player.Character.CurrentVehicle.HasCollidedWithAnything)
{
     foreach (Entity entity in World.GetNearbyEntities(Game.Player.Character.Position, 5.0f))
     {
          if (Function.Call<bool>(Hash.IS_ENTITY_A_PED, entity) == false)
          {
               if(Game.Player.Character.CurrentVehicle.HasBeenDamagedBy(entity))
               {
                    UI.Notify("DAMAGED");
               }
          }
     }
}

which is working just fine as long as I don't crash against a wall!

It correctly detect other entities, such as vehicles and objects, but not wall!

 

How can I detect if I've crashed against a wall?

 

Thank you! :)

  • trwygon and meimeiriver like this

meimeiriver
  • meimeiriver

    Crackhead

  • Members
  • Joined: 04 Mar 2017
  • Netherlands

#2

Posted 19 March 2017 - 04:16 AM Edited by meimeiriver, 19 March 2017 - 04:16 AM.

Kinda new to all this stuff myself, but I have a smilar script, and just do:

 

if (Game.Player.Character.HasCollidedWithAnything) {

 

​Which seems to work just fine.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users