Read Color from File
#3

this is tricky for me, but i did run across "HexToInt", maybe this will get you started, you could read more about it to try and figure it out.

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;
    }
and an example was something like

pawn Код:
new Color = GetPlayerColor(playerid);
    PlayerInfo[i][Color] = HexToInt(Color);
good luck

edit: some threads

http://forum.sa-mp.com/index.php?topic=89879.0
http://forum.sa-mp.com/index.php?topic=54420.0
http://forum.sa-mp.com/index.php?top...2976#msg182976
Reply


Messages In This Thread
Read Color from File - by MrMaccaroni - 11.07.2009, 12:36
Re: Read Color from File - by lavamike - 11.07.2009, 13:31
Re: Read Color from File - by happyface - 11.07.2009, 13:34

Forum Jump:


Users browsing this thread: 1 Guest(s)