| 145 | } |
| 146 | |
| 147 | static cell_t SetFakeClientConVar(IPluginContext *pContext, const cell_t *params) |
| 148 | { |
| 149 | CPlayer *pPlayer = g_Players.GetPlayerByIndex(params[1]); |
| 150 | |
| 151 | if (!pPlayer) |
| 152 | { |
| 153 | return pContext->ThrowNativeError("Client index %d is invalid", params[1]); |
| 154 | } |
| 155 | |
| 156 | if (!pPlayer->IsConnected()) |
| 157 | { |
| 158 | return pContext->ThrowNativeError("Client %d is not connected", params[1]); |
| 159 | } |
| 160 | |
| 161 | if (!pPlayer->IsFakeClient()) |
| 162 | { |
| 163 | return pContext->ThrowNativeError("Client %d is not a fake client", params[1]); |
| 164 | } |
| 165 | |
| 166 | char *cvar, *value; |
| 167 | |
| 168 | pContext->LocalToString(params[2], &cvar); |
| 169 | pContext->LocalToString(params[3], &value); |
| 170 | |
| 171 | engine->SetFakeClientConVarValue(pPlayer->GetEdict(), cvar, value); |
| 172 | |
| 173 | return 1; |
| 174 | } |
| 175 | |
| 176 | static cell_t GetGameDescription(IPluginContext *pContext, const cell_t *params) |
| 177 | { |
nothing calls this directly
no test coverage detected