27.09.2016, 15:35
Go to SetObjectMaterial lines and look again at the code. CreateObject has 4 parameters (missing 3 last for rotation). The second and third line (of SetObjectMaterial function) have the rotation instead of the index and the rest parameters.