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 freerect

Categories

Parameters

  • x
  • y
  • width
  • height
  • mode

Info

Checks if the given rectangle starting at x|y and with the given width and height (all 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: Free sight / shootable? Checks if there's anything in the rectangle 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.