31.10.2013, 11:03
It's a good tutorial but you chose 2 commands that can be done without sscanf.
For example, in /announce command you used an array of size 128 when it's not needed at all and in the /ooc command you used 2 arrays of size 128 when 1 is enough!
For example, in /announce command you used an array of size 128 when it's not needed at all and in the /ooc command you used 2 arrays of size 128 when 1 is enough!
pawn Код:
CMD:announce( playerid, params[ ] )
{
if( isnull( params ) ) return SendClientMessage( playerid, RED, "(([!]Syntax:/announce[text]))" );
GameTextForAll( params, 10000, 0 );
return 1;
}
CMD:ooc( playerid, params[ ] )
{
if( isnull( params ) ) return SendClientMessage( playerid, RED, "(([!]Syntax:/ooc[text]))" );
new
str[ 128 ]
;
GetPlayerName( playerid, str, MAX_PLAYER_NAME );
format( str, sizeof( str ), "((%s:%s))", str, params );
SendClientMessageToAll( YELLOW, str );
return 1;
}