yini - value used in loadin - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: yini - value used in loadin (
/showthread.php?tid=659762)
yini - value used in loadin -
TheRohlikar - 15.10.2018
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(houseID, name[], value[]);
public LoadHouse_data(houseID, name[], 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(lstr, sizeof(lstr), "GARAGE%d", g);
INI_Int(lstr, hGARAGE[houseID][g]);
}
return 1;
}
On the other hand this code
DOESN'T WORK:
PHP код:
forward LoadGarage_data(garageID, name[], value[]);
public LoadGarage_data(garageID, name[], 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", p, gVEH[garageID][p]);
format(lstr, sizeof(lstr), "VEH%d", p);
INI_Int(lstr, gVEH[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.
Re: yini - value used in loadin -
TheRohlikar - 15.10.2018
Yeah, I made another Load just for "gVEH".
thanks, lock.