[Tutorial] Usando y_commands e sscanf
#49

Quote:
Originally Posted by Schocc
Посмотреть сообщение
Espero que eu tenha expandido um pouco mais sobre a y_commands processor, Contudo ela ainda tem mais alguns segredinhos.
A preguiзa bateu chega de explicar
Estou a 35 horas sem dormir, estou muito cansado eu pensei em explicar na prуxima hora....

Nгo esta errada, eu nгo afirmei que existe um comando embutido chamado help.
Eu nгo mencionei sobre a criaзгo do comando, atй porque й bobagem isso cabe ao scripter/programmer criar o comando para utilizar o sistema de ajuda.

Para usar o sistema de ajuda, deve ser criado o comando. Contudo utilizando a funзгo Command_ReProcess com o parвmetro help flag/bandeira, ativada.

A unica coisa que deve fazer й usar a funзгo Command_ReProcess, nгo й tгo difнcil fazer isso. O mesmo й o objetivo principal de Y_less.
pawn Код:
YCMD:help(p,pr[],h) {

    SendClientMessage( p, -1, "System help!" );
    Command_ReProcess( p, pr, true );
    return 1;
}

Quote:
Originally Posted by Y_Less
Посмотреть сообщение
pawn Код:
YCMD:help(playerid, params[], help)
{
    if (help)
    {
        SendClientMessage(playerid, 0xFF0000AA, "Displays help about your mode.");
    }
    else
    {
        if (isnull(params))
        {
            new
                str[128];
            SendClientMessage(playerid, 0xFF0000AA, "Welcome to my mode.");
            format(str, sizeof (str), "Type \"/%s [command]\" for more help on a command", Command_GetDisplayNamed("help", playerid));
            SendClientMessage(playerid, 0xFF0000AA, str);
        }
        else
        {
            Command_ReProcess(playerid, params, true);
        }
    }
    return 1;
}
[*]Help - The command system, as shown above, has inbuilt support for a help system. You define the help for a command with that command, making managing your script VASTLY easier. To use this feature from your help command simply do something like:

@PT/BR: O sistema de comando, como mostrado acima, tem embutido o suporte para um sistema de ajuda. Vocк define a ajuda para um comando com esse comando, tornando o gerenciamento de seu roteiro muito mais fбcil. Para usar esse recurso do seu comando de ajuda simplesmente fazer algo como:

[*]Command_ReProcess(playerid, cmdtext[], help) - Call to put text through the command processor, with the help functions enabled or disabled.


Isso resultaria em
Код:
/ajuda <commandname>
.

Agora creio que estб tudo esclarecido ao meu ponto de vista sobre o sistema de ajuda.
Reply


Messages In This Thread
Usando y_commands e sscanf - by PT - 26.08.2013, 03:32
Re: Usando y_commands e sscanf - by Diogo123 - 26.08.2013, 05:41
Re: Usando y_commands e sscanf - by PT - 26.08.2013, 05:58
Re: Usando y_commands e sscanf - by darkxdll - 26.08.2013, 12:17
Re: Usando y_commands e sscanf - by Juninho_Oakley - 26.08.2013, 15:59
Re: Usando y_commands e sscanf - by PT - 26.08.2013, 18:23
Re: Usando y_commands e sscanf - by smiiir - 26.08.2013, 21:36
Re: Usando y_commands e sscanf - by WLSF - 26.08.2013, 22:02
Re: Usando y_commands e sscanf - by PT - 26.08.2013, 23:03
Re: Usando y_commands e sscanf - by Juniiro3 - 26.08.2013, 23:16
Re: Usando y_commands e sscanf - by PT - 26.08.2013, 23:31
Re: Usando y_commands e sscanf - by Juniiro3 - 26.08.2013, 23:33
Re: Usando y_commands e sscanf - by PT - 27.08.2013, 00:17
Re: Usando y_commands e sscanf - by Juniiro3 - 27.08.2013, 00:46
Re: Usando y_commands e sscanf - by PT - 27.08.2013, 00:53
Re: Usando y_commands e sscanf - by mau.tito - 27.08.2013, 10:11
Re: Usando y_commands e sscanf - by PT - 27.08.2013, 13:35
Re: Usando y_commands e sscanf - by Renancito10 - 01.09.2013, 16:24
Re: Usando y_commands e sscanf - by PT - 01.09.2013, 17:28
Re: Usando y_commands e sscanf - by Schocc - 01.09.2013, 18:48
Re: Usando y_commands e sscanf - by PT - 01.09.2013, 18:55
Re: Usando y_commands e sscanf - by Schocc - 01.09.2013, 19:07
Re: Usando y_commands e sscanf - by PT - 01.09.2013, 19:21
Re: Usando y_commands e sscanf - by LeMoi - 03.09.2013, 22:17
Re: Usando y_commands e sscanf - by PT - 03.09.2013, 22:34
Re: Usando y_commands e sscanf - by Lуs - 04.09.2013, 02:59
Re: Usando y_commands e sscanf - by PT - 04.09.2013, 08:03
Re: Usando y_commands e sscanf - by bruxo00 - 13.10.2013, 12:23
Re: Usando y_commands e sscanf - by lucas_mdr1235 - 09.02.2014, 11:26
Re: Usando y_commands e sscanf - by PT - 09.02.2014, 11:32
Re: Usando y_commands e sscanf - by lucas_mdr1235 - 09.02.2014, 11:51
Re: Usando y_commands e sscanf - by PT - 09.02.2014, 12:08
Re: Usando y_commands e sscanf - by lucas_mdr1235 - 28.02.2014, 13:55
Re: Usando y_commands e sscanf - by PT - 28.02.2014, 14:12
Re: Usando y_commands e sscanf - by lucas_mdr1235 - 28.02.2014, 14:23
Re: Usando y_commands e sscanf - by PT - 28.02.2014, 14:32
Re: Usando y_commands e sscanf - by lucas_mdr1235 - 28.02.2014, 14:42
Re: Usando y_commands e sscanf - by N3XTMapper - 28.02.2014, 14:46
Re: Usando y_commands e sscanf - by Wanderson_SAMP - 28.02.2014, 16:44
Re: Usando y_commands e sscanf - by Input - 28.02.2014, 17:05
Re: Usando y_commands e sscanf - by lucas_mdr1235 - 28.02.2014, 17:55
Re: Usando y_commands e sscanf - by PT - 28.02.2014, 19:44
Re: Usando y_commands e sscanf - by Input - 28.02.2014, 19:49
Re: Usando y_commands e sscanf - by PT - 28.02.2014, 19:50
Re: Usando y_commands e sscanf - by Schocc - 01.03.2014, 02:17
Re: Usando y_commands e sscanf - by N3XTMapper - 01.03.2014, 02:22
Re: Usando y_commands e sscanf - by Schocc - 01.03.2014, 03:21
Re: Usando y_commands e sscanf - by PT - 01.03.2014, 10:30
Re: Usando y_commands e sscanf - by Schocc - 01.03.2014, 11:08
Re: Usando y_commands e sscanf - by PT - 01.03.2014, 11:21
Re: Usando y_commands e sscanf - by CharlieSanchez - 31.03.2014, 11:43
Re: Usando y_commands e sscanf - by PT - 13.12.2015, 13:12

Forum Jump:


Users browsing this thread: 3 Guest(s)