Added check to make sure player are alive to perform sm_slap, sm_burn, sm_slay.
3 * ================================================================
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 * version 3.0, as published by the Free Software Foundation.
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, see <http://www.gnu.org/licenses/>.
20 * As a special exception, AlliedModders LLC gives you permission to
21 * link the code of this program (as well as its derivative works) to
22 * "Half-Life 2," the "Source Engine," the "SourcePawn JIT," and any
23 * Game MODs that run on software by the Valve Corporation. You must
24 * obey the GNU General Public License in all respects for all other
25 * code used. Additionally, AlliedModders LLC grants this exception
26 * to all derivative works. AlliedModders LLC defines further
27 * exceptions, found in LICENSE.txt (as of this writing, version
28 * JULY-31-2007), or <http://www.sourcemod.net/license.php>.
33 #include "sm_globals.h"
34 #include "HalfLife2.h"
35 #include "sourcemm_api.h"
36 #include "HandleSys.h"
37 #include "ConVarManager.h"
38 #include "ConCmdManager.h"
39 #include "PluginSys.h"
40 #include "sm_stringutil.h"
41 #include "PlayerManager.h"
42 #include "ChatTriggers.h"
43 #include <inetchannel.h>
46 #define NET_SETCONVAR 5
50 ConVarBound_Upper = 0,
54 HandleType_t hCmdIterType = 0;
59 List<ConCmdInfo *>::iterator iter;
62 class ConsoleHelpers :
64 public IHandleTypeDispatch
67 virtual void OnSourceModAllInitialized()
70 g_HandleSys.InitAccessDefaults(NULL, &access);
71 access.access[HandleAccess_Clone] = HANDLE_RESTRICT_OWNER | HANDLE_RESTRICT_IDENTITY;
73 hCmdIterType = g_HandleSys.CreateType(NULL, this, 0, NULL, &access, g_pCoreIdent, NULL);
75 virtual void OnHandleDestroy(HandleType_t type, void *object)
77 GlobCmdIter *iter = (GlobCmdIter *)object;
82 static void ReplicateConVar(ConVar *pConVar)
84 int maxClients = g_Players.GetMaxClients();
87 bf_write buffer(data, sizeof(data));
89 buffer.WriteUBitLong(NET_SETCONVAR, 5);
91 buffer.WriteString(pConVar->GetName());
92 buffer.WriteString(pConVar->GetString());
94 for (int i = 1; i <= maxClients; i++)
96 CPlayer *pPlayer = g_Players.GetPlayerByIndex(i);
98 if (pPlayer && pPlayer->IsInGame() && !pPlayer->IsFakeClient())
100 INetChannel *netchan = static_cast<INetChannel *>(engine->GetPlayerNetInfo(i));
101 netchan->SendData(buffer);
106 static void NotifyConVar(ConVar *pConVar)
108 IGameEvent *pEvent = gameevents->CreateEvent("server_cvar");
109 pEvent->SetString("cvarname", pConVar->GetName());
110 if (pConVar->IsBitSet(FCVAR_PROTECTED))
112 pEvent->SetString("cvarvalue", "***PROTECTED***");
114 pEvent->SetString("cvarvalue", pConVar->GetString());
117 gameevents->FireEvent(pEvent);
120 static cell_t sm_CreateConVar(IPluginContext *pContext, const cell_t *params)
122 char *name, *defaultVal, *helpText;
124 pContext->LocalToString(params[1], &name);
126 // While the engine seems to accept a blank convar name, it causes a crash upon server quit
127 if (name == NULL || strcmp(name, "") == 0)
129 return pContext->ThrowNativeError("Convar with blank name is not permitted");
132 pContext->LocalToString(params[2], &defaultVal);
133 pContext->LocalToString(params[3], &helpText);
135 bool hasMin = params[5] ? true : false;
136 bool hasMax = params[7] ? true : false;
137 float min = sp_ctof(params[6]);
138 float max = sp_ctof(params[8]);
140 Handle_t hndl = g_ConVarManager.CreateConVar(pContext, name, defaultVal, helpText, params[4], hasMin, min, hasMax, max);
142 if (hndl == BAD_HANDLE)
144 return pContext->ThrowNativeError("Convar \"%s\" was not created. A console command with the same name already exists.", name);
150 static cell_t sm_FindConVar(IPluginContext *pContext, const cell_t *params)
154 pContext->LocalToString(params[1], &name);
156 return g_ConVarManager.FindConVar(name);
159 static cell_t sm_HookConVarChange(IPluginContext *pContext, const cell_t *params)
161 Handle_t hndl = static_cast<Handle_t>(params[1]);
165 if ((err=g_HandleSys.ReadHandle(hndl, g_ConVarManager.GetHandleType(), NULL, (void **)&pConVar))
168 return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err);
171 IPluginFunction *pFunction = pContext->GetFunctionById(params[2]);
175 return pContext->ThrowNativeError("Invalid function id (%X)", params[2]);
178 g_ConVarManager.HookConVarChange(pConVar, pFunction);
183 static cell_t sm_UnhookConVarChange(IPluginContext *pContext, const cell_t *params)
185 Handle_t hndl = static_cast<Handle_t>(params[1]);
189 if ((err=g_HandleSys.ReadHandle(hndl, g_ConVarManager.GetHandleType(), NULL, (void **)&pConVar))
192 return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err);
195 IPluginFunction *pFunction = pContext->GetFunctionById(params[2]);
199 return pContext->ThrowNativeError("Invalid function id (%X)", params[2]);
202 g_ConVarManager.UnhookConVarChange(pConVar, pFunction);
207 static cell_t sm_GetConVarBool(IPluginContext *pContext, const cell_t *params)
209 Handle_t hndl = static_cast<Handle_t>(params[1]);
213 if ((err=g_HandleSys.ReadHandle(hndl, g_ConVarManager.GetHandleType(), NULL, (void **)&pConVar))
216 return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err);
219 return pConVar->GetBool();
222 static cell_t sm_GetConVarInt(IPluginContext *pContext, const cell_t *params)
224 Handle_t hndl = static_cast<Handle_t>(params[1]);
228 if ((err=g_HandleSys.ReadHandle(hndl, g_ConVarManager.GetHandleType(), NULL, (void **)&pConVar))
231 return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err);
234 return pConVar->GetInt();
237 /* This handles both SetConVarBool() and SetConVarInt() */
238 static cell_t sm_SetConVarNum(IPluginContext *pContext, const cell_t *params)
240 Handle_t hndl = static_cast<Handle_t>(params[1]);
244 if ((err=g_HandleSys.ReadHandle(hndl, g_ConVarManager.GetHandleType(), NULL, (void **)&pConVar))
247 return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err);
250 pConVar->SetValue(params[2]);
252 /* Should we replicate it? */
253 if (params[3] && pConVar->IsBitSet(FCVAR_REPLICATED))
255 ReplicateConVar(pConVar);
258 /* Should we notify clients? */
259 if (params[4] && pConVar->IsBitSet(FCVAR_NOTIFY))
261 NotifyConVar(pConVar);
267 static cell_t sm_GetConVarFloat(IPluginContext *pContext, const cell_t *params)
269 Handle_t hndl = static_cast<Handle_t>(params[1]);
273 if ((err=g_HandleSys.ReadHandle(hndl, g_ConVarManager.GetHandleType(), NULL, (void **)&pConVar))
276 return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err);
279 float value = pConVar->GetFloat();
281 return sp_ftoc(value);
284 static cell_t sm_SetConVarFloat(IPluginContext *pContext, const cell_t *params)
286 Handle_t hndl = static_cast<Handle_t>(params[1]);
290 if ((err=g_HandleSys.ReadHandle(hndl, g_ConVarManager.GetHandleType(), NULL, (void **)&pConVar))
293 return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err);
296 float value = sp_ctof(params[2]);
297 pConVar->SetValue(value);
299 /* Should we replicate it? */
300 if (params[3] && pConVar->IsBitSet(FCVAR_REPLICATED))
302 ReplicateConVar(pConVar);
305 /* Should we notify clients? */
306 if (params[4] && pConVar->IsBitSet(FCVAR_NOTIFY))
308 NotifyConVar(pConVar);
314 static cell_t sm_GetConVarString(IPluginContext *pContext, const cell_t *params)
316 Handle_t hndl = static_cast<Handle_t>(params[1]);
320 if ((err=g_HandleSys.ReadHandle(hndl, g_ConVarManager.GetHandleType(), NULL, (void **)&pConVar))
323 return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err);
326 pContext->StringToLocalUTF8(params[2], params[3], pConVar->GetString(), NULL);
331 static cell_t sm_SetConVarString(IPluginContext *pContext, const cell_t *params)
333 Handle_t hndl = static_cast<Handle_t>(params[1]);
337 if ((err=g_HandleSys.ReadHandle(hndl, g_ConVarManager.GetHandleType(), NULL, (void **)&pConVar))
340 return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err);
344 pContext->LocalToString(params[2], &value);
346 pConVar->SetValue(value);
348 /* Should we replicate it? */
349 if (params[3] && pConVar->IsBitSet(FCVAR_REPLICATED))
351 ReplicateConVar(pConVar);
354 /* Should we notify clients? */
355 if (params[4] && pConVar->IsBitSet(FCVAR_NOTIFY))
357 NotifyConVar(pConVar);
363 static cell_t sm_GetConVarFlags(IPluginContext *pContext, const cell_t *params)
365 Handle_t hndl = static_cast<Handle_t>(params[1]);
369 if ((err=g_HandleSys.ReadHandle(hndl, g_ConVarManager.GetHandleType(), NULL, (void **)&pConVar))
372 return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err);
375 return pConVar->GetFlags();
378 static cell_t sm_SetConVarFlags(IPluginContext *pContext, const cell_t *params)
380 Handle_t hndl = static_cast<Handle_t>(params[1]);
384 if ((err=g_HandleSys.ReadHandle(hndl, g_ConVarManager.GetHandleType(), NULL, (void **)&pConVar))
387 return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err);
390 pConVar->SetFlags(params[2]);
395 static cell_t sm_GetConVarBounds(IPluginContext *pContext, const cell_t *params)
397 Handle_t hndl = static_cast<Handle_t>(params[1]);
401 if ((err=g_HandleSys.ReadHandle(hndl, g_ConVarManager.GetHandleType(), NULL, (void **)&pConVar))
404 return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err);
413 case ConVarBound_Upper:
414 hasBound = pConVar->GetMax(bound);
416 case ConVarBound_Lower:
417 hasBound = pConVar->GetMin(bound);
420 return pContext->ThrowNativeError("Invalid ConVarBounds value %d");
423 pContext->LocalToPhysAddr(params[3], &addr);
424 *addr = sp_ftoc(bound);
429 static cell_t sm_SetConVarBounds(IPluginContext *pContext, const cell_t *params)
431 Handle_t hndl = static_cast<Handle_t>(params[1]);
435 if ((err=g_HandleSys.ReadHandle(hndl, g_ConVarManager.GetHandleType(), NULL, (void **)&pConVar))
438 return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err);
443 case ConVarBound_Upper:
444 pConVar->SetMax(params[3] ? true : false, sp_ctof(params[4]));
446 case ConVarBound_Lower:
447 pConVar->SetMin(params[3] ? true : false, sp_ctof(params[4]));
450 return pContext->ThrowNativeError("Invalid ConVarBounds value %d");
456 static cell_t sm_GetConVarName(IPluginContext *pContext, const cell_t *params)
458 Handle_t hndl = static_cast<Handle_t>(params[1]);
462 if ((err=g_HandleSys.ReadHandle(hndl, g_ConVarManager.GetHandleType(), NULL, (void **)&pConVar))
465 return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err);
468 pContext->StringToLocalUTF8(params[2], params[3], pConVar->GetName(), NULL);
473 static cell_t sm_ResetConVar(IPluginContext *pContext, const cell_t *params)
475 Handle_t hndl = static_cast<Handle_t>(params[1]);
479 if ((err=g_HandleSys.ReadHandle(hndl, g_ConVarManager.GetHandleType(), NULL, (void **)&pConVar))
482 return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err);
490 static bool s_QueryAlreadyWarned = false;
492 static cell_t sm_QueryClientConVar(IPluginContext *pContext, const cell_t *params)
496 IPluginFunction *pCallback;
498 if (g_IsOriginalEngine)
500 if (!s_QueryAlreadyWarned)
502 s_QueryAlreadyWarned = true;
503 return pContext->ThrowNativeError("Game does not support client convar querying (one time warning)");
509 pPlayer = g_Players.GetPlayerByIndex(params[1]);
513 return pContext->ThrowNativeError("Client index %d is invalid", params[1]);
516 if (!pPlayer->IsConnected())
518 return pContext->ThrowNativeError("Client %d is not connected", params[1]);
521 /* Trying a query on a bot results in callback not be fired, so don't bother */
522 if (pPlayer->IsFakeClient())
527 pContext->LocalToString(params[2], &name);
528 pCallback = pContext->GetFunctionById(params[3]);
532 return pContext->ThrowNativeError("Invalid function id (%X)", params[3]);
535 return g_ConVarManager.QueryClientConVar(pPlayer->GetEdict(), name, pCallback, params[4]);
538 static cell_t sm_RegServerCmd(IPluginContext *pContext, const cell_t *params)
541 IPluginFunction *pFunction;
543 pContext->LocalToString(params[1], &name);
544 pContext->LocalToString(params[3], &help);
545 pFunction = pContext->GetFunctionById(params[2]);
549 return pContext->ThrowNativeError("Invalid function id (%X)", params[2]);
552 if (!g_ConCmds.AddServerCommand(pFunction, name, help, params[4]))
554 return pContext->ThrowNativeError("Command \"%s\" could not be created. A convar with the same name already exists.", name);
560 static cell_t sm_RegConsoleCmd(IPluginContext *pContext, const cell_t *params)
563 IPluginFunction *pFunction;
565 pContext->LocalToString(params[1], &name);
566 pContext->LocalToString(params[3], &help);
567 pFunction = pContext->GetFunctionById(params[2]);
571 return pContext->ThrowNativeError("Invalid function id (%X)", params[2]);
574 if (!g_ConCmds.AddConsoleCommand(pFunction, name, help, params[4]))
576 return pContext->ThrowNativeError("Command \"%s\" could not be created. A convar with the same name already exists.", name);
582 static cell_t sm_RegAdminCmd(IPluginContext *pContext, const cell_t *params)
586 IPluginFunction *pFunction;
587 FlagBits flags = params[3];
588 int cmdflags = params[6];
590 pContext->LocalToString(params[1], &name);
591 pContext->LocalToString(params[4], &help);
592 pContext->LocalToString(params[5], (char **)&group);
593 pFunction = pContext->GetFunctionById(params[2]);
595 if (group[0] == '\0')
597 CPlugin *pPlugin = g_PluginSys.GetPluginByCtx(pContext->GetContext());
598 group = pPlugin->GetFilename();
603 return pContext->ThrowNativeError("Invalid function id (%X)", params[2]);
606 if (!g_ConCmds.AddAdminCommand(pFunction, name, group, flags, help, cmdflags))
608 return pContext->ThrowNativeError("Command \"%s\" could not be created. A convar with the same name already exists.", name);
614 static cell_t sm_GetCmdArgs(IPluginContext *pContext, const cell_t *params)
616 return engine->Cmd_Argc() - 1;
619 static cell_t sm_GetCmdArg(IPluginContext *pContext, const cell_t *params)
621 const char *arg = engine->Cmd_Argv(params[1]);
623 pContext->StringToLocalUTF8(params[2], params[3], arg, NULL);
628 static cell_t sm_GetCmdArgString(IPluginContext *pContext, const cell_t *params)
630 const char *args = engine->Cmd_Args();
637 pContext->StringToLocalUTF8(params[1], params[2], args, NULL);
642 static cell_t sm_PrintToServer(IPluginContext *pCtx, const cell_t *params)
648 pCtx->LocalToString(params[1], &fmt);
649 size_t res = atcprintf(buffer, sizeof(buffer)-2, fmt, pCtx, params, &arg);
651 buffer[res++] = '\n';
654 META_CONPRINT(buffer);
659 static cell_t sm_PrintToConsole(IPluginContext *pCtx, const cell_t *params)
661 int index = params[1];
662 if ((index < 0) || (index > g_Players.GetMaxClients()))
664 return pCtx->ThrowNativeError("Client index %d is invalid", index);
667 CPlayer *pPlayer = NULL;
670 pPlayer = g_Players.GetPlayerByIndex(index);
671 if (!pPlayer->IsInGame())
673 return pCtx->ThrowNativeError("Client %d is not in game", index);
676 /* Silent fail on bots, engine will crash */
677 if (pPlayer->IsFakeClient())
687 pCtx->LocalToString(params[2], &fmt);
688 size_t res = atcprintf(buffer, sizeof(buffer)-2, fmt, pCtx, params, &arg);
690 buffer[res++] = '\n';
695 engine->ClientPrintf(pPlayer->GetEdict(), buffer);
697 META_CONPRINT(buffer);
703 static cell_t sm_ServerCommand(IPluginContext *pContext, const cell_t *params)
706 size_t len = g_SourceMod.FormatString(buffer, sizeof(buffer)-2, pContext, params, 1);
708 g_SourceMod.SetGlobalTarget(LANG_SERVER);
710 /* One byte for null terminator, one for newline */
711 buffer[len++] = '\n';
714 engine->ServerCommand(buffer);
719 static cell_t sm_InsertServerCommand(IPluginContext *pContext, const cell_t *params)
722 size_t len = g_SourceMod.FormatString(buffer, sizeof(buffer)-2, pContext, params, 1);
724 g_SourceMod.SetGlobalTarget(LANG_SERVER);
726 /* One byte for null terminator, one for newline */
727 buffer[len++] = '\n';
730 engine->InsertServerCommand(buffer);
735 static cell_t sm_ServerExecute(IPluginContext *pContext, const cell_t *params)
737 engine->ServerExecute();
742 static cell_t sm_ClientCommand(IPluginContext *pContext, const cell_t *params)
744 CPlayer *pPlayer = g_Players.GetPlayerByIndex(params[1]);
748 return pContext->ThrowNativeError("Client index %d is invalid", params[1]);
751 if (!pPlayer->IsConnected())
753 return pContext->ThrowNativeError("Client %d is not connected", params[1]);
756 g_SourceMod.SetGlobalTarget(params[1]);
759 g_SourceMod.FormatString(buffer, sizeof(buffer), pContext, params, 2);
761 engine->ClientCommand(pPlayer->GetEdict(), "%s", buffer);
767 static cell_t FakeClientCommand(IPluginContext *pContext, const cell_t *params)
769 CPlayer *pPlayer = g_Players.GetPlayerByIndex(params[1]);
773 return pContext->ThrowNativeError("Client index %d is invalid", params[1]);
776 if (!pPlayer->IsConnected())
778 return pContext->ThrowNativeError("Client %d is not connected", params[1]);
782 g_SourceMod.FormatString(buffer, sizeof(buffer), pContext, params, 2);
784 unsigned int old = g_ChatTriggers.SetReplyTo(SM_REPLY_CONSOLE);
785 serverpluginhelpers->ClientCommand(pPlayer->GetEdict(), buffer);
786 g_ChatTriggers.SetReplyTo(old);
791 static cell_t ReplyToCommand(IPluginContext *pContext, const cell_t *params)
793 g_SourceMod.SetGlobalTarget(params[1]);
795 /* Build the format string */
797 size_t len = g_SourceMod.FormatString(buffer, sizeof(buffer)-2, pContext, params, 2);
799 /* If we're printing to the server, shortcut out */
803 buffer[len++] = '\n';
805 META_CONPRINT(buffer);
809 CPlayer *pPlayer = g_Players.GetPlayerByIndex(params[1]);
813 return pContext->ThrowNativeError("Client index %d is invalid", params[1]);
816 if (!pPlayer->IsConnected())
818 return pContext->ThrowNativeError("Client %d is not connected", params[1]);
821 g_SourceMod.SetGlobalTarget(params[1]);
823 unsigned int replyto = g_ChatTriggers.GetReplyTo();
824 if (replyto == SM_REPLY_CONSOLE)
826 buffer[len++] = '\n';
828 engine->ClientPrintf(pPlayer->GetEdict(), buffer);
829 } else if (replyto == SM_REPLY_CHAT) {
835 g_HL2.TextMsg(params[1], HUD_PRINTTALK, buffer);
841 static cell_t GetCmdReplyTarget(IPluginContext *pContext, const cell_t *params)
843 return g_ChatTriggers.GetReplyTo();
846 static cell_t SetCmdReplyTarget(IPluginContext *pContext, const cell_t *params)
848 return g_ChatTriggers.SetReplyTo(params[1]);
851 static cell_t GetCommandIterator(IPluginContext *pContext, const cell_t *params)
853 GlobCmdIter *iter = new GlobCmdIter;
854 iter->started = false;
856 Handle_t hndl = g_HandleSys.CreateHandle(hCmdIterType, iter, pContext->GetIdentity(), g_pCoreIdent, NULL);
857 if (hndl == BAD_HANDLE)
865 static cell_t ReadCommandIterator(IPluginContext *pContext, const cell_t *params)
869 HandleSecurity sec(pContext->GetIdentity(), g_pCoreIdent);
871 if ((err = g_HandleSys.ReadHandle(params[1], hCmdIterType, &sec, (void **)&iter))
874 return pContext->ThrowNativeError("Invalid GlobCmdIter Handle %x", params[1]);
877 const List<ConCmdInfo *> &cmds = g_ConCmds.GetCommandList();
881 iter->iter = cmds.begin();
882 iter->started = true;
885 while (iter->iter != cmds.end()
886 && !(*(iter->iter))->sourceMod)
891 if (iter->iter == cmds.end())
896 ConCmdInfo *pInfo = (*(iter->iter));
898 pContext->StringToLocalUTF8(params[2], params[3], pInfo->pCmd->GetName(), NULL);
899 pContext->StringToLocalUTF8(params[5], params[6], pInfo->pCmd->GetHelpText(), NULL);
902 pContext->LocalToPhysAddr(params[4], &addr);
903 *addr = pInfo->admin.eflags;
910 static cell_t CheckCommandAccess(IPluginContext *pContext, const cell_t *params)
918 pContext->LocalToString(params[2], &cmd);
920 return g_ConCmds.CheckCommandAccess(params[1], cmd, params[3]) ? 1 : 0;
923 REGISTER_NATIVES(consoleNatives)
925 {"CreateConVar", sm_CreateConVar},
926 {"FindConVar", sm_FindConVar},
927 {"HookConVarChange", sm_HookConVarChange},
928 {"UnhookConVarChange", sm_UnhookConVarChange},
929 {"GetConVarBool", sm_GetConVarBool},
930 {"SetConVarBool", sm_SetConVarNum},
931 {"GetConVarInt", sm_GetConVarInt},
932 {"SetConVarInt", sm_SetConVarNum},
933 {"GetConVarFloat", sm_GetConVarFloat},
934 {"SetConVarFloat", sm_SetConVarFloat},
935 {"GetConVarString", sm_GetConVarString},
936 {"SetConVarString", sm_SetConVarString},
937 {"GetConVarFlags", sm_GetConVarFlags},
938 {"SetConVarFlags", sm_SetConVarFlags},
939 {"GetConVarName", sm_GetConVarName},
940 {"GetConVarBounds", sm_GetConVarBounds},
941 {"SetConVarBounds", sm_SetConVarBounds},
942 {"ResetConVar", sm_ResetConVar},
943 {"QueryClientConVar", sm_QueryClientConVar},
944 {"RegServerCmd", sm_RegServerCmd},
945 {"RegConsoleCmd", sm_RegConsoleCmd},
946 {"GetCmdArgString", sm_GetCmdArgString},
947 {"GetCmdArgs", sm_GetCmdArgs},
948 {"GetCmdArg", sm_GetCmdArg},
949 {"PrintToServer", sm_PrintToServer},
950 {"PrintToConsole", sm_PrintToConsole},
951 {"RegAdminCmd", sm_RegAdminCmd},
952 {"ServerCommand", sm_ServerCommand},
953 {"InsertServerCommand", sm_InsertServerCommand},
954 {"ServerExecute", sm_ServerExecute},
955 {"ClientCommand", sm_ClientCommand},
956 {"FakeClientCommand", FakeClientCommand},
957 {"ReplyToCommand", ReplyToCommand},
958 {"GetCmdReplySource", GetCmdReplyTarget},
959 {"SetCmdReplySource", SetCmdReplyTarget},
960 {"GetCommandIterator", GetCommandIterator},
961 {"ReadCommandIterator", ReadCommandIterator},
962 {"CheckCommandAccess", CheckCommandAccess},