Implemented IsPlayerAlive native.
3 * ===============================================================
4 * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved.
5 * ===============================================================
7 * This file is part of the SourceMod/SourcePawn SDK. This file may only be used
8 * or modified under the Terms and Conditions of its License Agreement, which is found
9 * in LICENSE.txt. The Terms and Conditions for making SourceMod extensions/plugins
10 * may change at any time. To view the latest information, see:
11 * http://www.sourcemod.net/license.php
16 #if defined _events_included
19 #define _events_included
22 * Event hook modes determining how hooking should be handled
26 EventHookMode_Pre, /**< Hook callback fired before event is fired */
27 EventHookMode_Post, /**< Hook callback fired after event is fired */
28 EventHookMode_PostNoCopy /**< Hook callback fired after event is fired, but event data won't be copied */
32 * Hook function types for events.
37 * Called when a game event is fired.
39 * @param event Handle to event. This could be INVALID_HANDLE if every plugin hooking
40 * this event has set the hook mode EventHookMode_PostNoCopy.
41 * @param name String containing the name of the event.
42 * @param dontBroadcast True if event was not broadcast to clients, false otherwise.
43 * @return Ignored for post hooks. Plugin_Handled will block event if hooked as pre.
45 Action:public(Handle:event, const String:name[], bool:dontBroadcast),
47 * Called when a game event is fired.
49 * @param event Handle to event. This could be INVALID_HANDLE if every plugin hooking
50 * this event has set the hook mode EventHookMode_PostNoCopy.
51 * @param name String containing the name of the event.
52 * @param dontBroadcast True if event was not broadcast to clients, false otherwise.
55 public(Handle:event, const String:name[], bool:dontBroadcast),
59 * Creates a hook for when a game event is fired.
61 * @param name Name of event.
62 * @param callback An EventHook function pointer.
63 * @param mode Optional EventHookMode determining the type of hook.
65 * @error Invalid event name or invalid callback function.
67 native HookEvent(const String:name[], EventHook:callback, EventHookMode:mode=EventHookMode_Post);
70 * Creates a hook for when a game event is fired.
72 * @param name Name of event.
73 * @param callback An EventHook function pointer.
74 * @param mode Optional EventHookMode determining the type of hook.
75 * @return True if event exists and was hooked successfully, false otherwise.
76 * @error Invalid callback function.
78 native bool:HookEventEx(const String:name[], EventHook:callback, EventHookMode:mode=EventHookMode_Post);
81 * Removes a hook for when a game event is fired.
83 * @param name Name of event.
84 * @param callback An EventHook function pointer.
85 * @param mode Optional EventHookMode determining the type of hook.
87 * @error Invalid callback function or no active hook for specified event.
89 native UnhookEvent(const String:name[], EventHook:callback, EventHookMode:mode=EventHookMode_Post);
92 * Creates a game event to be fired later.
94 * @param name Name of event.
95 * @param force If set to true, this forces the event to be created even if it's not being hooked.
96 * Note that this will not force it if the event doesn't exist at all.
97 * @return Handle to event. INVALID_HANDLE is returned if the event doesn't exist or isn't
98 being hooked (unless force is true).
100 native Handle:CreateEvent(const String:name[], bool:force=false);
103 * Fires a game event.
105 * @param event Handle to the event.
106 * @param dontBroadcast Optional boolean that determines if event should be broadcast to clients.
108 * @error Invalid or corrupt Handle.
110 native FireEvent(Handle:event, bool:dontBroadcast=false);
113 * Cancels a previously created game event that has not been fired.
115 * @param event Handled to the event.
117 * @error Invalid or corrupt Handle.
119 native CancelCreatedEvent(Handle:event);
122 * Returns the boolean value of a game event's key.
124 * @param event Handle to the event.
125 * @param key Name of event key.
126 * @return The boolean value of the specfied event key.
127 * @error Invalid or corrupt Handle.
129 native bool:GetEventBool(Handle:event, const String:key[]);
132 * Sets the boolean value of a game event's key.
134 * @param event Handle to the event.
135 * @param key Name of event key.
136 * @param value New boolean value.
138 * @error Invalid or corrupt Handle.
140 native SetEventBool(Handle:event, const String:key[], bool:value);
143 * Returns the integer value of a game event's key.
145 * @param event Handle to the event.
146 * @param key Name of event key.
147 * @return The integer value of the specfied event key.
148 * @error Invalid or corrupt Handle.
150 native GetEventInt(Handle:event, const String:key[]);
153 * Sets the integer value of a game event's key.
155 * @param event Handle to the event.
156 * @param key Name of event key.
157 * @param value New integer value.
159 * @error Invalid or corrupt Handle.
161 native SetEventInt(Handle:event, const String:key[], value);
164 * Returns the floating point value of a game event's key.
166 * @param event Handle to the event.
167 * @param key Name of event key.
168 * @return The floating point value of the specfied event key.
169 * @error Invalid or corrupt Handle.
171 native Float:GetEventFloat(Handle:event, const String:key[]);
174 * Sets the floating point value of a game event's key.
176 * @param event Handle to the event.
177 * @param key Name of event key.
178 * @param value New floating point value.
180 * @error Invalid or corrupt Handle.
182 native SetEventFloat(Handle:event, const String:key[], Float:value);
185 * Retrieves the string value of a game event's key.
187 * @param event Handle to the event.
188 * @param key Name of event key.
189 * @param value Buffer to store the value of the specified event key.
190 * @param maxlength Maximum length of string buffer.
192 * @error Invalid or corrupt Handle.
194 native GetEventString(Handle:event, const String:key[], String:value[], maxlength);
197 * Sets the string value of a game event's key.
199 * @param event Handle to the event.
200 * @param key Name of event key.
201 * @param value New string value.
203 * @error Invalid or corrupt Handle.
205 native SetEventString(Handle:event, const String:key[], const String:value[]);
208 * Retrieves the name of a game event.
210 * @param event Handle to the event.
211 * @param value Buffer to store the name of the event.
212 * @param maxlength Maximum length of string buffer.
214 * @error Invalid or corrupt Handle.
216 native GetEventName(Handle:event, String:name[], maxlength);