02.04.2015, 15:14
I believe it would be better if explain more what you are trying to make, this is quite easy to make but you do not understand much or i understand what you are trying to make you, there a explanation with another code.
PHP код:
#include <a_samp>
#include <YSI\y_ini>
#include <YSI\y_inline>
public OnPlayerConnect(playerid)
{
new string[126], Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
if(fexist(Name)) // if exist file with your name in script files load {""}
{
inline LoadString(string:name[], string:value[]) // load ini
{
INI_String("pName", string, 126); // load text from line name "pname" in string name "string".
}
INI_ParseFile(Name, "LoadString"); // take effect the above with this,
printf("String loaded: %s", string); // prinf with text loaded
}
else if(!fexist(Name)) // if not exist file in scriptfiles
{
new INI:File = INI_Open(Name); // new ini file with name(Name)
INI_SetTag(File, "Example"); // tag for load ini affter
INI_WriteString(File, "pName", "Hello this is INI"); // write line pname whith text hello this..
INI_Close(File); // ini close file.
}
return true;
}