29.12.2009, 21:46
hi i have a problem,
i have a script and it loads random race from a file.
but it doesnt work. in the server window it doesnt show "Race: Testrace", it show: "Race:"
for test, i wrote "race.txt" in scriptfiles, but doesnt work too.
Please help..
i have a script and it loads random race from a file.
but it doesnt work. in the server window it doesnt show "Race: Testrace", it show: "Race:"
for test, i wrote "race.txt" in scriptfiles, but doesnt work too.
Please help..
pawn Код:
forward RaceLoad();
public RaceLoad()
{
new var[32];
new File: file = fopen("race.txt", io_read);
if(file)
{
format(var, 32, "%f", RaceInfo[rCP1][0]);fread(file, var);
format(var, 32, "%f", RaceInfo[rCP1][1]);fread(file, var);
format(var, 32, "%f", RaceInfo[rCP1][2]);fread(file, var);
format(var, 32, "%f", RaceInfo[rCP2][0]);fread(file, var);
format(var, 32, "%f", RaceInfo[rCP2][1]);fread(file, var);
format(var, 32, "%f", RaceInfo[rCP2][2]);fread(file, var);
format(var, 32, "%f", RaceInfo[rCP3][0]);fread(file, var);
format(var, 32, "%f", RaceInfo[rCP3][1]);fread(file, var);
format(var, 32, "%f", RaceInfo[rCP3][2]);fread(file, var);
format(var, 32, "%f", RaceInfo[rCP4][0]);fread(file, var);
format(var, 32, "%f", RaceInfo[rCP4][1]);fread(file, var);
format(var, 32, "%f", RaceInfo[rCP4][2]);fread(file, var);
format(var, 32, "%f", RaceInfo[rCP5][0]);fread(file, var);
format(var, 32, "%f", RaceInfo[rCP5][1]);fread(file, var);
format(var, 32, "%f", RaceInfo[rCP5][2]);fread(file, var);
format(var, 32, "%f", RaceInfo[rCP6][0]);fread(file, var);
format(var, 32, "%f", RaceInfo[rCP6][1]);fread(file, var);
format(var, 32, "%f", RaceInfo[rCP6][2]);fread(file, var);
format(var, 32, "%f", RaceInfo[rCP7][0]);fread(file, var);
format(var, 32, "%f", RaceInfo[rCP7][1]);fread(file, var);
format(var, 32, "%f", RaceInfo[rCP7][2]);fread(file, var);
format(var, 32, "%f", RaceInfo[rCP8][0]);fread(file, var);
format(var, 32, "%f", RaceInfo[rCP8][1]);fread(file, var);
format(var, 32, "%f", RaceInfo[rCP8][2]);fread(file, var);
format(var, 32, "%f", RaceInfo[rCP9][0]);fread(file, var);
format(var, 32, "%f", RaceInfo[rCP9][1]);fread(file, var);
format(var, 32, "%f", RaceInfo[rCP9][2]);fread(file, var);
format(var, 32, "%f", RaceInfo[rCP10][0]);fread(file, var);
format(var, 32, "%f", RaceInfo[rCP10][1]);fread(file, var);
format(var, 32, "%f", RaceInfo[rCP10][2]);fread(file, var);
format(var, 32, "%f", RaceInfo[rCP11][0]);fread(file, var);
format(var, 32, "%f", RaceInfo[rCP11][1]);fread(file, var);
format(var, 32, "%f", RaceInfo[rCP11][2]);fread(file, var);
format(var, 32, "%s", RaceInfo[rRekordName]);fread(file, var);
format(var, 32, "%s", RaceInfo[rName]);fread(file, var);
format(var, 32, "%d", RaceInfo[rBestms]);fread(file, var);
fclose(file);
}
printf("Race: %s",RaceInfo[rName]);
return 1;
}