adds /viewpolicechat for level 5 admins
This commit is contained in:
parent
e46ece5ace
commit
c15ea9ef49
@ -156,6 +156,7 @@ static stock
|
||||
{ 5, "/destroybusiness", "Deletes a business" },
|
||||
{ 5, "/seteventhost", "Setting event host to player" },
|
||||
{ 5, "/weather", "Settings world weather" },
|
||||
{ 5, "/viewpolicechat", "Viewing the police radio/chat" },
|
||||
|
||||
/* ** Level 6 Commands ** */
|
||||
{ 6, "/reloadeditor", "Reloads object editer script" },
|
||||
|
@ -20,6 +20,18 @@ CMD:armorall( playerid, params[ ] )
|
||||
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[ ] )
|
||||
{
|
||||
new
|
||||
|
@ -39,6 +39,7 @@ new
|
||||
p_Ropes [ MAX_PLAYERS ],
|
||||
bool: p_Kidnapped [ MAX_PLAYERS char ],
|
||||
bool: p_ToggledViewPM [ MAX_PLAYERS char ],
|
||||
bool: p_ToggleCopChat [ MAX_PLAYERS char ],
|
||||
p_TicketTimestamp [ MAX_PLAYERS ],
|
||||
p_TicketIssuer [ MAX_PLAYERS ] = { INVALID_PLAYER_ID, ... },
|
||||
p_CheckpointEnterTick [ MAX_PLAYERS ],
|
||||
|
@ -3427,6 +3427,14 @@ public OnPlayerText( playerid, text[ ] )
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user