yini - value used in loadin
#1

Hello comrades,

I am using y_ini for a few days now, and I can't kind of get to the bottom of this issue...

This code works PERFECTLY:

PHP код:
forward LoadHouse_data(houseIDname[], value[]);
public 
LoadHouse_data(houseIDname[], value[]){
    
//add
    
hINFO[houseID][hID]         =         houseID                                        ;
    
INI_Int        (    "INTERIOR"    ,         hINFO[houseID][hINTERIOR]                );
    
INI_Int        (    "SOLD"        ,         hINFO[houseID][hSOLD]                    );
    
INI_Int        (    "PRICE"        ,        hINFO[houseID][hPRICE]                    );
    
INI_Int     (    "GC"        ,          hINFO[houseID][hGC]                     );
    
INI_Int     (   "SPAWN"     ,       hINFO[houseID][hSPAWN]                  );
    
INI_Float    (    "X"            ,          hINFO[houseID][hX]                        );
    
INI_Float    (    "Y"            ,          hINFO[houseID][hY]                        );
    
INI_Float    (    "Z"            ,        hINFO[houseID][hZ]                        );
    
INI_String    (    "OWNER"        ,         hINFO[houseID][hOWNER]        ,     24        );
    new 
lstr[12];
    for(new 
g=0;g<hINFO[houseID][hGC];g++){
        
format(lstrsizeof(lstr), "GARAGE%d"g);
        
INI_Int(lstrhGARAGE[houseID][g]);
    }
    return 
1;

On the other hand this code DOESN'T WORK:

PHP код:
forward LoadGarage_data(garageIDname[], value[]);
public 
LoadGarage_data(garageIDname[], value[]){
    
//add
    
gINFO[garageID][gID]         =         garageID                                    ;
    
INI_Int        (    "PARKS"        ,         gINFO[garageID][gPARKS]                    );
    
INI_Int        (    "TYPE"        ,         gINFO[garageID][gTYPE]                    );
    
INI_String    (    "UP"        ,         gINFO[garageID][gUP]        ,    24        );
    
INI_String    (    "OWNER"        ,         gINFO[garageID][gOWNER]        ,     24        );
    
INI_Int        (    "HOUSE"        ,         gINFO[garageID][gHOUSE]                    );
    
INI_Int        (    "PRICE"        ,         gINFO[garageID][gPRICE]                    );
    
INI_Int        (    "SOLD"        ,         gINFO[garageID][gSOLD]                    );
    
INI_Float    (    "X"            ,          gINFO[garageID][gX]                        );
    
INI_Float    (    "Y"            ,          gINFO[garageID][gY]                        );
    
INI_Float    (    "Z"            ,        gINFO[garageID][gZ]                        );
    new 
lstr[12];
    for(new 
p=0;p<gINFO[garageID][gPARKS];p++){
        
printf("VEH%d = %d"pgVEH[garageID][p]);
        
format(lstrsizeof(lstr), "VEH%d"p);
         
INI_Int(lstrgVEH[garageID][p]);
    }
    
    return 
1;

Now...

the problem comes, when it should be ready in the loop. In first code it works, in second it doesn't... so, my question out of all this is ... "Is it possible, that y_ini is not that fast, that it could reach the variable " gINFO[garageID][gPARKS];" in time, so it could be used in the loop?" (the rest of the second code works fine, btw)

Thank you all, RJ.
Reply


Messages In This Thread
yini - value used in loadin - by TheRohlikar - 15.10.2018, 12:33
Re: yini - value used in loadin - by TheRohlikar - 15.10.2018, 14:14

Forum Jump:


Users browsing this thread: 1 Guest(s)