30.09.2010, 18:46
good but even DracoBlue released a HexToInt function in his DUtils (ofc it contains other useful functions)
But with his function you can insert strings
But with his function you can insert strings
pawn Код:
/**
* Return the value of an hex-string
* @param string
*/
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;
}

