Counter Strike Online Wiki
Advertisement

UI event callback


Event Callback[]

UI.Event:OnRoundStart ()[]

Event callback that is called when the round starts.


UI.Event:OnSpawn ()[]

Event callback that is called when the player spawns.


UI.Event:OnKilled ()[]

An event callback that is called when the player dies.


UI.Event:OnInput (inputs)[]

An event callback that is called continuously when the player holds down the key.
Inputs is an array of key states. You can get the status of each key through the UI.KEY enumerator.

Parameters:

  • inputs: (table) key state array
Usage:
function UI.Event:OnInput(inputs)
    if inputs[UI.KEY.A] == true then
        print('A key is pressed!')
    end
end


UI.Event:OnUpdate (time)[]

Event callback that is called per frame.
WARNING: do not do use so much this callback!
Parameters:
  • time: (number) Current game time


UI.Event:OnChat (text)[]

Event callback that is called when the player enters the chat.
Parameters:


UI.Event:OnSignal (signal)[]

Event callback that is called when a signal is received from the server.
Parameters:
  • signal: (int)


UI.Event:OnKeyDown (inputs)[]

Event callback that is called when the player presses a key.
Inputs is an array that stores the keys where the KeyDown event occurred. Usage is the same as OnInput
Parameters:
  • inputs: (table) key array


UI.Event:OnKeyUp (inputs)[]

Event callback that is called when the player releases the key.
Inputs is an array that stores the keys where the KeyUp event occurred. Usage is the same as OnInput
Parameters:
  • inputs: (table) key array

Advertisement