05.01.2011, 22:18
(
Последний раз редактировалось mkr; 05.01.2011 в 23:34.
Причина: Quick fix
)
I think color tuple order is backwards: i.e. (A,G,B,R) instead of (R,G,B,A). My color values other than white weren't displaying correctly, so I wrote a command to test stuff easily.
I got these results:

EDIT: A simple fix was editing _getColor in nativefunctions.h and recompiling, though the DLL it spat out was more than twice the size as the provided one. You just reverse the order of the array elements, from
to
I'm not sure how big a hack this is.
Код:
def OnPlayerCommandText(playerid, cmdtext): cmd = cmdtext.split(' ') if cmd[0] == "/colortest": if len(cmd) == 5: color = (int(cmd[1]),int(cmd[2]),int(cmd[3]),int(cmd[4])) SendClientMessage(playerid,color,"** This is color 0x%02x%02x%02x%02x - this is its Python tuple form: %s" % (color[0],color[1],color[2],color[3],str(color))) return True

EDIT: A simple fix was editing _getColor in nativefunctions.h and recompiling, though the DLL it spat out was more than twice the size as the provided one. You just reverse the order of the array elements, from
Код:
PyArg_ParseTuple(pyobj, "bbbb", &col[0], &col[1], &col[2], &col[3]); \
Код:
PyArg_ParseTuple(pyobj, "bbbb", &col[3], &col[2], &col[1], &col[0]); \