Otiy Posted January 13, 2012 Posted January 13, 2012 Cum fac ca sa pun id la masinile pers? Adica sa fie dupa id-ul 293 cum fac?
Mr.Big Posted January 13, 2012 Posted January 13, 2012 La OnGameModeInit ai niste masini acolo , numarale , si le pui sub sau unde vrei tu ...
Mr.Big Posted January 13, 2012 Posted January 13, 2012 Cauta OnPropUpdate si vezi daca ai ceva cu masini pe acolo si idx-ul retinel..
Otiy Posted January 13, 2012 Author Posted January 13, 2012 [pawn]public LoadCar(){ new arrCoords[13][64]; new strFromFile2[256]; new File: file = fopen("cars.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]); CarInfo[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]); strmid(CarInfo[idx][cLicense], arrCoords[10], 0, strlen(arrCoords[10]), 256); //strmid(CarInfo[idx][cLicense], arrCoords[10], 0, strlen(arrCoords[10]), 255); CarInfo[idx][cOwned] = strval(arrCoords[11]); CarInfo[idx][cLock] = strval(arrCoords[12]); printf("CarInfo: %d Owner:%s LicensePlate %s",idx,CarInfo[idx][cOwner],CarInfo[idx][cLicense]); idx++; } } return 1;}public SaveCarCoords(){ new idx = 184; new File: file2; while (idx < sizeof(CarInfo)) { new coordsstring[256]; format(coordsstring, sizeof(coordsstring), "%d|%f|%f|%f|%f|%d|%d|%s\n", CarInfo[idx][cModel], CarInfo[idx][cLocationx], CarInfo[idx][cLocationy], CarInfo[idx][cLocationz], CarInfo[idx][cAngle], CarInfo[idx][cColorOne], CarInfo[idx][cColorTwo]); if(idx == 0) { file2 = fopen("cars.cfg", io_write); } else { file2 = fopen("cars.cfg", io_append); } fwrite(file2, coordsstring); idx++; fclose(file2); } return 1;}[/pawn]uite ce fac vreau sa adaug si fisieru carss.cfg
IcE. Posted January 13, 2012 Posted January 13, 2012 [pawn]for(new h = 271; h < sizeof(CarInfo); h++)//inlocuie 271 cu ce id vrei tu{ AddStaticVehicleEx(CarInfo[h][cModel],CarInfo[h][cLocationx],CarInfo[h][cLocationy],CarInfo[h][cLocationz]+1.0,CarInfo[h][cAngle],CarInfo[h][cColorOne],CarInfo[h][cColorTwo],60000); LoadTuningCar(h);}[/pawn] Stiu si eu ... branza e pe bani, dar eu tot ma joc pe gratis!
Mr.Big Posted January 13, 2012 Posted January 13, 2012 In cazul tau ,[pawn] for(new h = 184; h < sizeof(CarInfo); h++){ AddStaticVehicleEx(CarInfo[h][cModel],CarInfo[h][cLocationx],CarInfo[h][cLocationy],CarInfo[h][cLocationz]+1.0,CarInfo[h][cAngle],CarInfo[h][cColorOne],CarInfo[h][cColorTwo],60000);}[/pawn]Pune asta sub toate masinile din gm-ul tau , dar ar fi bine sa le numeri , uitate la ongamemodeinitSper ca ti-am fost de ajutor
Otiy Posted January 14, 2012 Author Posted January 14, 2012 da dar eu vreau sa adaug si masinile din carss.cfg cum fac?
IcE. Posted January 14, 2012 Posted January 14, 2012 da dar eu vreau sa adaug si masinile din carss.cfg cum fac?Cu grija. Noi te-am raspuns la prima intrebare. Stiu si eu ... branza e pe bani, dar eu tot ma joc pe gratis!
Otiy Posted January 14, 2012 Author Posted January 14, 2012 da dar daca pun [pawn]public LoadCar(){ new arrCoords[13][64]; new strFromFile2[256]; new File: file = fopen("carss.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]); CarInfo[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]); strmid(CarInfo[idx][cLicense], arrCoords[10], 0, strlen(arrCoords[10]), 256); //strmid(CarInfo[idx][cLicense], arrCoords[10], 0, strlen(arrCoords[10]), 255); CarInfo[idx][cOwned] = strval(arrCoords[11]); CarInfo[idx][cLock] = strval(arrCoords[12]); printf("CarInfo: %d Owner:%s LicensePlate %s",idx,CarInfo[idx][cOwner],CarInfo[idx][cLicense]); idx++; } } return 1;}public SaveCarCoords(){ new idx = 184; new File: file2; while (idx < sizeof(CarInfo)) { new coordsstring[256]; format(coordsstring, sizeof(coordsstring), "%d|%f|%f|%f|%f|%d|%d|%s\n", CarInfo[idx][cModel], CarInfo[idx][cLocationx], CarInfo[idx][cLocationy], CarInfo[idx][cLocationz], CarInfo[idx][cAngle], CarInfo[idx][cColorOne], CarInfo[idx][cColorTwo]); if(idx == 0) { file2 = fopen("carss.cfg", io_write); } else { file2 = fopen("carss.cfg", io_append); } fwrite(file2, coordsstring); idx++; fclose(file2); } return 1;}[/pawn]imi da eroare
Question
Otiy
Cum fac ca sa pun id la masinile pers? Adica sa fie dupa id-ul 293 cum fac?
9 answers to this question
Recommended Posts