SetObjectMaterial and usage of arrays. -
pawn Код:
new MapArray[7];
new v = 0;
MapArray[v++] = CreateDynamicObject(19531,0,0,0,0.000,0.000,0.000,-1,-1,-1,80.000,80.000);
SetDynamicObjectMaterial(MapArray[v], 0, 4, "texture", "name", 0);
MapArray[v++] = CreateDynamicObject(19377,0.110,0.386,-70.515,0.000,0.000,0.000,-1,-1,-1,80.000,80.000);
SetDynamicObjectMaterial(MapArray[v], 0, 0, "texture", "name", 0);
MapArray[v++] = CreateDynamicObject(19377,0.110,0.760,-70.515,0.000,0.000,0.000,-1,-1,-1,80.000,80.000);
SetDynamicObjectMaterial(MapArray[v], 0, 0, "texture", "name", 0);
MapArray[v++] = CreateDynamicObject(19377,0.110,0.599,-70.515,0.000,0.000,0.000,-1,-1,-1,80.000,80.000);
SetDynamicObjectMaterial(MapArray[v], 0, 0, "texture", "name", 0);
MapArray[v++] = CreateDynamicObject(19377,0.277,0.033,-70.515,0.000,0.000,90.000,-1,-1,-1,80.000,80.000);
SetDynamicObjectMaterial(MapArray[v], 0, 1, "texture", "name", -12303292);
MapArray[v++] = CreateDynamicObject(19377,0.471,0.900,-70.515,0.000,0.000,90.000,-1,-1,-1,80.000,80.000);
SetDynamicObjectMaterial(MapArray[v], 0, 0, "texture", "name", 0);
I decided to do it this way.
** Ignore coordinates, model ids, those are just placeholders, I don't want to show my original map.
Re: SetObjectMaterial and usage of arrays. -
Because you're trying to update the texture of an object that doesn't exist. Directly after the CreateDynamicObject line, v gets incremented. It should be incremented only after the textures have been applied.