mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-28 07:02:38 +00:00
Allow passing player names to moderation commands
This commit is contained in:
parent
62af0a8231
commit
616e90e876
1 changed files with 25 additions and 19 deletions
|
@ -2510,11 +2510,11 @@ static void MutePlayer(boolean mute)
|
||||||
|
|
||||||
if (COM_Argc() < 2)
|
if (COM_Argc() < 2)
|
||||||
{
|
{
|
||||||
CONS_Printf(M_GetText("muteplayer <playernum>: mute a player\n"));
|
CONS_Printf(M_GetText("muteplayer <playername/playernum>: mute a player\n"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
data[0] = atoi(COM_Argv(1));
|
data[0] = nametonum(COM_Argv(1));
|
||||||
if (data[0] >= MAXPLAYERS || !playeringame[data[0]])
|
if (data[0] >= MAXPLAYERS || !playeringame[data[0]])
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_NOTICE, M_GetText("There is no player %u!\n"), (unsigned int)data[0]);
|
CONS_Alert(CONS_NOTICE, M_GetText("There is no player %u!\n"), (unsigned int)data[0]);
|
||||||
|
@ -2603,11 +2603,11 @@ static void Command_ServerTeamChange_f(void)
|
||||||
if (COM_Argc() < 3)
|
if (COM_Argc() < 3)
|
||||||
{
|
{
|
||||||
if (G_TagGametype())
|
if (G_TagGametype())
|
||||||
CONS_Printf(M_GetText("serverchangeteam <playernum> <team>: switch player to a new team (%s)\n"), "it, notit, playing, or spectator");
|
CONS_Printf(M_GetText("serverchangeteam <playername/playernum> <team>: switch player to a new team (%s)\n"), "it, notit, playing, or spectator");
|
||||||
else if (G_GametypeHasTeams())
|
else if (G_GametypeHasTeams())
|
||||||
CONS_Printf(M_GetText("serverchangeteam <playernum> <team>: switch player to a new team (%s)\n"), "red, blue or spectator");
|
CONS_Printf(M_GetText("serverchangeteam <playername/playernum> <team>: switch player to a new team (%s)\n"), "red, blue or spectator");
|
||||||
else if (G_GametypeHasSpectators())
|
else if (G_GametypeHasSpectators())
|
||||||
CONS_Printf(M_GetText("serverchangeteam <playernum> <team>: switch player to a new team (%s)\n"), "spectator or playing");
|
CONS_Printf(M_GetText("serverchangeteam <playername/playernum> <team>: switch player to a new team (%s)\n"), "spectator or playing");
|
||||||
else
|
else
|
||||||
CONS_Alert(CONS_NOTICE, M_GetText("This command cannot be used in this gametype.\n"));
|
CONS_Alert(CONS_NOTICE, M_GetText("This command cannot be used in this gametype.\n"));
|
||||||
return;
|
return;
|
||||||
|
@ -2655,19 +2655,19 @@ static void Command_ServerTeamChange_f(void)
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
if (G_TagGametype())
|
if (G_TagGametype())
|
||||||
CONS_Printf(M_GetText("serverchangeteam <playernum> <team>: switch player to a new team (%s)\n"), "it, notit, playing, or spectator");
|
CONS_Printf(M_GetText("serverchangeteam <playername/playernum> <team>: switch player to a new team (%s)\n"), "it, notit, playing, or spectator");
|
||||||
else if (G_GametypeHasTeams())
|
else if (G_GametypeHasTeams())
|
||||||
CONS_Printf(M_GetText("serverchangeteam <playernum> <team>: switch player to a new team (%s)\n"), "red, blue or spectator");
|
CONS_Printf(M_GetText("serverchangeteam <playername/playernum> <team>: switch player to a new team (%s)\n"), "red, blue or spectator");
|
||||||
else if (G_GametypeHasSpectators())
|
else if (G_GametypeHasSpectators())
|
||||||
CONS_Printf(M_GetText("serverchangeteam <playernum> <team>: switch player to a new team (%s)\n"), "spectator or playing");
|
CONS_Printf(M_GetText("serverchangeteam <playername/playernum> <team>: switch player to a new team (%s)\n"), "spectator or playing");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
NetPacket.packet.playernum = atoi(COM_Argv(1));
|
NetPacket.packet.playernum = nametonum(COM_Argv(1));
|
||||||
|
|
||||||
if (!playeringame[NetPacket.packet.playernum])
|
if (NetPacket.packet.playernum == -1 || !playeringame[NetPacket.packet.playernum])
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_NOTICE, M_GetText("There is no player %d!\n"), NetPacket.packet.playernum);
|
CONS_Alert(CONS_NOTICE, M_GetText("There is no player %s!\n"), COM_Argv(1));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3106,13 +3106,16 @@ static void Command_Verify_f(void)
|
||||||
|
|
||||||
if (COM_Argc() != 2)
|
if (COM_Argc() != 2)
|
||||||
{
|
{
|
||||||
CONS_Printf(M_GetText("promote <playernum>: give admin privileges to a player\n"));
|
CONS_Printf(M_GetText("promote <playername/playernum>: give admin privileges to a player\n"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
strlcpy(buf, COM_Argv(1), sizeof (buf));
|
playernum = nametonum(COM_Argv(1));
|
||||||
|
if (playernum == -1)
|
||||||
playernum = atoi(buf);
|
{
|
||||||
|
CONS_Alert(CONS_NOTICE, M_GetText("There is no player %s!\n"), COM_Argv(1));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
temp = buf;
|
temp = buf;
|
||||||
|
|
||||||
|
@ -3156,13 +3159,16 @@ static void Command_RemoveAdmin_f(void)
|
||||||
|
|
||||||
if (COM_Argc() != 2)
|
if (COM_Argc() != 2)
|
||||||
{
|
{
|
||||||
CONS_Printf(M_GetText("demote <playernum>: remove admin privileges from a player\n"));
|
CONS_Printf(M_GetText("demote <playername/playernum>: remove admin privileges from a player\n"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
strlcpy(buf, COM_Argv(1), sizeof(buf));
|
playernum = nametonum(COM_Argv(1));
|
||||||
|
if (playernum == -1)
|
||||||
playernum = atoi(buf);
|
{
|
||||||
|
CONS_Alert(CONS_NOTICE, M_GetText("There is no player %s!\n"), COM_Argv(1));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
temp = buf;
|
temp = buf;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue