Admin chat
#2

Here is an example, without even using sscanf:
pawn Код:
CMD:a(playerid, params[])
{
    if ( !IsPlayerAdmin ( playerid ) ) return 0; /* return 0 if player is not admin */
    if ( isnull ( params ) ) return SendClientMessage( playerid, -1, "Syntax /a <text>" ); /* if parameters are null return the syntax message */
    new
        _string[ 128 ]; /* declare a new array */
    format ( _string, sizeof ( _string ), "Admin %s: %s", GetName( playerid ), params ); /* format our message, store it in the array _string */
    SendClientMessageToAll( -1, _string ); /* send the message to all players */
    return true; /* true = 1 */
}
Reply


Messages In This Thread
Admin chat - by Santox14 - 04.11.2011, 16:49
Re: Admin chat - by SmiT - 04.11.2011, 17:05
Re: Admin chat - by Zonoya - 04.11.2011, 17:12
Re: Admin chat - by SmiT - 04.11.2011, 17:13
Re: Admin chat - by Zonoya - 04.11.2011, 17:14
Re: Admin chat - by Kingunit - 04.11.2011, 17:20
AW: Admin chat - by Santox14 - 04.11.2011, 17:30
Re: Admin chat - by Zonoya - 04.11.2011, 17:31
Re: Admin chat - by Kingunit - 04.11.2011, 18:12
AW: Admin chat - by Santox14 - 04.11.2011, 18:47

Forum Jump:


Users browsing this thread: 1 Guest(s)