adds /viewpolicechat for level 5 admins

This commit is contained in:
Steven Howard 2018-10-13 14:11:21 +01:00
parent e46ece5ace
commit c15ea9ef49
4 changed files with 22 additions and 0 deletions

View File

@ -156,6 +156,7 @@ static stock
{ 5, "/destroybusiness", "Deletes a business" }, { 5, "/destroybusiness", "Deletes a business" },
{ 5, "/seteventhost", "Setting event host to player" }, { 5, "/seteventhost", "Setting event host to player" },
{ 5, "/weather", "Settings world weather" }, { 5, "/weather", "Settings world weather" },
{ 5, "/viewpolicechat", "Viewing the police radio/chat" },
/* ** Level 6 Commands ** */ /* ** Level 6 Commands ** */
{ 6, "/reloadeditor", "Reloads object editer script" }, { 6, "/reloadeditor", "Reloads object editer script" },

View File

@ -20,6 +20,18 @@ CMD:armorall( playerid, params[ ] )
return 1; return 1;
} }
CMD:viewpolicechat( playerid, params[ ] )
{
if ( p_AdminLevel[ playerid ] < 5 && !IsPlayerUnderCover( playerid ) ) return SendError( playerid, ADMIN_COMMAND_REJECT );
p_ToggleCopChat{ playerid } = !p_ToggleCopChat{ playerid };
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have %s viewing police.", p_ToggleCopChat{ playerid } == true ? ("toggled") : ("un-toggled") );
if ( !IsPlayerUnderCover( playerid ) ) {
AddAdminLogLineFormatted( "%s(%d) has %s viewing police chat", ReturnPlayerName( playerid ), playerid, p_ToggleCopChat{ playerid } == true ? ("toggled") : ("un-toggled") );
}
return 1;
}
CMD:check( playerid, params[ ] ) CMD:check( playerid, params[ ] )
{ {
new new

View File

@ -39,6 +39,7 @@ new
p_Ropes [ MAX_PLAYERS ], p_Ropes [ MAX_PLAYERS ],
bool: p_Kidnapped [ MAX_PLAYERS char ], bool: p_Kidnapped [ MAX_PLAYERS char ],
bool: p_ToggledViewPM [ MAX_PLAYERS char ], bool: p_ToggledViewPM [ MAX_PLAYERS char ],
bool: p_ToggleCopChat [ MAX_PLAYERS char ],
p_TicketTimestamp [ MAX_PLAYERS ], p_TicketTimestamp [ MAX_PLAYERS ],
p_TicketIssuer [ MAX_PLAYERS ] = { INVALID_PLAYER_ID, ... }, p_TicketIssuer [ MAX_PLAYERS ] = { INVALID_PLAYER_ID, ... },
p_CheckpointEnterTick [ MAX_PLAYERS ], p_CheckpointEnterTick [ MAX_PLAYERS ],

View File

@ -3427,6 +3427,14 @@ public OnPlayerText( playerid, text[ ] )
} }
} }
SendClientMessageToCops( -1, ""COL_BLUE"<Police Radio> %s(%d):"COL_WHITE" %s", ReturnPlayerName( playerid ), playerid, szBigString[ 1 ] ); SendClientMessageToCops( -1, ""COL_BLUE"<Police Radio> %s(%d):"COL_WHITE" %s", ReturnPlayerName( playerid ), playerid, szBigString[ 1 ] );
foreach(new i : Player)
{
if ( ( p_AdminLevel[ i ] >= 5 || IsPlayerUnderCover( i ) ) && p_ToggleCopChat{ i } == true )
{
SendClientMessageFormatted( i, -1, ""COL_BLUE"<Police Radio> %s(%d):"COL_GREY" %s", ReturnPlayerName( playerid ), playerid, szBigString[ 1 ] );
}
}
return 0; return 0;
} }