bool IsLineOfSightClear( Vector pos1, Vector pos2 [, bool buildings, bool vehicles, bool peds, bool objects, bool transparent, bool ignoreStuff ] )
Test whether the line of sight between two points is clear. Returns false if one of the checks caused a collision, true if the line of sight is clear.
- pos1 - first point
- pos2 - second point
- buildings - check GTA buildings (optional argument, defaults to true)
- vehicles - check vehicles (optional argument, defaults to true)
- peds - check peds (right now players, in the future also NPCs) (optional argument, defaults to true)
- objects - check objects (optional argument, defaults to true)
- transparent - check transparent stuff, such as glass and windows (optional argument, defaults to false)
- ignoreStuff - exclude some dynamic stuff from the test (probably crates and barrels) (optional argument, defaults to false)
For the next update I've also added a function which does basically the same check as this one, but it also returns some extra info about the collision. This includes the collision position, object model (useful for finding the model of a GTA object) and possible LU pool info (pointer to player, vehicle, object etc).