2007-10-07 05:12:19 +02:00
|
|
|
/**
|
|
|
|
* vim: set ts=4 :
|
|
|
|
* ======================================================
|
|
|
|
* Metamod:Source Sample Plugin
|
|
|
|
* Written by AlliedModders LLC.
|
|
|
|
* ======================================================
|
|
|
|
*
|
|
|
|
* This software is provided 'as-is', without any express or implied warranty.
|
|
|
|
* In no event will the authors be held liable for any damages arising from
|
|
|
|
* the use of this software.
|
|
|
|
*
|
|
|
|
* This sample plugin is public domain.
|
|
|
|
*
|
|
|
|
* Version: $Id$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include "sample_mm.h"
|
|
|
|
|
|
|
|
SH_DECL_HOOK6(IServerGameDLL, LevelInit, SH_NOATTRIB, 0, bool, char const *, char const *, char const *, char const *, bool, bool);
|
|
|
|
SH_DECL_HOOK3_void(IServerGameDLL, ServerActivate, SH_NOATTRIB, 0, edict_t *, int, int);
|
|
|
|
SH_DECL_HOOK1_void(IServerGameDLL, GameFrame, SH_NOATTRIB, 0, bool);
|
|
|
|
SH_DECL_HOOK0_void(IServerGameDLL, LevelShutdown, SH_NOATTRIB, 0);
|
|
|
|
SH_DECL_HOOK2_void(IServerGameClients, ClientActive, SH_NOATTRIB, 0, edict_t *, bool);
|
|
|
|
SH_DECL_HOOK1_void(IServerGameClients, ClientDisconnect, SH_NOATTRIB, 0, edict_t *);
|
|
|
|
SH_DECL_HOOK2_void(IServerGameClients, ClientPutInServer, SH_NOATTRIB, 0, edict_t *, char const *);
|
|
|
|
SH_DECL_HOOK1_void(IServerGameClients, SetCommandClient, SH_NOATTRIB, 0, int);
|
|
|
|
SH_DECL_HOOK1_void(IServerGameClients, ClientSettingsChanged, SH_NOATTRIB, 0, edict_t *);
|
|
|
|
SH_DECL_HOOK5(IServerGameClients, ClientConnect, SH_NOATTRIB, 0, bool, edict_t *, const char*, const char *, char *, int);
|
|
|
|
SH_DECL_HOOK2(IGameEventManager2, FireEvent, SH_NOATTRIB, 0, bool, IGameEvent *, bool);
|
|
|
|
|
2008-11-24 19:03:02 +01:00
|
|
|
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
2007-10-07 05:12:19 +02:00
|
|
|
SH_DECL_HOOK2_void(IServerGameClients, NetworkIDValidated, SH_NOATTRIB, 0, const char *, const char *);
|
|
|
|
SH_DECL_HOOK2_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, edict_t *, const CCommand &);
|
2008-11-24 19:03:02 +01:00
|
|
|
#else
|
2007-10-07 05:12:19 +02:00
|
|
|
SH_DECL_HOOK1_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, edict_t *);
|
|
|
|
#endif
|
|
|
|
|
2008-11-24 19:03:02 +01:00
|
|
|
SamplePlugin g_SamplePlugin;
|
2007-10-07 05:12:19 +02:00
|
|
|
IServerGameDLL *server = NULL;
|
|
|
|
IServerGameClients *gameclients = NULL;
|
|
|
|
IVEngineServer *engine = NULL;
|
|
|
|
IServerPluginHelpers *helpers = NULL;
|
|
|
|
IGameEventManager2 *gameevents = NULL;
|
|
|
|
IServerPluginCallbacks *vsp_callbacks = NULL;
|
|
|
|
IPlayerInfoManager *playerinfomanager = NULL;
|
2008-02-18 00:40:37 +01:00
|
|
|
ICvar *icvar = NULL;
|
2008-11-24 19:03:02 +01:00
|
|
|
CGlobalVars *gpGlobals = NULL;
|
2007-10-07 05:12:19 +02:00
|
|
|
|
2008-02-17 23:56:20 +01:00
|
|
|
ConVar sample_cvar("sample_cvar", "42", 0);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Something like this is needed to register cvars/CON_COMMANDs.
|
|
|
|
*/
|
|
|
|
class BaseAccessor : public IConCommandBaseAccessor
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
bool RegisterConCommandBase(ConCommandBase *pCommandBase)
|
|
|
|
{
|
|
|
|
/* Always call META_REGCVAR instead of going through the engine. */
|
|
|
|
return META_REGCVAR(pCommandBase);
|
|
|
|
}
|
|
|
|
} s_BaseAccessor;
|
|
|
|
|
2008-11-24 19:03:02 +01:00
|
|
|
PLUGIN_EXPOSE(SamplePlugin, g_SamplePlugin);
|
|
|
|
bool SamplePlugin::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool late)
|
2007-10-07 05:12:19 +02:00
|
|
|
{
|
|
|
|
PLUGIN_SAVEVARS();
|
|
|
|
|
|
|
|
GET_V_IFACE_CURRENT(GetEngineFactory, engine, IVEngineServer, INTERFACEVERSION_VENGINESERVER);
|
|
|
|
GET_V_IFACE_CURRENT(GetEngineFactory, gameevents, IGameEventManager2, INTERFACEVERSION_GAMEEVENTSMANAGER2);
|
|
|
|
GET_V_IFACE_CURRENT(GetEngineFactory, helpers, IServerPluginHelpers, INTERFACEVERSION_ISERVERPLUGINHELPERS);
|
2008-02-18 00:40:37 +01:00
|
|
|
GET_V_IFACE_CURRENT(GetEngineFactory, icvar, ICvar, CVAR_INTERFACE_VERSION);
|
2007-10-07 05:12:19 +02:00
|
|
|
GET_V_IFACE_ANY(GetServerFactory, server, IServerGameDLL, INTERFACEVERSION_SERVERGAMEDLL);
|
|
|
|
GET_V_IFACE_ANY(GetServerFactory, gameclients, IServerGameClients, INTERFACEVERSION_SERVERGAMECLIENTS);
|
|
|
|
GET_V_IFACE_ANY(GetServerFactory, playerinfomanager, IPlayerInfoManager, INTERFACEVERSION_PLAYERINFOMANAGER);
|
|
|
|
|
2008-11-24 19:03:02 +01:00
|
|
|
gpGlobals = ismm->GetCGlobals();
|
|
|
|
|
2007-10-07 05:12:19 +02:00
|
|
|
META_LOG(g_PLAPI, "Starting plugin.");
|
|
|
|
|
2008-02-17 23:56:20 +01:00
|
|
|
/* Load the VSP listener. This is usually needed for IServerPluginHelpers. */
|
|
|
|
#if defined METAMOD_PLAPI_VERSION
|
2007-10-07 05:12:19 +02:00
|
|
|
if ((vsp_callbacks = ismm->GetVSPInfo(NULL)) == NULL)
|
2008-02-17 23:56:20 +01:00
|
|
|
#endif
|
2007-10-07 05:12:19 +02:00
|
|
|
{
|
|
|
|
ismm->AddListener(this, this);
|
|
|
|
ismm->EnableVSPListener();
|
|
|
|
}
|
|
|
|
|
2008-11-24 19:03:02 +01:00
|
|
|
SH_ADD_HOOK_MEMFUNC(IServerGameDLL, LevelInit, server, this, &SamplePlugin::Hook_LevelInit, true);
|
|
|
|
SH_ADD_HOOK_MEMFUNC(IServerGameDLL, ServerActivate, server, this, &SamplePlugin::Hook_ServerActivate, true);
|
|
|
|
SH_ADD_HOOK_MEMFUNC(IServerGameDLL, GameFrame, server, this, &SamplePlugin::Hook_GameFrame, true);
|
|
|
|
SH_ADD_HOOK_MEMFUNC(IServerGameDLL, LevelShutdown, server, this, &SamplePlugin::Hook_LevelShutdown, false);
|
|
|
|
SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientActive, gameclients, this, &SamplePlugin::Hook_ClientActive, true);
|
|
|
|
SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientDisconnect, gameclients, this, &SamplePlugin::Hook_ClientDisconnect, true);
|
|
|
|
SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientPutInServer, gameclients, this, &SamplePlugin::Hook_ClientPutInServer, true);
|
|
|
|
SH_ADD_HOOK_MEMFUNC(IServerGameClients, SetCommandClient, gameclients, this, &SamplePlugin::Hook_SetCommandClient, true);
|
|
|
|
SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientSettingsChanged, gameclients, this, &SamplePlugin::Hook_ClientSettingsChanged, false);
|
|
|
|
SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientConnect, gameclients, this, &SamplePlugin::Hook_ClientConnect, false);
|
|
|
|
SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientCommand, gameclients, this, &SamplePlugin::Hook_ClientCommand, false);
|
|
|
|
|
|
|
|
#if SOURCE_ENGINE == SE_EPISODEONE
|
2008-02-17 23:56:20 +01:00
|
|
|
m_EngineCC = SH_GET_CALLCLASS(engine);
|
|
|
|
#endif
|
2007-10-07 05:12:19 +02:00
|
|
|
|
2008-02-17 23:56:20 +01:00
|
|
|
ENGINE_CALL(&IVEngineServer::LogPrint)("All hooks started!\n");
|
|
|
|
|
2008-11-24 19:03:02 +01:00
|
|
|
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
2008-02-18 00:40:37 +01:00
|
|
|
g_pCVar = icvar;
|
2008-02-17 23:56:20 +01:00
|
|
|
ConVar_Register(0, &s_BaseAccessor);
|
2008-11-24 19:03:02 +01:00
|
|
|
#else
|
2008-02-17 23:56:20 +01:00
|
|
|
ConCommandBaseMgr::OneTimeInit(&s_BaseAccessor);
|
|
|
|
#endif
|
2007-10-07 05:12:19 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2008-11-24 19:03:02 +01:00
|
|
|
bool SamplePlugin::Unload(char *error, size_t maxlen)
|
2007-10-07 05:12:19 +02:00
|
|
|
{
|
2008-11-24 19:03:02 +01:00
|
|
|
SH_REMOVE_HOOK_MEMFUNC(IServerGameDLL, LevelInit, server, this, &SamplePlugin::Hook_LevelInit, true);
|
|
|
|
SH_REMOVE_HOOK_MEMFUNC(IServerGameDLL, ServerActivate, server, this, &SamplePlugin::Hook_ServerActivate, true);
|
|
|
|
SH_REMOVE_HOOK_MEMFUNC(IServerGameDLL, GameFrame, server, this, &SamplePlugin::Hook_GameFrame, true);
|
|
|
|
SH_REMOVE_HOOK_MEMFUNC(IServerGameDLL, LevelShutdown, server, this, &SamplePlugin::Hook_LevelShutdown, false);
|
|
|
|
SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, ClientActive, gameclients, this, &SamplePlugin::Hook_ClientActive, true);
|
|
|
|
SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, ClientDisconnect, gameclients, this, &SamplePlugin::Hook_ClientDisconnect, true);
|
|
|
|
SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, ClientPutInServer, gameclients, this, &SamplePlugin::Hook_ClientPutInServer, true);
|
|
|
|
SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, SetCommandClient, gameclients, this, &SamplePlugin::Hook_SetCommandClient, true);
|
|
|
|
SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, ClientSettingsChanged, gameclients, this, &SamplePlugin::Hook_ClientSettingsChanged, false);
|
|
|
|
SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, ClientConnect, gameclients, this, &SamplePlugin::Hook_ClientConnect, false);
|
|
|
|
SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, ClientCommand, gameclients, this, &SamplePlugin::Hook_ClientCommand, false);
|
|
|
|
|
|
|
|
#if SOURCE_ENGINE == SE_EPISODEONE
|
2008-02-17 23:56:20 +01:00
|
|
|
SH_RELEASE_CALLCLASS(m_EngineCC);
|
|
|
|
#endif
|
2007-10-07 05:12:19 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2008-11-24 19:03:02 +01:00
|
|
|
void SamplePlugin::OnVSPListening(IServerPluginCallbacks *iface)
|
2007-10-07 05:12:19 +02:00
|
|
|
{
|
|
|
|
vsp_callbacks = iface;
|
|
|
|
}
|
|
|
|
|
2008-11-24 19:03:02 +01:00
|
|
|
void SamplePlugin::Hook_ServerActivate(edict_t *pEdictList, int edictCount, int clientMax)
|
2007-10-07 05:12:19 +02:00
|
|
|
{
|
|
|
|
META_LOG(g_PLAPI, "ServerActivate() called: edictCount = %d, clientMax = %d", edictCount, clientMax);
|
|
|
|
}
|
|
|
|
|
2008-11-24 19:03:02 +01:00
|
|
|
void SamplePlugin::AllPluginsLoaded()
|
2007-10-07 05:12:19 +02:00
|
|
|
{
|
|
|
|
/* This is where we'd do stuff that relies on the mod or other plugins
|
|
|
|
* being initialized (for example, cvars added and events registered).
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
|
2008-11-24 19:03:02 +01:00
|
|
|
void SamplePlugin::Hook_ClientActive(edict_t *pEntity, bool bLoadGame)
|
2007-10-07 05:12:19 +02:00
|
|
|
{
|
2008-11-24 19:03:02 +01:00
|
|
|
META_LOG(g_PLAPI, "Hook_ClientActive(%d, %d)", IndexOfEdict(pEntity), bLoadGame);
|
2007-10-07 05:12:19 +02:00
|
|
|
}
|
|
|
|
|
2008-11-24 19:03:02 +01:00
|
|
|
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
|
|
|
void SamplePlugin::Hook_ClientCommand(edict_t *pEntity, const CCommand &args)
|
|
|
|
#else
|
|
|
|
void SamplePlugin::Hook_ClientCommand(edict_t *pEntity)
|
2007-10-07 05:12:19 +02:00
|
|
|
#endif
|
|
|
|
{
|
2008-11-24 19:03:02 +01:00
|
|
|
#if SOURCE_ENGINE == SE_EPISODEONE
|
2007-10-07 05:12:19 +02:00
|
|
|
CCommand args;
|
|
|
|
#endif
|
|
|
|
|
2008-02-18 01:36:10 +01:00
|
|
|
if (!pEntity || pEntity->IsFree())
|
2007-10-07 05:12:19 +02:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *cmd = args.Arg(0);
|
|
|
|
if (strcmp(cmd, "menu") == 0)
|
|
|
|
{
|
|
|
|
KeyValues *kv = new KeyValues("menu");
|
|
|
|
kv->SetString("title", "You've got options, hit ESC");
|
|
|
|
kv->SetInt("level", 1);
|
|
|
|
kv->SetColor("color", Color(255, 0, 0, 255));
|
|
|
|
kv->SetInt("time", 20);
|
|
|
|
kv->SetString("msg", "Pick an option\nOr don't.");
|
|
|
|
|
|
|
|
for (int i = 1; i < 9; i++)
|
|
|
|
{
|
|
|
|
char num[10], msg[10], cmd[10];
|
2008-02-17 23:56:20 +01:00
|
|
|
MM_Format( num, sizeof(num), "%i", i );
|
|
|
|
MM_Format( msg, sizeof(msg), "Option %i", i );
|
|
|
|
MM_Format( cmd, sizeof(cmd), "option %i", i );
|
2007-10-07 05:12:19 +02:00
|
|
|
|
|
|
|
KeyValues *item1 = kv->FindKey(num, true);
|
|
|
|
item1->SetString("msg", msg);
|
|
|
|
item1->SetString("command", cmd);
|
|
|
|
}
|
|
|
|
|
|
|
|
helpers->CreateMessage(pEntity, DIALOG_MENU, kv, vsp_callbacks);
|
|
|
|
kv->deleteThis();
|
|
|
|
RETURN_META(MRES_SUPERCEDE);
|
|
|
|
}
|
|
|
|
else if (strcmp(cmd, "rich") == 0)
|
|
|
|
{
|
|
|
|
KeyValues *kv = new KeyValues("menu");
|
|
|
|
kv->SetString("title", "A rich message");
|
|
|
|
kv->SetInt("level", 1);
|
|
|
|
kv->SetInt("time", 20);
|
|
|
|
kv->SetString("msg", "This is a long long long text string.\n\nIt also has line breaks.");
|
|
|
|
|
|
|
|
helpers->CreateMessage(pEntity, DIALOG_TEXT, kv, vsp_callbacks);
|
|
|
|
kv->deleteThis();
|
|
|
|
RETURN_META(MRES_SUPERCEDE);
|
|
|
|
}
|
|
|
|
else if (strcmp(cmd, "msg") == 0)
|
|
|
|
{
|
|
|
|
KeyValues *kv = new KeyValues("menu");
|
|
|
|
kv->SetString("title", "Just a simple hello");
|
|
|
|
kv->SetInt("level", 1);
|
|
|
|
kv->SetInt("time", 20);
|
|
|
|
|
|
|
|
helpers->CreateMessage(pEntity, DIALOG_MSG, kv, vsp_callbacks);
|
|
|
|
kv->deleteThis();
|
|
|
|
RETURN_META(MRES_SUPERCEDE);
|
|
|
|
}
|
|
|
|
else if (strcmp(cmd, "entry") == 0)
|
|
|
|
{
|
|
|
|
KeyValues *kv = new KeyValues("entry");
|
|
|
|
kv->SetString("title", "Stuff");
|
|
|
|
kv->SetString("msg", "Enter something");
|
|
|
|
kv->SetString("command", "say"); // anything they enter into the dialog turns into a say command
|
|
|
|
kv->SetInt("level", 1);
|
|
|
|
kv->SetInt("time", 20);
|
|
|
|
|
|
|
|
helpers->CreateMessage(pEntity, DIALOG_ENTRY, kv, vsp_callbacks);
|
|
|
|
kv->deleteThis();
|
|
|
|
RETURN_META(MRES_SUPERCEDE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-11-24 19:03:02 +01:00
|
|
|
void SamplePlugin::Hook_ClientSettingsChanged(edict_t *pEdict)
|
2007-10-07 05:12:19 +02:00
|
|
|
{
|
|
|
|
if (playerinfomanager)
|
|
|
|
{
|
|
|
|
IPlayerInfo *playerinfo = playerinfomanager->GetPlayerInfo(pEdict);
|
|
|
|
|
2008-11-24 19:03:02 +01:00
|
|
|
const char *name = engine->GetClientConVarValue(IndexOfEdict(pEdict), "name");
|
2007-10-07 05:12:19 +02:00
|
|
|
|
|
|
|
if (playerinfo != NULL
|
|
|
|
&& name != NULL
|
2008-02-17 23:56:20 +01:00
|
|
|
&& strcmp(engine->GetPlayerNetworkIDString(pEdict), "BOT") != 0
|
2007-10-07 05:12:19 +02:00
|
|
|
&& playerinfo->GetName() != NULL
|
|
|
|
&& strcmp(name, playerinfo->GetName()) == 0)
|
|
|
|
{
|
|
|
|
char msg[128];
|
2008-02-17 23:56:20 +01:00
|
|
|
MM_Format(msg, sizeof(msg), "Your name changed to \"%s\" (from \"%s\")\n", name, playerinfo->GetName());
|
2007-10-07 05:12:19 +02:00
|
|
|
engine->ClientPrintf(pEdict, msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-11-24 19:03:02 +01:00
|
|
|
bool SamplePlugin::Hook_ClientConnect(edict_t *pEntity,
|
2007-10-07 05:12:19 +02:00
|
|
|
const char *pszName,
|
|
|
|
const char *pszAddress,
|
|
|
|
char *reject,
|
|
|
|
int maxrejectlen)
|
|
|
|
{
|
2008-11-24 19:03:02 +01:00
|
|
|
META_LOG(g_PLAPI, "Hook_ClientConnect(%d, \"%s\", \"%s\")", IndexOfEdict(pEntity), pszName, pszAddress);
|
2007-10-07 05:12:19 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2008-11-24 19:03:02 +01:00
|
|
|
void SamplePlugin::Hook_ClientPutInServer(edict_t *pEntity, char const *playername)
|
2007-10-07 05:12:19 +02:00
|
|
|
{
|
|
|
|
KeyValues *kv = new KeyValues( "msg" );
|
|
|
|
kv->SetString( "title", "Hello" );
|
|
|
|
kv->SetString( "msg", "Hello there" );
|
|
|
|
kv->SetColor( "color", Color( 255, 0, 0, 255 ));
|
|
|
|
kv->SetInt( "level", 5);
|
|
|
|
kv->SetInt( "time", 10);
|
|
|
|
helpers->CreateMessage(pEntity, DIALOG_MSG, kv, vsp_callbacks);
|
|
|
|
kv->deleteThis();
|
|
|
|
}
|
|
|
|
|
2008-11-24 19:03:02 +01:00
|
|
|
void SamplePlugin::Hook_ClientDisconnect(edict_t *pEntity)
|
2007-10-07 05:12:19 +02:00
|
|
|
{
|
2008-11-24 19:03:02 +01:00
|
|
|
META_LOG(g_PLAPI, "Hook_ClientDisconnect(%d)", IndexOfEdict(pEntity));
|
2007-10-07 05:12:19 +02:00
|
|
|
}
|
|
|
|
|
2008-11-24 19:03:02 +01:00
|
|
|
void SamplePlugin::Hook_GameFrame(bool simulating)
|
2007-10-07 05:12:19 +02:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* simulating:
|
|
|
|
* ***********
|
|
|
|
* true | game is ticking
|
|
|
|
* false | game is not ticking
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
|
2008-11-24 19:03:02 +01:00
|
|
|
bool SamplePlugin::Hook_LevelInit(const char *pMapName,
|
2007-10-07 05:12:19 +02:00
|
|
|
char const *pMapEntities,
|
|
|
|
char const *pOldLevel,
|
|
|
|
char const *pLandmarkName,
|
|
|
|
bool loadGame,
|
|
|
|
bool background)
|
|
|
|
{
|
|
|
|
META_LOG(g_PLAPI, "Hook_LevelInit(%s)", pMapName);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2008-11-24 19:03:02 +01:00
|
|
|
void SamplePlugin::Hook_LevelShutdown()
|
2007-10-07 05:12:19 +02:00
|
|
|
{
|
|
|
|
META_LOG(g_PLAPI, "Hook_LevelShutdown()");
|
|
|
|
}
|
|
|
|
|
2008-11-24 19:03:02 +01:00
|
|
|
void SamplePlugin::Hook_SetCommandClient(int index)
|
2007-10-07 05:12:19 +02:00
|
|
|
{
|
|
|
|
META_LOG(g_PLAPI, "Hook_SetCommandClient(%d)", index);
|
|
|
|
}
|
|
|
|
|
2008-11-24 19:03:02 +01:00
|
|
|
bool SamplePlugin::Pause(char *error, size_t maxlen)
|
2007-10-07 05:12:19 +02:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2008-11-24 19:03:02 +01:00
|
|
|
bool SamplePlugin::Unpause(char *error, size_t maxlen)
|
2007-10-07 05:12:19 +02:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2008-11-24 19:03:02 +01:00
|
|
|
const char *SamplePlugin::GetLicense()
|
2007-10-07 05:12:19 +02:00
|
|
|
{
|
|
|
|
return "Public Domain";
|
|
|
|
}
|
|
|
|
|
2008-11-24 19:03:02 +01:00
|
|
|
const char *SamplePlugin::GetVersion()
|
2007-10-07 05:12:19 +02:00
|
|
|
{
|
|
|
|
return "1.0.0.0";
|
|
|
|
}
|
|
|
|
|
2008-11-24 19:03:02 +01:00
|
|
|
const char *SamplePlugin::GetDate()
|
2007-10-07 05:12:19 +02:00
|
|
|
{
|
|
|
|
return __DATE__;
|
|
|
|
}
|
|
|
|
|
2008-11-24 19:03:02 +01:00
|
|
|
const char *SamplePlugin::GetLogTag()
|
2007-10-07 05:12:19 +02:00
|
|
|
{
|
|
|
|
return "SAMPLE";
|
|
|
|
}
|
|
|
|
|
2008-11-24 19:03:02 +01:00
|
|
|
const char *SamplePlugin::GetAuthor()
|
2007-10-07 05:12:19 +02:00
|
|
|
{
|
|
|
|
return "AlliedModders LLC";
|
|
|
|
}
|
|
|
|
|
2008-11-24 19:03:02 +01:00
|
|
|
const char *SamplePlugin::GetDescription()
|
2007-10-07 05:12:19 +02:00
|
|
|
{
|
|
|
|
return "Sample basic plugin";
|
|
|
|
}
|
|
|
|
|
2008-11-24 19:03:02 +01:00
|
|
|
const char *SamplePlugin::GetName()
|
2007-10-07 05:12:19 +02:00
|
|
|
{
|
|
|
|
return "Sample Plugin";
|
|
|
|
}
|
|
|
|
|
2008-11-24 19:03:02 +01:00
|
|
|
const char *SamplePlugin::GetURL()
|
2007-10-07 05:12:19 +02:00
|
|
|
{
|
|
|
|
return "http://www.sourcemm.net/";
|
|
|
|
}
|