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

Function FakeClientCommandEx

core/smn_console.cpp:1004–1031  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1002}
1003
1004static cell_t FakeClientCommandEx(IPluginContext *pContext, const cell_t *params)
1005{
1006 CPlayer *pPlayer = g_Players.GetPlayerByIndex(params[1]);
1007
1008 if (!pPlayer)
1009 {
1010 return pContext->ThrowNativeError("Client index %d is invalid", params[1]);
1011 }
1012
1013 if (!pPlayer->IsConnected())
1014 {
1015 return pContext->ThrowNativeError("Client %d is not connected", params[1]);
1016 }
1017
1018 g_SourceMod.SetGlobalTarget(params[1]);
1019
1020 char buffer[256];
1021 {
1022 DetectExceptions eh(pContext);
1023 g_SourceMod.FormatString(buffer, sizeof(buffer), pContext, params, 2);
1024 if (eh.HasException())
1025 return 0;
1026 }
1027
1028 g_HL2.AddToFakeCliCmdQueue(params[1], engine->GetPlayerUserId(pPlayer->GetEdict()), buffer);
1029
1030 return 1;
1031}
1032
1033static cell_t GetCommandIterator(IPluginContext *pContext, const cell_t *params)
1034{

Callers

nothing calls this directly

Calls 6

GetPlayerByIndexMethod · 0.80
IsConnectedMethod · 0.80
AddToFakeCliCmdQueueMethod · 0.80
GetEdictMethod · 0.80
SetGlobalTargetMethod · 0.45
FormatStringMethod · 0.45

Tested by

no test coverage detected