SA-MP Forums Archive
/announce command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /announce command (/showthread.php?tid=291771)



/announce command - aminj - 21.10.2011

hey guys... is there any script for /anounce command? i really need it fast :S


Re: /announce command - SmiT - 21.10.2011

What do you mean by "anounce"? Here is what I understood, using y_commands:
pawn Код:
YCMD:announce(playerid, params[], help)
{
    if ( help ) return SendClientMessage( playerid, -1, #Announce something );
    if ( isnull ( params ) ) return SendClientMessage( playerid, -1, #Usage /announce <text> );
    new
        _Str[ 128 ], P_NAME[ MAX_PLAYER_NAME ];
    GetPlayerName( playerid, P_NAME, MAX_PLAYER_NAME );
   
    for ( new i = 0; i != MAX_PLAYERS; ++i )
    {
        format( _Str, sizeof ( _Str ), "%s has announced: ~n~%s", P_NAME, params );
        GameTextForPlayer( i, _Str, 4500, 3 );
    }
    return true;
}
Using "/announce Hello" it will display for all players the message "PlayerName has announced: Hello" for 4500 milliseconds in this style: