| 1002 | } |
| 1003 | |
| 1004 | static 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 | |
| 1033 | static cell_t GetCommandIterator(IPluginContext *pContext, const cell_t *params) |
| 1034 | { |
nothing calls this directly
no test coverage detected