3 * ======================================================
4 * Metamod:Source Sample Plugin
5 * Written by AlliedModders LLC.
6 * ======================================================
8 * This software is provided 'as-is', without any express or implied warranty.
9 * In no event will the authors be held liable for any damages arising from
10 * the use of this software.
12 * This sample plugin is public domain.
17 #ifndef _INCLUDE_SOURCE_ENGINE_WRAPPERS_
18 #define _INCLUDE_SOURCE_ENGINE_WRAPPERS_
22 extern IVEngineServer *engine;
25 * For non-OrangeBox builds, we have to make wrappers.
27 #if defined ENGINE_ORIGINAL
30 * MM:S 1.4.x needs older API calls.
32 #if !defined METAMOD_PLAPI_VERSION
33 #define GetEngineFactory engineFactory
34 #define GetServerFactory serverFactory
35 #define MM_Format snprintf
37 #error "Metamod:Source 1.6 is not supported on the old engine."
41 * Wrap the CCommand class so our code looks the same for both engines.
48 return engine->Cmd_Args();
52 return engine->Cmd_Argc();
55 const char *Arg(int index)
57 return engine->Cmd_Argv(index);
61 #define CVAR_INTERFACE_VERSION VENGINE_CVAR_INTERFACE_VERSION
62 #define ENGINE_CALL(func) SH_CALL(m_EngineCC, func)
64 #elif defined ENGINE_ORANGEBOX
66 #define ENGINE_CALL(func) SH_CALL(engine, func)
67 #define MM_Format g_SMAPI->Format
71 #endif //_INCLUDE_SOURCE_ENGINE_WRAPPERS_