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

Method CheckSetAdmin

core/PlayerManager.cpp:358–379  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

356}
357
358bool PlayerManager::CheckSetAdmin(int index, CPlayer *pPlayer, AdminId id)
359{
360 const char *password = adminsys->GetAdminPassword(id);
361 if (password != NULL)
362 {
363 if (m_PassInfoVar.size() < 1)
364 {
365 return false;
366 }
367
368 /* Whoa... the user needs a password! */
369 const char *given = engine->GetClientConVarValue(index, m_PassInfoVar.c_str());
370 if (!given || strcmp(given, password) != 0)
371 {
372 return false;
373 }
374 }
375
376 pPlayer->SetAdminId(id, false);
377
378 return true;
379}
380
381bool PlayerManager::CheckSetAdminName(int index, CPlayer *pPlayer, AdminId id)
382{

Callers 1

DoBasicAdminChecksMethod · 0.80

Calls 5

GetAdminPasswordMethod · 0.80
GetClientConVarValueMethod · 0.80
SetAdminIdMethod · 0.80
sizeMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected