IsLineOfSightClear: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
{{Client function}}
{{Client function}}
{{Needs Checking|Needs verifying default values for all optional args and explaining the meaning of some of them (''checkDummies, seeThroughStuff, ignoreSomeObjectsForCamera''). --[[User:Jbeta|jbeta]] 17:51, 12 August 2007 (CDT)}}
This function checks if there are obstacles between two points of the game world, optionally ignoring certain kinds of elements.
This function checks if there are obstacles between two points of the game world, optionally ignoring certain kinds of elements.



Revision as of 16:52, 30 August 2007

This function checks if there are obstacles between two points of the game world, optionally ignoring certain kinds of elements.

Syntax

bool isLineOfSightClear ( float startX, float startY, float startZ, float endX, float endY, float endZ, [ bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkObjects, bool checkDummies, bool seeThroughStuff, bool ignoreSomeObjectsForCamera, element ignoredElement ] )

Required Arguments

  • startX: The first point's world X coordinate.
  • startY: The first point's world Y coordinate.
  • startZ: The first point's world Z coordinate.
  • endX: The second point's world X coordinate.
  • endY: The second point's world X coordinate.
  • endZ: The second point's world X coordinate.

Optional Arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.

  • checkBuildings: Allow the line of sight to be blocked by GTA's internally placed buildings, i.e. the world map.
  • checkVehicles: Allow the line of sight to be blocked by vehicles.
  • checkPeds: Allow the line of sight to be blocked by peds, i.e. players.
  • checkObjects: Allow the line of sight to be blocked by objects.
  • checkDummies: Allow the line of sight to be blocked by GTA's internal dummies. These are not used in the current MTA version so this argument can be set to false.
  • seeThroughStuff: Allow the line of sight to be blocked by translucent game objects, e.g. glass.
  • ignoreSomeObjectsForCamera: Allow the line of sight to be blocked by certain objects.
  • shootThroughStuff: Allow the line of sight to be blocked by certain entities.
  • ignoredElement: Allow the line of sight to pass through a certain specified element.

Returns

Returns true if the line between the specified points is clear, false if there's an obstacle or if invalid parameters are passed.

Example

This page does not have an example

--add an example here

See Also