Loading Color?
#9

Quote:
Originally Posted by TakeiT
Посмотреть сообщение
Not made by me, but I used something like this for a SetObjectMaterialText script I made about a year ago.

pawn Код:
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;
 }
If he's loading it as an integer why would he want to convert the hex to the integer again?
Reply


Messages In This Thread
Loading Color? - by xAzKingx - 24.01.2015, 16:46
Re: Loading Color? - by Dignity - 24.01.2015, 16:50
Re: Loading Color? - by xAzKingx - 24.01.2015, 16:56
Re: Loading Color? - by Dignity - 24.01.2015, 16:59
Re: Loading Color? - by xAzKingx - 24.01.2015, 17:06
Re: Loading Color? - by Dignity - 24.01.2015, 17:08
Re: Loading Color? - by Write - 24.01.2015, 17:11
Re: Loading Color? - by TakeiT - 24.01.2015, 17:12
Re: Loading Color? - by Write - 24.01.2015, 18:06
Re: Loading Color? - by xAzKingx - 24.01.2015, 18:51

Forum Jump:


Users browsing this thread: 3 Guest(s)