Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Constant pseudo-enums
- const bool DataTableScopeGlobal = true;
- const bool DataTableScopeLocal = false;
- const bool TriggerTestConditions = true;
- const bool TriggerIgnoreConditions = false;
- const bool TriggerRunInSeparateThread = false;
- const bool TriggerRunInSameThread = true;
- // Constant
- const string RegisterButtonKeyPrefix = "TriggerButton";
- // Function to register a button to run a specific trigger
- void RegisterButtonForTriggerExecution (int button, trigger buttonTrigger)
- {
- DataTableSetTrigger(DataTableScopeGlobal,RegisterButtonKeyPrefix+IntToString(button),buttonTrigger);
- }
- // Example trigger action
- bool ExampleButtonTriggerAction (bool textConditions, bool runActions)
- {
- int player = EventPlayer();
- int button = EventDialogControl();
- string key = RegisterButtonKeyPrefix+IntToString(button);
- if (DataTableValueExists(DataTableScopeGlobal,key))
- {
- TriggerExecute(DataTableGetTrigger(DataTableScopeGlobal,key),TriggerTestConditions,TriggerRunInSeparateThread);
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement