12.08.2016, 15:22
Evening, I finally got the gamemode working.
Now I have an another problem..
Previously I loaded maps like this:
the .cfg it was reading from:
I was obviously using | to split data.
Now.. I want to use multiple splits.
And read them like this:
Is this even possible?
Now I have an another problem..
Previously I loaded maps like this:
Код:
stock LoadObjects() { new dinfo[15][128]; new string[256]; new File:file = fopen("objects22.cfg", io_read); if(file) { new idx = 1; while(idx < MAX_OBJ) { fread(file, string); split(string, dinfo, '|'); ObjInfo[idx][oModel] = strval(dinfo[0]); ObjInfo[idx][oX] = floatstr(dinfo[1]); ObjInfo[idx][oY] = floatstr(dinfo[2]); ObjInfo[idx][oZ] = floatstr(dinfo[3]); ObjInfo[idx][oRX] = floatstr(dinfo[4]); ObjInfo[idx][oRY] = floatstr(dinfo[5]); ObjInfo[idx][oRZ] = floatstr(dinfo[6]); if(ObjInfo[idx][oModel]) // If gate exists { ObjInfo[idx][obj] = CreateDynamicObject(ObjInfo[idx][oModel], ObjInfo[idx][oX], ObjInfo[idx][oY], ObjInfo[idx][oZ], ObjInfo[idx][oRX], ObjInfo[idx][oRY], ObjInfo[idx][oRZ]); format(string, sizeof(string), "Object ID: %d (Model ID: %d)", idx, ObjInfo[idx][oModel]); ObjInfo[idx][oText] = CreateDynamic3DTextLabel(string, COLOR_GREY, ObjInfo[idx][oX], ObjInfo[idx][oY], ObjInfo[idx][oZ], 10); } idx++; } } print("Objects loaded successfully."); return 1; }
Код:
0|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000 0|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000 0|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000 0|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000 0|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000 0|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000 0|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000
Now.. I want to use multiple splits.
And read them like this:
Код:
CreateDynamicObject(0,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000); CreateDynamicObject(0,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000); CreateDynamicObject(0,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000); CreateDynamicObject(0,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000); CreateDynamicObject(0,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000); CreateDynamicObject(0,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000); CreateDynamicObject(0,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000); CreateDynamicObject(0,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000); CreateDynamicObject(0,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000); CreateDynamicObject(0,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000); CreateDynamicObject(0,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000); CreateDynamicObject(0,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000); CreateDynamicObject(0,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000); CreateDynamicObject(0,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000); CreateDynamicObject(0,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000); CreateDynamicObject(0,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000); CreateDynamicObject(0,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000); CreateDynamicObject(0,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000); CreateDynamicObject(0,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000);