SA-MP Forums Archive
[Ajuda] Como colocar "Motivo" nos comandos? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Como colocar "Motivo" nos comandos? (/showthread.php?tid=457738)



Como colocar "Motivo" nos comandos? - Jonathan4i20 - 12.08.2013

Ei gente, como coloco motivo? Exemplo:

O jogador jonathan procurou o player teste motivo: "TH"

ou

O jogador jonathan prendeu o player teste motivo: "Procurado"

ai o player q escolhe o motivo

/procurar [id] [motivo]


Re : Como colocar "Motivo" nos comandos? - ThiagoMK - 12.08.2013

Nгo intendi oq vocк quer fazer :\


Re: Como colocar "Motivo" nos comandos? - StreetGT - 12.08.2013

https://sampwiki.blast.hk/wiki/Strtok


Re: Como colocar "Motivo" nos comandos? - Juniiro3 - 12.08.2013

Procure por strtok OU use o plugin + include sscanf


Re: Como colocar "Motivo" nos comandos? - PT - 13.08.2013

tens ae um exemplo feito em zcmd juntamente com sscanf

pawn Код:
CMD:lindo(playerid, params[])
{
    new string[256], id, motivo[64], pname[MAX_PLAYER_NAME];
    GetPlayerName(id, pname, sizeof(pname));

    if(sscanf(params, "us[64]", id, motivo))
    {
        SendClientMessage(playerid, Vermelho, "Digite: /lindo [id] [motivo]");
        return 1;
    }
    format(string, sizeof(string), "%s e lindo. Motivo: %s ( /afk )", pname, AFKMotivo);
    SendClientMessageToAll(-1, string);
    return 1;
}



Re: Como colocar "Motivo" nos comandos? - Jonathan4i20 - 13.08.2013

Obrigado PT, consegui, vlw a todos !!