04.11.2011, 17:05
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 */
}