29.04.2015, 18:53
Hello. So I post this but please if someone with better pawn knowledge can reply. Thanks.
So I have dynamic race loading event written in Y_Ini and the problem is when I load some race from first time all cps are 0.0000 but when I load the race again from second time then all cps are fine.
Here's the code
So I have dynamic race loading event written in Y_Ini and the problem is when I load some race from first time all cps are 0.0000 but when I load the race again from second time then all cps are fine.
Here's the code
pawn Код:
inline loadracedata(string:name[],string:value[])
{
new scps[64];
INI_String("ImeUtrke",UtrkaInfo[utrkaNaziv],128);
INI_Int("BrojCP",UtrkaInfo[utrkaBrojCP]);
INI_String("Rekorder",UtrkaInfo[utrkaRekorder],128);
INI_Int("RekordMinuti",UtrkaInfo[utrkaRekordMinuti]);
INI_Int("RekordSekunde",UtrkaInfo[utrkaRekordSekunde]);
INI_Int("Krugova",UtrkaInfo[utrkaKrugova]);
INI_Int("Vozila",UtrkaInfo[utrkaVozila]);
INI_Int("Zadnji_CP",UtrkaInfo[utrkaZadnjiCP]);
INI_Float("CP_Radius",UtrkaInfo[CPRadius]);
for(new cpsrc = 0; cpsrc < UtrkaInfo[utrkaBrojCP]+1; cpsrc++)
{
format(scps,sizeof(scps),"CP_%d_PosX",cpsrc);
INI_Float(scps,CPInfo[cpsrc][cpX]);
printf("CPX = %.4f",CPInfo[cpsrc][cpX]);
format(scps,sizeof(scps),"CP_%d_PosY",cpsrc);
INI_Float(scps,CPInfo[cpsrc][cpY]);
printf("CPX = %.4f",CPInfo[cpsrc][cpY]);
format(scps,sizeof(scps),"CP_%d_PosZ",cpsrc);
INI_Float(scps,CPInfo[cpsrc][cpZ]);
printf("CPX = %.4f",CPInfo[cpsrc][cpZ]);
format(scps,sizeof(scps),"CP_%d_Prolaz",cpsrc);
INI_Int(scps,CPInfo[cpsrc][utrkaProlaz]);
format(scps,sizeof(scps),"CP_%d_Krug",cpsrc);
INI_Int(scps,CPInfo[cpsrc][utrkaKrug]);
}
}
INI_ParseFile(FolderRaces(utrkafile),"loadracedata");