MySQL Problem
#3

Код:
stock HexToInteger(String[])
{	if(String[0]==0)
{	return 0;}
	new Result;
	new Current;
	Current=1;
	new Loop;
	for(Loop=strlen(String);Loop>0;Loop--)
{	if(String[Loop-1]<58)
{	Result=Result+Current*(String[Loop-1]-48);}
	else
{	Result=Result+Current*(String[Loop-1]-65+10);}
	Current=Current*16;}
	return Result;}
This may or may not be of some assistance, but it's an alternative way I personally use to store colors:
For example, when I need to retrieve a saved color from a simple string, I convert using the above function

Код:
SetPlayerColor(playerid,HexToInteger(String));
I didn't create the function, but found it somewhere on SA-MP and decided to share
Reply


Messages In This Thread
MySQL Problem - by EviLpRo - 11.08.2011, 11:16
Re: MySQL Problem - by MadeMan - 11.08.2011, 11:38
Re: MySQL Problem - by XGh0stz - 11.08.2011, 11:43
Re: MySQL Problem - by EviLpRo - 11.08.2011, 16:12

Forum Jump:


Users browsing this thread: 1 Guest(s)