Commands/Lua

Reference for console commands, Lua hooks and Lua commands in CS2D.

CS2D Command CS2D Console Commands

Lua Hook Lua Hooks

Lua Command Lua Commands

Category: all (88)

Lua Command freeline

Categories

Parameters

  • x1
  • y1
  • x2
  • y2
  • mode

Info

Checks if the given line between the points x1|y1 and x2|y2 in pixel coordinates is free. Returns true if free (depending on mode) or false otherwise.

Modes:

  • 0: Walkable? Checks if all tiles are walkable (no wall, no obstacle, not deadly)

  • 1: Line of sight / shootable? Checks if there's anything in the path which would block shooting (walls).

  • 2: Shootable (like 1)? But also check for Terrorist players and hostages.

  • 3: Shootable (like 2)? But also check for Counter-Terrorist/VIP players and hostages.