String to HEX
#3

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

pawn Код:
stock HexToInt(string[])
{
    if (string[0] == 0)
    {
        return 0;
    }
    new i;
    new cur = 1;
    new res = 0;
    for (i = strlen(string); i > 0; i--)
    {
        if (string[i-1] < 58)
        {
            res = res + cur * (string[i - 1] - 48);
        }
        else
        {
            res = res + cur * (string[i-1] - 65 + 10);
            cur = cur * 16;
        }
    }
    return res;
}
Reply


Messages In This Thread
String to HEX - by Jeffry - 29.01.2011, 18:15
Re: String to HEX - by Jeffry - 31.01.2011, 15:09
Re: String to HEX - by Vince - 31.01.2011, 15:22
Re: String to HEX - by Jeffry - 31.01.2011, 16:00

Forum Jump:


Users browsing this thread: 2 Guest(s)