02.11.2015, 10:53
Hi, i creating one system, and there is next codes:
And it save all data. But when i start server, it wont load data... Why? Is this INI_Load good or better is INI_ParseFile??
PHP код:
public OnGameModeInit()
{
for(new org = 1; org < BR_ORGANIZACIJA; org++)
{
for(new slot = 1; slot < MAX_CLANOVAORG; slot++)
{
new gFile[45];
format(gFile, sizeof(gFile),"Clanovi/Organizacija_%d/Clan_%d.ini",org, slot);
if(fexist(gFile))
{
INI_Load(gFile);
printf("Y_INI | Clan %d organizacije %d ucitan!", slot, org);
}
}
}
PHP код:
forward UcitajClana(org,id, name[], value[]);
public UcitajClana(org,id, name[], value[])
{
INI_String("Ime",ORG_Clanovi[org][id][orgIme],MAX_PLAYER_NAME);
INI_Int("UsaoDan",ORG_Clanovi[org][id][orgDan]);
INI_Int("UsaoMesec",ORG_Clanovi[org][id][orgMesec]);
return 1;
}
FUNCTION: SacuvajClana(org,id)
{
new dFile[45];
format(dFile, sizeof(dFile),"Clanovi/Organizacija_%d/Clan_%d.ini",org, id);
if(fexist(dFile))
{
new INI:File = INI_Open(dFile);
INI_WriteString(File,"Ime",ORG_Clanovi[org][id][orgIme]);
INI_WriteInt(File,"UsaoDan",ORG_Clanovi[org][id][orgDan]);
INI_WriteInt(File,"UsaoMesec",ORG_Clanovi[org][id][orgMesec]);
INI_Close(File);
}
return 1;
}