30.04.2013, 03:29
title
new int;
sscanf(params, "h", color);
// Is string a hexvalue
stock IsHexValue(hstring[])
{
if(strlen(hstring) < 10) return 0;
if(hstring[0] == 48 && hstring[1] == 120)
{
for(new i = 2; i < 10; i++)
{
if(hstring[i] == 48 || hstring[i] == 49 || hstring[i] == 50 || hstring[i] == 51 || hstring[i] == 52 ||
hstring[i] == 53 || hstring[i] == 54 || hstring[i] == 55 || hstring[i] == 56 || hstring[i] == 57 ||
hstring[i] == 65 || hstring[i] == 66 || hstring[i] == 67 || hstring[i] == 68 || hstring[i] == 69 ||
hstring[i] == 70) continue;
else return 0;
}
}
else return 0;
return 1;
}