| 232 | } |
| 233 | |
| 234 | static 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 | |
| 263 | static cell_t ReplyToCommand(IPluginContext *pContext, const cell_t *params) |
| 264 | { |
nothing calls this directly
no test coverage detected