Dota 2 Workshop Tools/Scripting/API/Global.ListenToGameEvent

From Valve Developer Community
Jump to: navigation, search
Note.pngNote: This page is automatically generated. Any changes may be overwritten

Function Description

int ListenToGameEvent(string EventName, handle functionNameToCall, handle context)

Register as a listener for a game event from script.

Tip.pngTip:In addition to listening for standard engine events, you can also create your own events by placing them in /scripts/custom_events.txt.


Example
ListenToGameEvent('entity_killed', Dynamic_Wrap(MyCustomGameMode, 'OnEntityKilled'), self)

Parameters

Type Name Description
string EventName No Description Set
handle functionNameToCall No Description Set
handle context No Description Set

Returns

int - a handle for the event/function pair