onClientClickCheckbox

From Liberty Unleashed Wiki
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This event is called when the local player clicks a checkbox.

Syntax

  1. function onClientClickCheckbox( int checkID, bool down )

Arguments

  • checkID - The ID of the checkbox in question
  • down - Was the mouse button pressed down or released

Returns

  • 1 - Let the checkbox be checked/unchecked normally
  • 0 - Returning 0 locks the status of the checkbox (if the mouse button is released)

Example

This code will tell a player they pressed a checkbox.

  1.  
  2. function onClientClickCheckbox( checkID, down )
  3. {
  4. Message("You just clicked on a checkbox.");
  5. return 1;
  6. }
  7.  

This code will stop a player from enabling (or disabling) a checkbox.

  1.  
  2. function onClientClickCheckbox( checkID, down )
  3. {
  4. Message("I'm afraid I can't let you do that.");
  5. return 0;
  6. }
  7.  

Notes

The function Message was used in both examples and has more information on the corresponding page.

Related Events

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox