public LoadCar(){new arrCoords[15][64];new strFromFile2[256];new File: file = fopen(\"cfg-k/kocsik.cfg\", io_read);if (file){new idx = 184;while (idx < sizeof(CarInfo)){ fread(file, strFromFile2); split(strFromFile2, arrCoords, \',\'); CarInfo[idx][cModel] = strval(arrCoords[0]); CarInfo[idx][cLocationx] = floatstr(arrCoords[1]); CarInfo[idx][cLocationy] = floatstr(arrCoords[2]); CarInfo[idx][cLocationz] = floatstr(arrCoords[3]); CarInfo[idx][cAngle] = floatstr(arrCoords[4]); CarInfo[idx][cColorOne] = strval(arrCoords[5]); cCarInfo[idx][cColorTwo] = strval(arrCoords[6]); strmid(CarInfo[idx][cOwner], arrCoords[7], 0, strlen(arrCoords[7]), 255); strmid(CarInfo[idx][cDescription], arrCoords[8], 0, strlen(arrCoords[8]), 255); CarInfo[idx][cValue] = strval(arrCoords[9]); CarInfo[idx][cLicense] = strval(arrCoords[10]); CarInfo[idx][cOwned] = strval(arrCoords[11]); CarInfo[idx][cLock] = strval(arrCoords[12]); strmid(CarInfo[idx][cRendszam], arrCoords[13], 0, strlen(arrCoords[13]), 255); CarInfo[idx][cRendszamVane] = strval(arrCoords[14]); printf(\"JarmuID: %d Tulaj: %s Rendszam: %s\",idx,CarInfo[idx][cOwner],CarInfo[idx][cRendszam]); idx++;}}return 1;}
XDDD házi használatra kell:D LAN-ban akarok adminkodni, ilyenek:D
public LoadCar(){new arrCoords[15][64];new strFromFile2[256];new File: file = fopen(\"cfg-k/kocsik.cfg\", io_read);if (file){new idx = 184;while (idx < sizeof(CarInfo)){ fread(file, strFromFile2); split(strFromFile2, arrCoords, ',\'); CarInfo[idx][cModel] = strval(arrCoords[0]); CarInfo[idx][cLocationx] = floatstr(arrCoords[1]); CarInfo[idx][cLocationy] = floatstr(arrCoords[2]); CarInfo[idx][cLocationz] = floatstr(arrCoords[3]); CarInfo[idx][cAngle] = floatstr(arrCoords[4]); CarInfo[idx][cColorOne] = strval(arrCoords[5]); cCarInfo[idx][cColorTwo] = strval(arrCoords[6]); strmid(CarInfo[idx][cOwner], arrCoords[7], 0, strlen(arrCoords[7]), 255); strmid(CarInfo[idx][cDescription], arrCoords[8], 0, strlen(arrCoords[8]), 255); CarInfo[idx][cValue] = strval(arrCoords[9]); CarInfo[idx][cLicense] = strval(arrCoords[10]); CarInfo[idx][cOwned] = strval(arrCoords[11]); CarInfo[idx][cLock] = strval(arrCoords[12]); strmid(CarInfo[idx][cRendszam], arrCoords[13], 0, strlen(arrCoords[13]), 255); CarInfo[idx][cRendszamVane] = strval(arrCoords[14]); printf(\"JarmuID: %d Tulaj: %s Rendszam: %s\",idx,CarInfo[idx][cOwner],CarInfo[idx][cRendszam]); // Itt a lényeg CreateVehicle(CarInfo[idx][cModel], CarInfo[idx][cLocationx], CarInfo[idx][cLocationy], CarInfo[idx][cLocationz], CarInfo[idx][cAngle], CarInfo[idx][cColorOne], CarInfo[idx][cColorTwo], -1); SetVehicleNumberPlate(idx, CarInfo[idx][cRendszam]); SetVehicleToRespawn(idx); idx++;}}return 1;}