22.07.2016, 17:04
The 2D-array ObjInfo will only save whatever value [0ID] is holding for index MAX_OBJECTS.
Let's say MAX_OBJECTS has been defined as 5:
We then assign a value to ObjInfo[MAX_OBJECTS][0ID]:
What the preprocessor will do is replace MAX_OBJECTS with its defined value:
This means that for the index MAX_OBJECTS (5) of the 2D-array ObjInfo, 0ID equals 10.
What you want to do is save the values of 0ID for all indexes of ObjInfo. In that case, you need a loop:
Fault-checking should be done by you. With fault-checking, I immediately think of non-existing objects or empty indexes.
Let's say MAX_OBJECTS has been defined as 5:
PHP код:
#define MAX_OBJECTS 5
PHP код:
ObjInfo[MAX_OBJECTS][0ID] = 10;
PHP код:
ObjInfo[5][0ID] = 10;
What you want to do is save the values of 0ID for all indexes of ObjInfo. In that case, you need a loop:
PHP код:
for(new i = 0; i < MAX_OBJECTS; i++) {
INI_WriteInt(object, "Object ID", ObjInfo[i][OID])
}