Commands/Lua
Reference for console commands, Lua hooks and Lua commands in CS2D.
- Console Commands are entered in console, executed with key-binds, cfg-files or with Lua parse
- Lua Hooks execute Lua when events occur - some have a return value which can change the game behavior
- Lua Commands are used to retrieve game data or to perform actions in Lua scripts
CS2D Console Commands
Lua Hooks
Lua Commands
Category: player (12)
hascloseplayersCategories
Parameters
- x
- y
- radius
- [team] (optional)
Info
Checks if any alive player is within the specified radius (in pixels) around the specified position (x|y) in pixels.
Returns a boolean true, if at least one player matching the criteria was found. Otherwise false.
You can optionally specify a team to limit the search to players of that team:
- 0 - all teams (default)
- 1 - Ts only
- 2 - CTs only (including VIPs)
This method is faster than closeplayers because it only returns a simple boolean value and cancels the search as soon as a matching player was found within the radius.
Note: The position (x|y) and the radius are specified in PIXELS!
Note: If you also want to know which player(s) are within the radius you should use closeplayers instead (slower)!
Categories
Parameters
- x
- y
- radius
- [team] (optional)
Info
Checks if any alive player is within the specified radius (in pixels) around the specified position (x|y) in pixels.
Returns a boolean true, if at least one player matching the criteria was found. Otherwise false.
You can optionally specify a team to limit the search to players of that team:
This method is faster than closeplayers because it only returns a simple boolean value and cancels the search as soon as a matching player was found within the radius.
Returns a boolean true, if at least one player matching the criteria was found. Otherwise false.
You can optionally specify a team to limit the search to players of that team:
- 0 - all teams (default)
- 1 - Ts only
- 2 - CTs only (including VIPs)
This method is faster than closeplayers because it only returns a simple boolean value and cancels the search as soon as a matching player was found within the radius.
Note: The position (x|y) and the radius are specified in PIXELS!
Note: If you also want to know which player(s) are within the radius you should use closeplayers instead (slower)!