Changed a few natives/stocks that should have used IsClientInGame() rather than IsClientConnected()
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 _sourcemod_included
19 #define _sourcemod_included
22 * Plugin public information.
26 const String:name[], /**< Plugin Name */
27 const String:description[], /**< Plugin Description */
28 const String:author[], /**< Plugin Author */
29 const String:version[], /**< Plugin Version */
30 const String:url[], /**< Plugin URL */
48 #include <usermessages>
52 * Declare this as a struct in your plugin to expose its information.
55 * public Plugin:myinfo =
64 * Called when the plugin is fully initialized and all known external references are resolved.
65 * This is called even if the plugin type is "private."
66 * @note Errors in this function will cause the plugin to stop running.
70 forward OnPluginStart();
73 * Called before OnPluginStart, in case the plugin wants to check for load failure.
74 * This is called even if the plugin type is "private." Any natives from modules are
75 * not available at this point. Thus, this forward should only be used for explicit
76 * pre-emptive things, such as adding dynamic natives, or setting certain types of load filters.
78 * @note It is not safe to call externally resolved natives until OnPluginStart().
79 * @note Any sort of RTE in this function will cause the plugin to fail loading.
81 * @param myself Handle to the plugin.
82 * @param late Whether or not the plugin was loaded "late" (after map load).
83 * @param error Error message buffer in case load failed.
84 * @param err_max Maximum number of characters for error message buffer.
85 * @return True if load success, false otherwise.
87 forward bool:AskPluginLoad(Handle:myself, bool:late, String:error[], err_max);
90 * Called when the plugin is about to be unloaded.
94 forward OnPluginEnd();
97 * Called when the plugin's pause status is changing.
99 * @param pause True if the plugin is being paused, false otherwise.
102 forward OnPluginPauseChange(bool:pause);
105 * Called before every server frame. Note that you should avoid
106 * doing expensive computations here, and you should declare large
107 * local arrays using 'decl' instead of 'new'.
109 forward OnGameFrame();
112 * Called when the map is loaded.
114 * @note This used to be OnServerLoad(), which is now deprecated.
115 * Plugins still using the old forward will work.
117 forward OnMapStart();
120 * Called right before a map ends.
125 * Called when the map has loaded and the servercfgfile has finished
126 * executing. This is usually 'server.cfg' but most mods allow it to
127 * be set via 'servercfgfile'.
129 * @note If server.cfg is executed more than once per map, this forward
130 * will only be called the first time (per map).
131 * @note It is not guaranteed that this will be called on all mods. If
132 * a mod does not appear to support it, please file a SourceMod bug report.
134 forward OnServerCfg();
137 * Returns the calling plugin's Handle.
139 * @return Handle of the calling plugin.
141 native Handle:GetMyHandle();
144 * Returns an iterator that can be used to search through plugins.
146 * @return Handle to iterate with. Must be closed via
148 * @error Invalid Handle.
150 native Handle:GetPluginIterator();
153 * Returns whether there are more plugins available in the iterator.
155 * @param iter Handle to the plugin iterator.
156 * @return True on more plugins, false otherwise.
157 * @error Invalid Handle.
159 native bool:MorePlugins(Handle:iter);
162 * Returns the current plugin in the iterator and advances the iterator.
164 * @param iter Handle to the plugin iterator.
165 * @return Current plugin the iterator is at, before
166 * the iterator is advanced.
167 * @error Invalid Handle.
169 native Handle:ReadPlugin(Handle:iter);
172 * Returns a plugin's status.
174 * @param plugin Plugin Handle (INVALID_HANDLE uses the calling plugin).
175 * @return Status code for the plugin.
176 * @error Invalid Handle.
178 native PluginStatus:GetPluginStatus(Handle:plugin);
181 * Retrieves a plugin's file name relative to the plugins folder.
183 * @param plugin Plugin Handle (INVALID_HANDLE uses the calling plugin).
184 * @param buffer Buffer to the store the file name.
185 * @param maxlength Maximum length of the name buffer.
187 * @error Invalid Handle.
189 native GetPluginFilename(Handle:plugin, String:buffer[], maxlength);
192 * Retrieves whether or not a plugin is being debugged.
194 * @param plugin Plugin Handle (INVALID_HANDLE uses the calling plugin).
195 * @return True if being debugged, false otherwise.
196 * @error Invalid Handle.
198 native bool:IsPluginDebugging(Handle:hndl);
201 * Retrieves a plugin's public info.
203 * @param plugin Plugin Handle (INVALID_HANDLE uses the calling plugin).
204 * @param info Plugin info property to retrieve.
205 * @param buffer Buffer to store info in.
206 * @param maxlength Maximum length of buffer.
207 * @return True on success, false if property is not available.
208 * @error Invalid Handle.
210 native bool:GetPluginInfo(Handle:plugin, PluginInfo:info, String:buffer[], maxlength);
213 * Causes the plugin to enter a failed state. An error will be thrown and
214 * the plugin will be paused until it is unloaded or reloaded.
216 * @param string Message to print.
218 * @error Always throws SP_ERROR_ABORT.
220 native SetFailState(const String:string[]);
223 * Aborts the current callback and throws an error. This function
224 * does not return in that no code is executed following it.
226 * @param format String format.
227 * @param ... Format arguments.
231 native ThrowError(const String:fmt[], any:...);
234 * Logs a plugin message to the SourceMod logs.
236 * @param format String format.
237 * @param ... Format arguments.
240 native LogMessage(const String:format[], any:...);
243 * Logs a plugin error message to the SourceMod logs.
245 * @param format String format.
246 * @param ... Format arguments.
249 native LogError(const String:format[], any:...);
252 * Gets the system time as a unix timestamp.
254 * @param bigStamp Optional array to store the 64bit timestamp in.
255 * @return 32bit timestamp (number of seconds since unix epoch).
257 native GetTime(bigStamp[2]={0,0});
260 * Loads a game config file.
262 * @param file File to load. The path must be relative to the 'gamedata' folder under the config folder
263 * and the extension should be omitted.
264 * @return A handle to the game config file or INVALID_HANDLE in failure.
266 native Handle:LoadGameConfigFile(const String:file[]);
269 * Returns an offset value.
271 * @param gc Game config handle.
272 * @param key Key to retrieve from the offset section.
273 * @return An offset, or -1 on failure.
275 native GameConfGetOffset(Handle:gc, const String:key[]);
278 * Gets the value of a key from the "Keys" section.
280 * @param gc Game config handle.
281 * @param key Key to retrieve from the Keys section.
282 * @param buffer Destination string buffer.
283 * @param maxlen Maximum length of output string buffer.
284 * @return True if key existed, false otherwise.
286 native bool:GameConfGetKeyValue(Handle:gc, const String:key[], String:buffer[], maxlen);
289 * Returns the operating system's "tick count," which is a number of
290 * milliseconds since the operating system loaded. This can be used
291 * for basic benchmarks.
293 * @return Tick count in milliseconds.
295 native GetSysTickCount();