Implemented amb296 - Added HookEventEx() which does not generate a runtime error if the event does not exist and returns false instead.

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40807
This commit is contained in:
Scott Ehlert
2007-05-16 04:09:31 +00:00
parent 1a77530c93
commit 4ed2d6e515
2 changed files with 32 additions and 0 deletions
+11
View File
@@ -66,6 +66,17 @@ funcenum EventHook
*/
native HookEvent(const String:name[], EventHook:callback, EventHookMode:mode=EventHookMode_Post);
/**
* Creates a hook for when a game event is fired.
*
* @param name Name of event.
* @param callback An EventHook function pointer.
* @param mode Optional EventHookMode determining the type of hook.
* @return True if event exists and was hooked successfully, false otherwise.
* @error Invalid callback function.
*/
native bool:HookEventEx(const String:name[], EventHook:callback, EventHookMode:mode=EventHookMode_Post);
/**
* Removes a hook for when a game event is fired.
*