[Ajuda] Dialog
#1

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
Reply
#2

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

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)
Reply
#4

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
Reply
#5

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

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

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

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)