Skip to content

events

paint

paint()


game_event

game_event(event: game_event_t)

Name Type Description
event game_event_t Game event

override_view

override_view(view_setup: view_setup_t)

Name Type Description
view_setup view_setup_t View setup

console_input

console_input(cmd: string)

Name Type Description
cmd string Console command

This event is called fired when user presses enter in console.
First argument is the command that was entered.

Example

1
2
3
4
5
6
register_callback('console_input', function(cmd)
    print("user typed:", cmd)
    if cmd == 'quit' then
        return false -- prevents quit
    end
end)

Return value of the function

You can interrupt the in-game command execution by returning false from the function. So basically if you return false, the command will not be executed by the game.


player_chat

player_chat(msg: chat_message_t)

Name Type Description
msg chat_message_t Chat message

Return value of the function

You prevent chat print by returning false from the function. So basically if you return false, chat message will not print by the game.


string_cmd

string_cmd(cmd: string)

Name Type Description
cmd string Command

Example

1
2
3
4
5
6
7
register_callback('string_cmd', function(cmd)
    if cmd:find('say_team') then
        return nil --block team communication
    elseif cmd:find('say') then
        return 'say YOUR_MESSAGE'
    end
end)

unload

unload()