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

Function SetFakeClientConVar

core/smn_halflife.cpp:147–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145}
146
147static 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
176static cell_t GetGameDescription(IPluginContext *pContext, const cell_t *params)
177{

Callers

nothing calls this directly

Calls 4

GetPlayerByIndexMethod · 0.80
IsConnectedMethod · 0.80
IsFakeClientMethod · 0.80
GetEdictMethod · 0.80

Tested by

no test coverage detected