Jump to content

How can i check if object has hitted by projectile ?


iMr.WiFi..!

Recommended Posts

  • Moderators

The processLineOfSight function would give you some information about it.

https://wiki.multitheftauto.com/wiki/ProcessLineOfSight

It works just fine, I use it to detonate a rocket projectile.

 

It doesn't matter if the object is serverside or clientside, because an serverside object is visible on clientside and a projectile is only available clientside.

(Maybe I do not understand your question.)

 

 

 

Link to comment
16 hours ago, IIYAMA said:

The processLineOfSight function would give you some information about it.

https://wiki.multitheftauto.com/wiki/ProcessLineOfSight

It works just fine, I use it to detonate a rocket projectile.

 

It doesn't matter if the object is serverside or clientside, because an serverside object is visible on clientside and a projectile is only available clientside.

(Maybe I do not understand your question.)

 

 

 

To be Specifically, i want check if rocket has passed an object and get projectile creator ..

Link to comment
  • Moderators

I am not sure what you mean with passed. Because it can only pass an object when the object has no collision or is streamed out.

 

 

But you could try to collect information about the projectile like this;

https://wiki.multitheftauto.com/wiki/OnClientProjectileCreation

 

And use:

https://wiki.multitheftauto.com/wiki/OnClientElementDestroy

To located it's last position and the moment of detonation.

 

And use:

https://wiki.multitheftauto.com/wiki/OnClientPreRender

To detect anything that happens during the flight. (moment to detect the exact impact location)

 

The projectile creator will be always available, except when the rocket explodes in an instance. (impact too close to the rocketlauncher) The rocket projectile will not trigger the lua event when this happens.

 

 

Link to comment
  • Moderators

Hmm all you can do is checking with the bounding box then.

https://wiki.multitheftauto.com/wiki/GetElementBoundingBox

 

Afaik there was ones a resource called: `Server collision` from CrystalMV (His resource site is offline)

Which contains math functions to do these calculations with block/rectangle formats.

 

I might have somewhere a copy left of it, if you want it. (let me know)

Link to comment

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