TriggerRegisterGameEvent
- Parameters
-
whichTrigger trigger
whichGameEvent gameevent
- comment
Registers to execute whichTrigger when a game event occurs. Returns a handle to event that represents the registration, you can't do anything with those currently.
Example (Lua):
trg_gameev = CreateTrigger() -- this will print a message when someone opens a build menu TriggerAddAction(trg_gameev, function() print(GetTriggerEventId()) end) TriggerRegisterGameEvent(trg_gameev, EVENT_GAME_BUILD_SUBMENU) --> new event on build menu open
- bug
Registered events cannot be destroyed as an object.
- patch
1.00
- Source
- common.j
- return type
event
- Source code
native TriggerRegisterGameEvent takes trigger whichTrigger, gameevent whichGameEvent returns event