mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-24 05:11:08 +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)
|
||||
{
|
||||
CONS_Printf(M_GetText("muteplayer <playernum>: mute a player\n"));
|
||||
CONS_Printf(M_GetText("muteplayer <playername/playernum>: mute a player\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
data[0] = atoi(COM_Argv(1));
|
||||
data[0] = nametonum(COM_Argv(1));
|
||||
if (data[0] >= MAXPLAYERS || !playeringame[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 (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())
|
||||
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())
|
||||
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
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("This command cannot be used in this gametype.\n"));
|
||||
return;
|
||||
|
@ -2655,19 +2655,19 @@ static void Command_ServerTeamChange_f(void)
|
|||
if (error)
|
||||
{
|
||||
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())
|
||||
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())
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -3106,13 +3106,16 @@ static void Command_Verify_f(void)
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
strlcpy(buf, COM_Argv(1), sizeof (buf));
|
||||
|
||||
playernum = atoi(buf);
|
||||
playernum = nametonum(COM_Argv(1));
|
||||
if (playernum == -1)
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("There is no player %s!\n"), COM_Argv(1));
|
||||
return;
|
||||
}
|
||||
|
||||
temp = buf;
|
||||
|
||||
|
@ -3156,13 +3159,16 @@ static void Command_RemoveAdmin_f(void)
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
strlcpy(buf, COM_Argv(1), sizeof(buf));
|
||||
|
||||
playernum = atoi(buf);
|
||||
playernum = nametonum(COM_Argv(1));
|
||||
if (playernum == -1)
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("There is no player %s!\n"), COM_Argv(1));
|
||||
return;
|
||||
}
|
||||
|
||||
temp = buf;
|
||||
|
||||
|
|
Loading…
Reference in a new issue