Skip to content

Commit

Permalink
Add !rcon/c_rcon
Browse files Browse the repository at this point in the history
  • Loading branch information
Vauff authored and xen-000 committed Oct 21, 2023
1 parent 1986ab8 commit 396e6a9
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/adminsystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,30 @@ CON_COMMAND_CHAT(hsay, "say something as a hud hint")
ClientPrintAll(HUD_PRINTCENTER, "%s", args.ArgS());
}

CON_COMMAND_CHAT(rcon, "send a command to server console")
{
if (!player)
return;

int iCommandPlayer = player->GetPlayerSlot();

ZEPlayer* pPlayer = g_playerManager->GetPlayer(iCommandPlayer);

if (!pPlayer->IsAdminFlagSet(ADMFLAG_RCON))
{
ClientPrint(player, HUD_PRINTTALK, CHAT_PREFIX "You don't have access to this command.");
return;
}

if (args.ArgC() < 2)
{
ClientPrint(player, HUD_PRINTTALK, CHAT_PREFIX "Usage: !rcon <command>");
return;
}

g_pEngineServer2->ServerCommand(args.ArgS());
}

bool CAdminSystem::LoadAdmins()
{
m_vecAdmins.Purge();
Expand Down

0 comments on commit 396e6a9

Please sign in to comment.