3 * ===============================================================
4 * Sample SourceMod Extension
5 * Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
6 * ===============================================================
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 #ifndef _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_
25 #define _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_
29 * @brief Sample extension code header.
32 #include "smsdk_ext.h"
36 * @brief Sample implementation of the SDK Extension.
37 * Note: Uncomment one of the pre-defined virtual functions in order to use it.
39 class Sample : public SDKExtension
43 * @brief This is called after the initial loading sequence has been processed.
45 * @param error Error message buffer.
46 * @param maxlength Size of error message buffer.
47 * @param late Whether or not the module was loaded after map load.
48 * @return True to succeed loading, false to fail.
50 //virtual bool SDK_OnLoad(char *error, size_t maxlength, bool late);
53 * @brief This is called right before the extension is unloaded.
55 //virtual void SDK_OnUnload();
58 * @brief This is called once all known extensions have been loaded.
59 * Note: It is is a good idea to add natives here, if any are provided.
61 //virtual void SDK_OnAllLoaded();
64 * @brief Called when the pause state is changed.
66 //virtual void SDK_OnPauseChange(bool paused);
69 * @brief this is called when Core wants to know if your extension is working.
71 * @param error Error message buffer.
72 * @param maxlength Size of error message buffer.
73 * @return True if working, false otherwise.
75 //virtual bool QueryRunning(char *error, size_t maxlength);
77 #if defined SMEXT_CONF_METAMOD
79 * @brief Called when Metamod is attached, before the extension version is called.
81 * @param error Error buffer.
82 * @param maxlength Maximum size of error buffer.
83 * @param late Whether or not Metamod considers this a late load.
84 * @return True to succeed, false to fail.
86 //virtual bool SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlength, bool late);
89 * @brief Called when Metamod is detaching, after the extension version is called.
90 * NOTE: By default this is blocked unless sent from SourceMod.
92 * @param error Error buffer.
93 * @param maxlength Maximum size of error buffer.
94 * @return True to succeed, false to fail.
96 //virtual bool SDK_OnMetamodUnload(char *error, size_t maxlength);
99 * @brief Called when Metamod's pause state is changing.
100 * NOTE: By default this is blocked unless sent from SourceMod.
102 * @param paused Pause state being set.
103 * @param error Error buffer.
104 * @param maxlength Maximum size of error buffer.
105 * @return True to succeed, false to fail.
107 //virtual bool SDK_OnMetamodPauseChange(bool paused, char *error, size_t maxlength);
111 #endif // _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_