Hardrock/Sandbox – User

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
Option 1:
{|style="width:85%; text-align:left; vertical-align:top;  border:1px solid #cedff2" cellspacing="0" cellpadding="5"
|-
|colspan="3" style="background:#f5faff; border-bottom:1px solid #cedff2; font-size:1.2em; font-weight:bold; color:#6191C3"|Dependencies
|-
!style="width:100px"|Game:
|colspan="2"|Operation Flashpoint
|-
!Game Version:
|colspan="2"|1.00
|-
|colspan="3" style="background:#f5faff; border-top:1px solid #cedff2; border-bottom:1px solid #cedff2; font-size:1.2em; font-weight:bold; color:#6191C3"|Description
|-
!style="vertical-align:top"|Description:
|colspan="2"|Adds an event handler to a given unit. For more information about event handlers and their types check the scripting topic Event Handlers in this reference. You may add as many event handlers of any type as you like to every unit, if you add an event handler of type "killed" and there already exists one, the old one doesn't get overwritten. Use removeEventHandler to delete event handlers.
|-
|colspan="3" style="background:#f5faff; border-top:1px solid #cedff2; border-bottom:1px solid #cedff2; font-size:1.2em; font-weight:bold; color:#6191C3"|Usage
|-
!style="vertical-align:top"|Syntax:
|colspan="2"|unit '''addEventHandler''' [type, code]
|-
!style="vertical-align:top; background:#FAFAFA"|Parameters:
|style="width:100px; background:#FAFAFA"|''unit'': [[Object]]
|style="background:#FAFAFA"|
|-
|style="background:#FAFAFA"|
|style="background:#FAFAFA"|''type'': [[String]]
|style="background:#FAFAFA"|Event handler type
|-
|style="background:#FAFAFA"|
|style="background:#FAFAFA"|''code'': [[String]]
|style="background:#FAFAFA"|Code that should be executed once the event occurs
|-
!style="vertical-align:top"|Return Value:
|style="vertical-align:top"|[[Integer]]
|The index of the currently added event handler is returned. Indices start at 0 for each unit and increment with each added event handler.
|-
!style="vertical-align:top"|Multiplayer:
|colspan="2" style="vertical-align:top"|Behaviour not known.
|-
|colspan="3" style="background:#f5faff; border-top:1px solid #cedff2; border-bottom:1px solid #cedff2; font-size:1.2em; font-weight:bold; color:#6191C3"|Examples
|-
!style="vertical-align:top"|Example 1:
|colspan="2" style="vertical-align:top"|<code>Code 1</code>
|-
!style="vertical-align:top"|Example 2:
|colspan="2" style="vertical-align:top"|<code>Code 2</code>
|-
|colspan="3" style="background:#f5faff; border-top:1px solid #cedff2; border-bottom:1px solid #cedff2; font-size:1.2em; font-weight:bold; color:#6191C3"|Additional Information
|-
!style="vertical-align:top"|See also:
|colspan="2" style="vertical-align:top"|'''[[removeEventHandler]]'''
|-
!style="vertical-align:top"|Attention:
|colspan="2" style="vertical-align:top"|This and that happens then and then.
|-
!style="vertical-align:top"|Bugs:
|colspan="2"|
* First bug
* Second bug
|}
Option 2:
__NOTOC__
__NOTOC__



Revision as of 03:03, 27 July 2006


Dependencies

Game:
Operation Flashpoint
Version:
1.00

Description

Description:
Adds an event handler to a given unit. For more information about event handlers and their types check the scripting topic Event Handlers in this reference. You may add as many event handlers of any type as you like to every unit, if you add an event handler of type "killed" and there already exists one, the old one doesn't get overwritten. Use removeEventHandler to delete event handlers.

Usage

Syntax:
unit addEventHandler [type, code]
Parameters:
unit: Object
type: String - Event handler type
code: String - Code that should be executed once the event occurs
Return Value:
Integer - The index of the currently added event handler is returned. Indices start at 0 for each unit and increment with each added event handler.
Multiplayer:
Behaviour unknown.

Examples

Example 1:
Code 1
Example 2:
Code 2

Additional Information

See also:
removeEventHandler
Attention:
Not filled.
Bugs:
  • First
  • Second
  • Third