Lua hooks (Counter-Strike 2D)

From Unreal Software English Wiki
(Difference between revisions)
Jump to: navigation, search
(Add first Lua hooks from Basic category)
 
(Add move hook)
Line 95: Line 95:
 
*1 - normal parsing, ignore unknown commands
 
*1 - normal parsing, ignore unknown commands
 
*2 - skip CS2D parsing, CS2D will not execute this command
 
*2 - skip CS2D parsing, CS2D will not execute this command
 +
 +
 +
= Player =
 +
 +
== move ==
 +
 +
'''move''' is called everytime a player moves. Called at most once a frame.
 +
 +
*Note: It is possible that this is not triggered every frame even though the client moves constantly. This depends on the network conditions
 +
 +
'''Syntax:''' <code>id, x, y, walking</code>
 +
 +
<code>id (number)</code> - player ID
 +
 +
<code>x, y (number)</code> - new player position on map in pixels
 +
 +
<code>walking (number)</code> - was the player walking (holding SHIFT)? 0 = running, 1 = walking
 +
 +
'''Return:''' none

Revision as of 19:40, 17 April 2016

This page lists all available Lua hooks in Counter-Strike 2D. For a more up-to-date version made by DC, refer to http://www.cs2d.com/help.php?hookcat=all

NOTE: This page is incomplete!

Contents

Basic

break

break is fired once a breakable entity is destroyed.

Syntax: x, y, playerID

x, y - breakable entity position in tiles

playerID - ID of player who destroyed the breakable or 0 if it was not broken by a player

Return: none


endround

endround is executed on round end

Syntax: mode

mode - specifies the type of a round end

Possible mode values:


log

log is executed when a text line has to be logged (console, log file).

Syntax: text

text - text to be written to log

Return:


mapchange

mapchange is fired when server changes the map.

Syntax: newmap

newmap - name of the new map that will be loaded

Return: none


parse

parse is fired once the server parses a server-side console command.

Syntax: text

text - text to be parsed and interpreted as a command

Return:


Player

move

move is called everytime a player moves. Called at most once a frame.

Syntax: id, x, y, walking

id (number) - player ID

x, y (number) - new player position on map in pixels

walking (number) - was the player walking (holding SHIFT)? 0 = running, 1 = walking

Return: none

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox