u19475
Дата: Понедельник, 27.06.2016, 12:46 | Сообщение # 1
Новичок
Сообщений: 1
Статус: Offline
Вообщем, я хотел сделать обновление авторынка, начал прописывать машины по шаблону: Свободна/Занята, Владелец, Модель, corX, corY, corZ, Angle, 1 цвет, 2 цвет, откр/закрыта, цена, parkX,parkY,parkZ, parkAngle Написал всё, пошёл чекать. Как только подойду - жуткие лаги, несколько машин в одной зареспавнилось. Жесть! Вот вся проблема: Появляется несколько машин в одной. В чём проблема может быть?
[PHP]0,-,401,-2693.3896,-55.8329,4.3359,355.3504,-1,-1,0,500000,0.000000,0.000000,0.000000,0.000000 0,-,401,-2687.3000,-55.1942,4.3359,358.2259,-1,-1,0,500000,0.000000,0.000000,0.000000,0.000000 0,-,567,-2680.1902,-54.9820,4.3359,358.1868,-1,-1,0,500000,0.000000,0.000000,0.000000,0.000000 0,-,567,-2674.0010,-54.8838,4.3359,358.5779,-1,-1,0,500000,0.000000,0.000000,0.000000,0.000000 0,-,566,-2667.0427,-54.8083,4.3359,308.3279,-1,-1,0,500000,0.000000,0.000000,0.000000,0.000000 0,-,566,-2660.6846,-55.0589,4.3388,359.6728,-1,-1,0,500000,0.000000,0.000000,0.000000,0.000000 0,-,565,-2654.0491,-54.8419,4.3359,359.6728,-1,-1,0,500000,0.000000,0.000000,0.000000,0.000000 0,-,565,-2647.1748,-54.7904,4.3359,359.6728,-1,-1,0,500000,0.000000,0.000000,0.000000,0.000000 0,-,575,-2640.8625,-54.4450,4.3359,302.6728,-1,-1,0,500000,0.000000,0.000000,0.000000,0.000000 0,-,575,-2633.8777,-54.5743,4.3359,0.6113,-1,-1,0,500000,0.000000,0.000000,0.000000,0.000000 0,-,576,-2627.3762,-54.3226,4.3359,359.0471,-1,-1,0,500000,0.000000,0.000000,0.000000,0.000000 0,-,576,-2620.9587,-54.0990,4.3359,357.9522,-1,-1,0,500000,0.000000,0.000000,0.000000,0.000000 0,-,401,-2663.0691,-34.6462,4.3359,179.3626,-1,-1,0,500000,0.000000,0.000000,0.000000,0.000000 0,-,401,-2665.9146,-34.9887,4.3359,179.9883,-1,-1,0,500000,0.000000,0.000000,0.000000,0.000000 0,-,589,-2669.2046,-35.2483,4.3359,177.4074,-1,-1,0,500000,0.000000,0.000000,0.000000,0.000000 0,-,589,-2672.3130,-35.3680,4.3359,177.8375,-1,-1,0,500000,0.000000,0.000000,0.000000,0.000000 0,-,405,-2624.0608,-34.7266,4.3359,181.7036,-1,-1,0,500000,0.000000,0.000000,0.000000,0.000000 0,-,405,-2627.0420,-34.9151,4.3359,178.2625,-1,-1,0,500000,0.000000,0.000000,0.000000,0.000000 0,-,445,-2630.1123,-34.8702,4.3359,181.5081,-1,-1,0,500000,0.000000,0.000000,0.000000,0.000000 0,-,445,-2633.0449,-34.8522,4.3359,179.8266,-1,-1,0,500000,0.000000,0.000000,0.000000,0.000000 0,-,535,-2686.3931,-21.5101,4.3359,177.5376,-1,-1,0,500000,0.000000,0.000000,0.000000,0.000000 0,-,536,-2683.4849,-21.8876,4.3359,179.6674,-1,-1,0,500000,0.000000,0.000000,0.000000,0.000000[/PHP]
Вот код самого сохр.
[PHP] idx = 0; while (idx < sizeof(CarsInfo)) { if(CarsInfo[idx][vPosX] == 0.0 && CarsInfo[idx][vPosY] == 0.0 && CarsInfo[idx][vPosZ] == 0.0 && CarsInfo[idx][vAngle] == 0.0) { idx++; continue; } new coordsstring[256]; format(coordsstring, sizeof(coordsstring), "%d,%s,%d,%f,%f,%f,%f,%d,%d,%d,%d,%f,%f,%f,%f\n", CarsInfo[idx][vOwned], CarsInfo[idx][vOwner], CarsInfo[idx][vModel], CarsInfo[idx][vPosX], CarsInfo[idx][vPosY], CarsInfo[idx][vPosZ], CarsInfo[idx][vAngle], CarsInfo[idx][vColorOne], CarsInfo[idx][vColorTwo], CarsInfo[idx][vLock], CarsInfo[idx][vValue], CarsInfo[idx][vParkX], CarsInfo[idx][vParkY], CarsInfo[idx][vParkZ], CarsInfo[idx][vParkAngle]); if(idx == 0) { file2 = fopen("Backup/cars.cfg", io_write); } else { file2 = fopen("Backup/cars.cfg", io_append); } fwrite(file2, coordsstring); idx++; fclose(file2); } return 1; }[/PHP]
[PHP]public LoadBuyableCars() { new arrCoords[15][64]; new strFromFile2[256]; new File: file = fopen("Bochka/cars.cfg", io_read); if (file) { new idx; while (idx < sizeof(CarsInfo)) { fread(file, strFromFile2); split(strFromFile2, arrCoords, ','); CarsInfo[idx][vOwned] = strval(arrCoords[0]); strmid(CarsInfo[idx][vOwner], arrCoords[1], 0, strlen(arrCoords[1]), 255); CarsInfo[idx][vModel] = strval(arrCoords[2]); CarsInfo[idx][vPosX] = floatstr(arrCoords[3]); CarsInfo[idx][vPosY] = floatstr(arrCoords[4]); CarsInfo[idx][vPosZ] = floatstr(arrCoords[5]); CarsInfo[idx][vAngle] = floatstr(arrCoords[6]); CarsInfo[idx][vColorOne] = strval(arrCoords[7]); CarsInfo[idx][vColorTwo] = strval(arrCoords[8]); CarsInfo[idx][vLock] = strval(arrCoords[9]); CarsInfo[idx][vValue] = strval(arrCoords[10]); CarsInfo[idx][vParkX] = floatstr(arrCoords[11]); CarsInfo[idx][vParkY] = floatstr(arrCoords[12]); CarsInfo[idx][vParkZ] = floatstr(arrCoords[13]); CarsInfo[idx][vParkAngle] = floatstr(arrCoords[14]); printf("Машина: [%d] | Модель: [%d] | Стоимость: [$%d] | Владелец: [%s]", idx, CarsInfo[idx][vModel], CarsInfo[idx][vValue], CarsInfo[idx][vOwner]); idx++; } fclose(file); } return 1; }[/PHP]
А нет, это просто последняя машина спавниться миллион раз и записывается в файле Я пытался уже и с CreateVehicle и с AddStaticVehicle(Ex) и ничего! TD некоторые не погружаются, Mode Unknown иногда. Машин вообще нет!