MCPcopy Create free account
hub / github.com/alliedmodders/sourcemod / OnClientCommand

Method OnClientCommand

core/PlayerManager.cpp:1083–1196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1081{
1082#else
1083void PlayerManager::OnClientCommand(edict_t *pEntity)
1084{
1085 CCommand args;
1086#endif
1087
1088 cell_t res = Pl_Continue;
1089 int client = IndexOfEdict(pEntity);
1090 CPlayer *pPlayer = &m_Players[client];
1091
1092 if (!pPlayer->IsConnected())
1093 {
1094 return;
1095 }
1096
1097 if (strcmp(args.Arg(0), "sm") == 0)
1098 {
1099 if (args.ArgC() > 1 && strcmp(args.Arg(1), "plugins") == 0)
1100 {
1101 ListPluginsToClient(pPlayer, args);
1102 RETURN_META(MRES_SUPERCEDE);
1103 }
1104 else if (args.ArgC() > 1 && strcmp(args.Arg(1), "exts") == 0)
1105 {
1106 ListExtensionsToClient(pPlayer, args);
1107 RETURN_META(MRES_SUPERCEDE);
1108 }
1109 else if (args.ArgC() > 1 && strcmp(args.Arg(1), "credits") == 0)
1110 {
1111 ClientConsolePrint(pEntity,
1112 "SourceMod would not be possible without:");
1113 ClientConsolePrint(pEntity,
1114 " David \"BAILOPAN\" Anderson, Matt \"pRED\" Woodrow");
1115 ClientConsolePrint(pEntity,
1116 " Scott \"DS\" Ehlert, Fyren");
1117 ClientConsolePrint(pEntity,
1118 " Nicholas \"psychonic\" Hastings, Asher \"asherkin\" Baker");
1119 ClientConsolePrint(pEntity,
1120 " Ruben \"Dr!fter\" Gonzalez, Josh \"KyleS\" Allard");
1121 ClientConsolePrint(pEntity,
1122 " Michael \"Headline\" Flaherty, Jannik \"Peace-Maker\" Hartung");
1123 ClientConsolePrint(pEntity,
1124 " Borja \"faluco\" Ferrer, Pavol \"PM OnoTo\" Marko");
1125 ClientConsolePrint(pEntity,
1126 "SourceMod is open source under the GNU General Public License.");
1127 RETURN_META(MRES_SUPERCEDE);
1128 }
1129
1130 ClientConsolePrint(pEntity,
1131 "SourceMod %s, by AlliedModders LLC", SOURCEMOD_VERSION);
1132 ClientConsolePrint(pEntity,
1133 "To see running plugins, type \"sm plugins\"");
1134 ClientConsolePrint(pEntity,
1135 "To see credits, type \"sm credits\"");
1136 ClientConsolePrint(pEntity,
1137 "Visit https://www.sourcemod.net/");
1138 RETURN_META(MRES_SUPERCEDE);
1139 }
1140

Callers

nothing calls this directly

Calls 14

IndexOfEdictFunction · 0.85
ListPluginsToClientFunction · 0.85
ListExtensionsToClientFunction · 0.85
ClientConsolePrintFunction · 0.85
IsConnectedMethod · 0.80
CurrentCommandNameMethod · 0.80
IsInGameMethod · 0.80
PushCellMethod · 0.80
DispatchClientCommandMethod · 0.80
ArgMethod · 0.45
ArgCMethod · 0.45
IsEnabledMethod · 0.45

Tested by

no test coverage detected