[Tutorial] Simple ZCMD Commands! (Using sscanf)
#6

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!

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;
}
Reply


Messages In This Thread
Simple ZCMD Commands! (Using sscanf) - by Keyhead - 29.10.2013, 22:07
Re: Simple ZCMD Commands! (Using sscanf) - by iAnonymous - 29.10.2013, 22:11
Re: Simple ZCMD Commands! (Using sscanf) - by DanishHaq - 29.10.2013, 22:13
Re: Simple ZCMD Commands! (Using sscanf) - by Keyhead - 29.10.2013, 22:14
Re: Simple ZCMD Commands! (Using sscanf) - by newbie scripter - 31.10.2013, 10:49
Re: Simple ZCMD Commands! (Using sscanf) - by Konstantinos - 31.10.2013, 11:03
Re: Simple ZCMD Commands! (Using sscanf) - by newbie scripter - 31.10.2013, 11:20

Forum Jump:


Users browsing this thread: 1 Guest(s)