Author Topic: IsLineOfSightClear(?)  (Read 2330 times)

IdkanYavuk X

  • Jr. Member
  • **
  • Posts: 91
  • Karma: +37/-36
  • Developer for The Newport Experience
    • View Profile
IsLineOfSightClear(?)
« on: May 18, 2013, 09:17:27 pm »
Direct to the point...
Arguments for the IsLineOfSightClear function are needed, do anyone knows them?

Thank you

Juppi

  • Developer
  • Jr. Member
  • *****
  • Posts: 86
  • Karma: +3/-1
    • View Profile
    • Kuslahden alaste GTA:MP clan
Re: IsLineOfSightClear(?)
« Reply #1 on: May 19, 2013, 02:21:19 pm »
Code: [Select]
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).

Vortrex

  • Full Member
  • ***
  • Posts: 267
  • Karma: +54/-73
    • View Profile
Re: IsLineOfSightClear(?)
« Reply #2 on: May 19, 2013, 06:54:54 pm »
Thanks Juppi, this is very helpful.

I have one problem however: this function always crashes my game when used.

Juppi

  • Developer
  • Jr. Member
  • *****
  • Posts: 86
  • Karma: +3/-1
    • View Profile
    • Kuslahden alaste GTA:MP clan
Re: IsLineOfSightClear(?)
« Reply #3 on: May 19, 2013, 10:23:11 pm »
Ah yeah I can confirm that. Hopefully it'll be fixed in the next update

Vortrex

  • Full Member
  • ***
  • Posts: 267
  • Karma: +54/-73
    • View Profile
Re: IsLineOfSightClear(?)
« Reply #4 on: January 06, 2014, 02:38:45 pm »
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).

I hate to be the idiot that causes necromancy to an old thread, but what is this function called? We have had new updates since this post and I cannot find documentation anywhere for it.

SugarD

  • Argonath RPG Dev/Manager
  • Tester
  • Sr. Member
  • ****
  • Posts: 820
  • Karma: +37/-75
  • STOP IN THE NAME OF THE COLESLAW!
    • View Profile
    • Clan Xperience
Re: IsLineOfSightClear(?)
« Reply #5 on: January 19, 2014, 09:39:51 pm »
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).

I hate to be the idiot that causes necromancy to an old thread, but what is this function called? We have had new updates since this post and I cannot find documentation anywhere for it.
I think he meant for the 0.1.1.0 update, rather than the updates to the 0.1.0.x branch.

 

© Liberty Unleashed Team.