SA-MP Forums Archive
Loading Issues - 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: Loading Issues - Y_INI (/showthread.php?tid=578374)



Loading Issues - Y_INI - shocktheripper - 19.06.2015

Can't figure out what I did wrong. Once I restart my server, no radio stations are loaded.

removed

Willing to give some rep points.


Re: Loading Issues - Y_INI - Kenway - 19.06.2015

The problem is with login..
Код:
LoadStatios()
{
    for(new idx; idx < sizeof(XMRInfo); idx++)
	{
    	new gFile[64];
     	format(gFile, sizeof(gFile), "Stations/%d.ini" ,idx);
     	if(fexist(gFile))
     	{
            INI_ParseFile(gFile, "OnLoadStation_%s", .bExtra = true, .extra = idx);
      	}
    }
    return 1;
}

forward OnLoadStation_id(idx,name[],value[]);
public OnLoadStation_id(idx,name[],value[])
{
       INI_String("XMName", XMRInfo[idx[XMName], MAX_PLAYER_NAME);
       INI_String("XMStation", XMRInfo[idx][XMStation], 96);
       return 1;
}
Do SetTag with "id' not "Station Data"



Re: Loading Issues - Y_INI - shocktheripper - 19.06.2015

Quote:
Originally Posted by Kenway
Посмотреть сообщение
The problem is with login..
Код:
LoadStatios()
{
    for(new idx; idx < sizeof(XMRInfo); idx++)
	{
    	new gFile[64];
     	format(gFile, sizeof(gFile), "Stations/%d.ini" ,idx);
     	if(fexist(gFile))
     	{
            INI_ParseFile(gFile, "OnLoadStation_%s", .bExtra = true, .extra = idx);
      	}
    }
    return 1;
}

forward OnLoadStation_id(idx,name[],value[]);
public OnLoadStation_id(idx,name[],value[])
{
       INI_String("XMName", XMRInfo[idx[XMName], MAX_PLAYER_NAME);
       INI_String("XMStation", XMRInfo[idx][XMStation], 96);
       return 1;
}
Do SetTag with "id' not "Station Data"
Login? What are you on about?


Re: Loading Issues - Y_INI - shocktheripper - 19.06.2015

I still need help!


Re: Loading Issues - Y_INI - Emmet_ - 19.06.2015

Change this:

pawn Код:
INI_ParseFile(StationPath(s), "LoadStationData", false, true, s, true, false);
To this:

pawn Код:
INI_ParseFile(file, "LoadVehicleData", .bExtra = true, .extra = s);
And then add this somewhere in your mode:

pawn Код:
forward LoadVehicleData(stationid, name[], value[]);
public LoadVehicleData(stationid, name[], value[])
{
    INI_String("XMName", XMRInfo[stationid][XMName], MAX_PLAYER_NAME);
    INI_String("XMStation", XMRInfo[stationid][XMStation], 96);
}
I don't really know how to use y_ini so it may or may not work.


Re: Loading Issues - Y_INI - shocktheripper - 20.06.2015

Quote:
Originally Posted by Emmet_
Посмотреть сообщение
Change this:

pawn Код:
INI_ParseFile(StationPath(s), "LoadStationData", false, true, s, true, false);
To this:

pawn Код:
INI_ParseFile(file, "LoadVehicleData", .bExtra = true, .extra = s);
And then add this somewhere in your mode:

pawn Код:
forward LoadVehicleData(stationid, name[], value[]);
public LoadVehicleData(stationid, name[], value[])
{
    INI_String("XMName", XMRInfo[stationid][XMName], MAX_PLAYER_NAME);
    INI_String("XMStation", XMRInfo[stationid][XMStation], 96);
}
I don't really know how to use y_ini so it may or may not work.
Works fine!