12.02.2015, 01:04
Quote:
sscanf, you can use it for any string to something converting
https://github.com/Y-Less/sscanf/wiki/%22h%22-Specifier pawn Код:
|
For example if my input is "FFFF00" the HEX will become FFFFFF00 without the 0x at the beginning and the color of the object wouldn't change either.
pawn Код:
if(response)
{
new hex, matmodel, txdname[45], texturename[45], color;
if(isnull(inputtext) || sscanf(inputtext, "h", hex))
return RedNoticeEx(playerid, "Invalid HEX color."), ShowTextureColorChange(playerid, FMatSlot[playerid]);
hex |= 0xFF << 24;
SCMEx(playerid, hex, "%h", hex);
new object = Furniture[FHouse[playerid]][FSlot[playerid]][fObject];
GetDynamicObjectMaterial(object, FMatSlot[playerid], matmodel, txdname, texturename, color, 45, 45);
SetDynamicObjectMaterial(object, FMatSlot[playerid], matmodel, txdname, texturename, hex);
ShowTextureColorChange(playerid, FMatSlot[playerid]);
}