21.02.2009, 23:17
hey guys^^
i want to load my races in lines
example: 343.4324,4353.2345,2342.4234
345.3244,2131.5435,43565.213
.
.
.
But i dunno how to do that =/
heres the loadcode:
its veryy important for me so plz help =/
cheerz
i want to load my races in lines
example: 343.4324,4353.2345,2342.4234
345.3244,2131.5435,43565.213
.
.
.
But i dunno how to do that =/
heres the loadcode:
Код:
public LoadRace(playerid,name[]) { new arrCoords[37][64]; new racename[64]; new strFromFile2[512]; new strFromFile3[512]; strmid(CurrentRace, name, 0, strlen(name), 255); format(racename, sizeof(racename), "Rennen/%s.race",name); new File: file = fopen(racename, io_read); if (file) { fread(file, strFromFile2); split(strFromFile2, arrCoords, ','); RaceInfo[r1][0] = floatstr(arrCoords[0]); RaceInfo[r1][1] = floatstr(arrCoords[1]); RaceInfo[r1][2] = floatstr(arrCoords[2]); RaceInfo[r2][0] = floatstr(arrCoords[3]); RaceInfo[r2][1] = floatstr(arrCoords[4]); RaceInfo[r2][2] = floatstr(arrCoords[5]); RaceInfo[r3][0] = floatstr(arrCoords[6]); RaceInfo[r3][1] = floatstr(arrCoords[7]); RaceInfo[r3][2] = floatstr(arrCoords[8]); RaceInfo[r4][0] = floatstr(arrCoords[9]); RaceInfo[r4][1] = floatstr(arrCoords[10]); RaceInfo[r4][2] = floatstr(arrCoords[11]); RaceInfo[r5][0] = floatstr(arrCoords[12]); RaceInfo[r5][1] = floatstr(arrCoords[13]); RaceInfo[r5][2] = floatstr(arrCoords[14]); RaceInfo[r6][0] = floatstr(arrCoords[15]); RaceInfo[r6][1] = floatstr(arrCoords[16]); RaceInfo[r6][2] = floatstr(arrCoords[17]); RaceInfo[r7][0] = floatstr(arrCoords[18]); RaceInfo[r7][1] = floatstr(arrCoords[19]); RaceInfo[r7][2] = floatstr(arrCoords[20]); RaceInfo[r8][0] = floatstr(arrCoords[21]); RaceInfo[r8][1] = floatstr(arrCoords[22]); RaceInfo[r8][2] = floatstr(arrCoords[23]); RaceInfo[r9][0] = floatstr(arrCoords[24]); RaceInfo[r9][1] = floatstr(arrCoords[25]); RaceInfo[r9][2] = floatstr(arrCoords[26]); RaceInfo[r10][0] = floatstr(arrCoords[27]); RaceInfo[r10][1] = floatstr(arrCoords[28]); RaceInfo[r10][2] = floatstr(arrCoords[29]); RaceInfo[r11][0] = floatstr(arrCoords[30]); RaceInfo[r11][1] = floatstr(arrCoords[31]); RaceInfo[r11][2] = floatstr(arrCoords[32]); strmid(RaceInfo[rName], arrCoords[33], 0, strlen(arrCoords[33]), 255); RaceInfo[rAngle] = floatstr(arrCoords[34]); RaceInfo[rBestms] = strval(arrCoords[35]); RaceInfo[rLaps] = strval(arrCoords[36]); fclose(file); format(strFromFile2, 512, "%s Rennen geladen!", name); format(strFromFile3, 512, "%s Race loaded!", name); ConvertTicks(RaceInfo[rBestms]); format(strFromFile2, 512, "RENNINFO: Rennen '%s' gestartet! (Highscore: %s | Zeit: %d:%02d.%02d0)",name,RaceInfo[rName],cmins,csecs,cmils); // format(strFromFile3, 512, "RACENEWS: Race '%s' has started! (Highscore: %s | Time: %d:%02d.%02d0)",name,RaceInfo[rName],cmins,csecs,cmils); SendLanguageMessageToAll(ORANGE, strFromFile2,strFromFile3); } else { if(playerid != 255) { print("RENNEN: Datei nicht gefunden!"); } } return 1; }
cheerz