fixed a bug where menu handler used wrong variable for param2 bitmask in MenuVoteEnd
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 */
49 #include <usermessages>
55 * Declare this as a struct in your plugin to expose its information.
58 * public Plugin:myinfo =
67 * Called when the plugin is fully initialized and all known external references are resolved.
68 * This is called even if the plugin type is "private."
69 * @note Errors in this function will cause the plugin to stop running.
73 forward OnPluginStart();
76 * Called before OnPluginStart, in case the plugin wants to check for load failure.
77 * This is called even if the plugin type is "private." Any natives from modules are
78 * not available at this point. Thus, this forward should only be used for explicit
79 * pre-emptive things, such as adding dynamic natives, or setting certain types of load filters.
81 * @note It is not safe to call externally resolved natives until OnPluginStart().
82 * @note Any sort of RTE in this function will cause the plugin to fail loading.
84 * @param myself Handle to the plugin.
85 * @param late Whether or not the plugin was loaded "late" (after map load).
86 * @param error Error message buffer in case load failed.
87 * @param err_max Maximum number of characters for error message buffer.
88 * @return True if load success, false otherwise.
90 forward bool:AskPluginLoad(Handle:myself, bool:late, String:error[], err_max);
93 * Called when the plugin is about to be unloaded.
97 forward OnPluginEnd();
100 * Called when the plugin's pause status is changing.
102 * @param pause True if the plugin is being paused, false otherwise.
105 forward OnPluginPauseChange(bool:pause);
108 * Called before every server frame. Note that you should avoid
109 * doing expensive computations here, and you should declare large
110 * local arrays using 'decl' instead of 'new'.
112 forward OnGameFrame();
115 * Called when the map is loaded.
117 * @note This used to be OnServerLoad(), which is now deprecated.
118 * Plugins still using the old forward will work.
120 forward OnMapStart();
123 * Called right before a map ends.
128 * Called when the map has loaded and the servercfgfile has finished
129 * executing. This is usually 'server.cfg' but most mods allow it to
130 * be set via 'servercfgfile'.
132 * @note If server.cfg is executed more than once per map, this forward
133 * will only be called the first time (per map).
134 * @note It is not guaranteed that this will be called on all mods. If
135 * a mod does not appear to support it, please file a SourceMod bug report.
137 forward OnServerCfg();
140 * Returns the calling plugin's Handle.
142 * @return Handle of the calling plugin.
144 native Handle:GetMyHandle();
147 * Returns an iterator that can be used to search through plugins.
149 * @return Handle to iterate with. Must be closed via
151 * @error Invalid Handle.
153 native Handle:GetPluginIterator();
156 * Returns whether there are more plugins available in the iterator.
158 * @param iter Handle to the plugin iterator.
159 * @return True on more plugins, false otherwise.
160 * @error Invalid Handle.
162 native bool:MorePlugins(Handle:iter);
165 * Returns the current plugin in the iterator and advances the iterator.
167 * @param iter Handle to the plugin iterator.
168 * @return Current plugin the iterator is at, before
169 * the iterator is advanced.
170 * @error Invalid Handle.
172 native Handle:ReadPlugin(Handle:iter);
175 * Returns a plugin's status.
177 * @param plugin Plugin Handle (INVALID_HANDLE uses the calling plugin).
178 * @return Status code for the plugin.
179 * @error Invalid Handle.
181 native PluginStatus:GetPluginStatus(Handle:plugin);
184 * Retrieves a plugin's file name relative to the plugins folder.
186 * @param plugin Plugin Handle (INVALID_HANDLE uses the calling plugin).
187 * @param buffer Buffer to the store the file name.
188 * @param maxlength Maximum length of the name buffer.
190 * @error Invalid Handle.
192 native GetPluginFilename(Handle:plugin, String:buffer[], maxlength);
195 * Retrieves whether or not a plugin is being debugged.
197 * @param plugin Plugin Handle (INVALID_HANDLE uses the calling plugin).
198 * @return True if being debugged, false otherwise.
199 * @error Invalid Handle.
201 native bool:IsPluginDebugging(Handle:hndl);
204 * Retrieves a plugin's public info.
206 * @param plugin Plugin Handle (INVALID_HANDLE uses the calling plugin).
207 * @param info Plugin info property to retrieve.
208 * @param buffer Buffer to store info in.
209 * @param maxlength Maximum length of buffer.
210 * @return True on success, false if property is not available.
211 * @error Invalid Handle.
213 native bool:GetPluginInfo(Handle:plugin, PluginInfo:info, String:buffer[], maxlength);
216 * Causes the plugin to enter a failed state. An error will be thrown and
217 * the plugin will be paused until it is unloaded or reloaded.
219 * @param string Message to print.
221 * @error Always throws SP_ERROR_ABORT.
223 native SetFailState(const String:string[]);
226 * Aborts the current callback and throws an error. This function
227 * does not return in that no code is executed following it.
229 * @param format String format.
230 * @param ... Format arguments.
234 native ThrowError(const String:fmt[], any:...);
237 * Logs a plugin message to the SourceMod logs.
239 * @param format String format.
240 * @param ... Format arguments.
243 native LogMessage(const String:format[], any:...);
246 * Logs a plugin error message to the SourceMod logs.
248 * @param format String format.
249 * @param ... Format arguments.
252 native LogError(const String:format[], any:...);
255 * Gets the system time as a unix timestamp.
257 * @param bigStamp Optional array to store the 64bit timestamp in.
258 * @return 32bit timestamp (number of seconds since unix epoch).
260 native GetTime(bigStamp[2]={0,0});
263 * Loads a game config file.
265 * @param file File to load. The path must be relative to the 'gamedata' folder under the config folder
266 * and the extension should be omitted.
267 * @return A handle to the game config file or INVALID_HANDLE in failure.
269 native Handle:LoadGameConfigFile(const String:file[]);
272 * Returns an offset value.
274 * @param gc Game config handle.
275 * @param key Key to retrieve from the offset section.
276 * @return An offset, or -1 on failure.
278 native GameConfGetOffset(Handle:gc, const String:key[]);
281 * Gets the value of a key from the "Keys" section.
283 * @param gc Game config handle.
284 * @param key Key to retrieve from the Keys section.
285 * @param buffer Destination string buffer.
286 * @param maxlen Maximum length of output string buffer.
287 * @return True if key existed, false otherwise.
289 native bool:GameConfGetKeyValue(Handle:gc, const String:key[], String:buffer[], maxlen);
292 * Returns the operating system's "tick count," which is a number of
293 * milliseconds since the operating system loaded. This can be used
294 * for basic benchmarks.
296 * @return Tick count in milliseconds.
298 native GetSysTickCount();