add rcon message helper function

This commit is contained in:
Lorenc Pekaj 2018-09-10 17:19:38 +10:00
parent 90ff5fb71a
commit 605f4a28a6
2 changed files with 14 additions and 2 deletions

View File

@ -57,6 +57,20 @@ stock SendClientMessageFormatted( playerid, colour, format[ ], va_args<> )
}
}
// purpose: send client message to all rcon admins
stock SendClientMessageToRCON( colour, format[ ], va_args<> )
{
static
out[ 144 ];
va_format( out, sizeof( out ), format, va_start<2> );
foreach ( new i : Player ) if ( IsPlayerAdmin( i ) ) {
SendClientMessage( i, colour, out );
}
return 1;
}
// purpose: trim a string
stock trimString( strSrc[ ] )
{

View File

@ -103,8 +103,6 @@ new bool: False = false;
/* Beast Functions */
#define SendClientMessageToRCON(%1,%2,%3) \
do{foreach(new fI : Player){if (IsPlayerAdmin(fI))format(szNormalString,sizeof(szNormalString),(%2),%3),SendClientMessage(fI,(%1),szNormalString);}}while(False)
#define SendClientMessageToCops(%1,%2,%3) \
do{foreach(new fI : Player){if (p_Class[fI]==CLASS_POLICE)format(szNormalString,sizeof(szNormalString),(%2),%3),SendClientMessage(fI,(%1),szNormalString);}}while(False)
#define SendClientMessageToFireman(%1,%2,%3) \