int PackBytes(int a, int b, int c, int d)
Packs four bytes into one integer and returns the result. The bytes' values must be in [0, 255] range.
The packed values can be retrieved using UnpackByte.
This functions can be used to pass more than 3 or 4 arguments to a script in a readable way.
int packed = PackBytes(10, 11, 12, 13); UnpackByte1(packed) -> 10 UnpackByte2(packed) -> 11 UnpackByte3(packed) -> 12 UnpackByte4(packed) -> 13
Passing a color to a script:
int color = PackBytes(255, 128, 0, 128); // red, green, blue, alpha ACS_ExecuteAlways(somescript, 0, x, y, color);