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

Function FakeClientCommand

core/logic/smn_console.cpp:234–261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232}
233
234static cell_t FakeClientCommand(IPluginContext *pContext, const cell_t *params)
235{
236 IGamePlayer *pPlayer = playerhelpers->GetGamePlayer(params[1]);
237
238 if (!pPlayer)
239 {
240 return pContext->ThrowNativeError("Client index %d is invalid", params[1]);
241 }
242
243 if (!pPlayer->IsConnected())
244 {
245 return pContext->ThrowNativeError("Client %d is not connected", params[1]);
246 }
247
248 g_pSM->SetGlobalTarget(params[1]);
249
250 char buffer[256];
251 {
252 DetectExceptions eh(pContext);
253 g_pSM->FormatString(buffer, sizeof(buffer), pContext, params, 2);
254 if (eh.HasException())
255 return 0;
256 }
257
258 engine->FakeClientCommand(pPlayer->GetEdict(), buffer);
259
260 return 1;
261}
262
263static cell_t ReplyToCommand(IPluginContext *pContext, const cell_t *params)
264{

Callers

nothing calls this directly

Calls 6

GetGamePlayerMethod · 0.80
IsConnectedMethod · 0.80
FakeClientCommandMethod · 0.80
GetEdictMethod · 0.80
SetGlobalTargetMethod · 0.45
FormatStringMethod · 0.45

Tested by

no test coverage detected