SA-MP Forums Archive
Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help (/showthread.php?tid=184895)



Help - Rudyy - 22.10.2010

From

SetPlayerColor(playerid, dini_Int(org2,"Color"));

to something like

SetPlayerColor(playerid, dini_Get(org2,"Color"));


i gonna wait this time.


Re: Help - Mean - 22.10.2010

lol, why would you use "dini" for SetPlayerColor?


Re: Help - Jeffry - 22.10.2010

pawn Код:
SetPlayerColor(playerid, strval(dini_Get(org2,"Color")));
Like this or what?


Re: Help - Rudyy - 22.10.2010

Okay basically i making something dynamic..

On my org1.ini
Код:
color=0x9BFF00FF
I want tat color to appear my player color.

But it seems not to be changing my name color. Its suppose to be green but turned out black.


Re: Help - Jeffry - 22.10.2010

I can't think of any way now. Maybe there is even no way. But dunno.


Re: Help - MadeMan - 22.10.2010

Put this function in your script

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;
}
then use

pawn Код:
SetPlayerColor(playerid, HexToInt(dini_Get(org2,"Color")));



Re: Help - Rudyy - 02.11.2010

Thanks!