Dialog problem
#11

pawn Код:
if(dialogid == NAME_COLOR3)
    {
        if(response == 1)
        {
            if(inputtext[0] == EOS)
            {
                SendClientMessage(playerid, COLOR_RED, "You left the input field blank.");
                return ShowPlayerDialog(playerid, NAME_COLOR3, DIALOG_STYLE_INPUT, "Write color", " Write a color in hex notation format:", "Apply", "Cancel");
            }
            new c;
            for( ; inputtext[c]; c++)
                if(('A' <= inputtext[c] && inputtext[c] <= 'F' && '0' <= inputtext[c] && inputtext[c] <= '9') == false)
                    break;
            if(inputtext[c] != EOS)
                return SendClientMessage(playerid, COLOR_RED, "Invalid character (Hex notation 0 - 9, A - F)");
            if(c != 9)
                return SendClientMessage(playerid, COLOR_RED, "Invalid format (Example: CCAA8866 [Red/Green/Blue/Visibility])");
            new color, Float:h;
            for(c--; c != -1; c--, h++)
                if(inputtext[c] >= 'A')
                    color += ((inputtext[c] - 'A' + 10) * floatpower(16.0, h));
                else    color += ((inputtext[c] - '0') * floatpower(16.0, h));
            return SetPlayerColor(playerid, color);
        }
    }
}
Reply


Messages In This Thread
Dialog problem - by [XST]O_x - 04.06.2010, 14:34
Re: Dialog problem - by ViruZZzZ_ChiLLL - 04.06.2010, 18:37
Re: Dialog problem - by [XST]O_x - 05.06.2010, 13:10
Re: Dialog problem - by ViruZZzZ_ChiLLL - 05.06.2010, 14:57
Re: Dialog problem - by [XST]O_x - 05.06.2010, 15:30
Re: Dialog problem - by LTomi - 05.06.2010, 15:39
Re: Dialog problem - by [XST]O_x - 05.06.2010, 15:53
Re: Dialog problem - by -Rebel Son- - 05.06.2010, 16:17
Re: Dialog problem - by [XST]O_x - 05.06.2010, 16:24
Re: Dialog problem - by [XST]O_x - 06.06.2010, 12:46
Re: Dialog problem - by Nero_3D - 06.06.2010, 13:14
Re: Dialog problem - by [XST]O_x - 06.06.2010, 14:43

Forum Jump:


Users browsing this thread: 2 Guest(s)