SA-MP Forums Archive
[Ajuda] Dialog - 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] Dialog (/showthread.php?tid=369954)



Dialog - HighBall - 18.08.2012

Estou fazendo uma dialog estilo input em que o player muda a cor do seu nick inserindo o codigo.Ex:0xFFFF00,so que esta dando algum problema que nao faz mudar a cor.

pawn Код:
if(dialogid == DIALOG_COR)
        {
       if(response)
    {
       new corhex = strval(inputtext);
       SetPlayerColor(playerid, corhex);
    }
        return 1;
    }
Ja procurei no forum,web,tentei um monte de codigos diferentes e nao consegui


Respuesta: Dialog - AnonymouSs - 18.08.2012

Tenta isso:
pawn Код:
if(dialogid == DIALOG_COR)
{
    if(response)
    {
       SetPlayerColor(playerid, inputtext);
    }
    return 1;
}



Re: Respuesta: Dialog - HighBall - 18.08.2012

Quote:
Originally Posted by AnonymouSs
Посмотреть сообщение
Tenta isso:
pawn Код:
if(dialogid == DIALOG_COR)
{
    if(response)
    {
       SetPlayerColor(playerid, inputtext);
    }
    return 1;
}
@edit
pawn Код:
error 035: argument type mismatch (argument 2)



Respuesta: Dialog - AnonymouSs - 18.08.2012

Desconsidere meu codigo...
Bom, acho que nгo daria para fazer isso que vocк estб tentando, predefina as cores que ele pode escolher, fica bem melhor.
Olha esse topico: https://sampforum.blast.hk/showthread.php?tid=158858


Re: Dialog - Tony_Rodrigues - 18.08.2012

pawn Код:
if(dialogid == DIALOG_COR)
{
    if(response >= 0)
    {
       SetPlayerColor(playerid, inputtext);
    }
    return 1;
}
Acho que da


Re: Dialog - HighBall - 19.08.2012

Nao funcionou deu o erro
pawn Код:
error 035: argument type mismatch (argument 2)
Me ajudem!


Re: Dialog - paulor - 19.08.2012

pawn Код:
StrToHex (string []) //By. DOS
{
    new
        i,
        value;
       
    if (string [0] == '0' && (string [1] == 'x' || string [1] == 'X'))
        i = 2;

    while (string [i])
    {
        value <<= 4;
        switch (string [i])
        {
            case '0' .. '9':
                value |= string [i] - '0';

            case 'A' .. 'F':
                value |= string [i] - 'A' + 10;

            case 'a' .. 'f':
                value |= string [i] - 'a' + 10;

            default:
                return 0;
        }
        ++i;
    }
    return value;
}

if(dialogid == DIALOG_COR)
{
    if(response >= 0)
    {
       SetPlayerColor(playerid, StrToHex(inputtext));
    }
    return 1;
}



Re: Dialog - HighBall - 19.08.2012

Quote:
Originally Posted by paulor
Посмотреть сообщение
pawn Код:
StrToHex (string []) //By. DOS
{
    new
        i,
        value;
       
    if (string [0] == '0' && (string [1] == 'x' || string [1] == 'X'))
        i = 2;

    while (string [i])
    {
        value <<= 4;
        switch (string [i])
        {
            case '0' .. '9':
                value |= string [i] - '0';

            case 'A' .. 'F':
                value |= string [i] - 'A' + 10;

            case 'a' .. 'f':
                value |= string [i] - 'a' + 10;

            default:
                return 0;
        }
        ++i;
    }
    return value;
}

if(dialogid == DIALOG_COR)
{
    if(response >= 0)
    {
       SetPlayerColor(playerid, StrToHex(inputtext));
    }
    return 1;
}
Aeee deu certo! vlw