11.08.2011, 11:43
Код:
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;}
For example, when I need to retrieve a saved color from a simple string, I convert using the above function
Код:
SetPlayerColor(playerid,HexToInteger(String));