[HELP] Dynamic race loading Y_Ini
#1

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

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");
Reply
#2

anyone? thanks
Reply
#3

anyone? thanks
Reply
#4

Hello!

What is printing in the loop?
PHP код:
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 0cpsrc UtrkaInfo[utrkaBrojCP]+1cpsrc++)
    {
        
printf("cpsrc: %i - UltrkaInfo[utrkaBrojCP]: %i",cpsrc,UltrkaInfo[utrkaBrojCP]);
        
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"); 
Reply
#5

from first time when I load it prints all cps with float 0.0000 but when I load that race again then cps are fine loaded
Reply
#6

anyone? thanks
Reply


Forum Jump:


Users browsing this thread: