Load a specific file [y_ini]. - 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: Load a specific file [y_ini]. (
/showthread.php?tid=545765)
Load a specific file [y_ini]. -
Banditukas - 10.11.2014
Hi,
I want to load a specific number from database:
I have a file like:
Код:
0.ini
1.ini
2.ini
3.ini
4.ini
5.ini
6.ini
And there is many, but how to load a specific file, when i want to load
format( STRING, 20,"wac/%d.ini", MYVARIABLE[ playerid ] );
INI_Load(STRING);
Код:
INI:whatineedwritehere?[](name[], value[])
{
}
Re: Load a specific file [y_ini]. -
Private200 - 10.11.2014
If I'm not wrong, INI loads these variables into an enum (which we use as "PlayerInfo[playerid][pEnum]"). When you want to load from someone's file, you just have to use PlayerInfo[playerid][pEnum], and it is going to use that variable.
Note, you have to replace pEnum with your own variable.
Re: Load a specific file [y_ini]. -
Banditukas - 10.11.2014
No.. I ask how i need to know what file loading and i can get a what i need...
Re: Load a specific file [y_ini]. -
Banditukas - 10.11.2014
Because i'am what to check if file exist instantly load because i want to write everything to one string.
Код:
new BIGMIAU[ 2000 ];
new i = 0;
for( i = 0; i < MAX_PLAYERS; i ++)
{
if( IsPlayerConnected( i ) )
{
format( String[ playerid ], 30,"offers/%d.ini", MIAU[ playerid ] );
if(fexist(String[ playerid ]))
{
// HERE I NEED TO A LOAD WHAT IS IN offers/%d.ini FILE
// BECAUSE
format( BIGMIAU, 1999,"%s%d. %s %s .. other parametres", BIGMIAU, MIAU[ playerid ], ... );
}
MIAU[ playerid ] ++;
}
}
ShowPlayerDialog(playerid,,, BIGMIAU );