{
new str[126],name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,sizeof(name)); // I changed this with ( ) . I dont know if that is mistake but you miss it. inline SingleString(string:name[], string:value[]) { INI_String("pName",str,126); } INI_ParseFile(name,using inline "SingleString"); printf(str); return 1; } |
public OnPlayerConnect(playerid)
{
new name[MAX_PLAYER_NAME+1], str[126];
GetPlayerName(playerid, name, sizeof(name));
inline SingleString(string:name[], string:value[])
{
INI_String("pName", str, 126);
}
INI_ParseFile(name, "SingleString");
return true;
}
public OnPlayerConnect(playerid)
{
inline loaddatauser(string:name[], string:value[])
{
INI_String("", var, size);
// more data players..
}
INI_ParseFile(FolderRuta(playerid), "loaddatauser");
return true;
}
FolderRuta(playerid)
{
new string[39], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "/Folder/%s.ini", name);
return string;
}
INI_ParseFile takes a string format, not a function directly, so you don't need the "using inline" part in this case. Also, currently your code entirely ignores tags, so they will ALL be loaded by that one function.
|
You should first make sure you know what you want to upload, the code that you left off is good, the only error is what said Y_lees.
PHP код:
I don't know what makes your code in reality, I believe that loads the name for the route and reload in a variable. This would be a code more comfortable. PHP код:
|
I didnt actually get what you tryed to say in here.
Why my code ignoring tags? ![]() ive tryed that, the verb still not getting formated by the file. ![]() ![]() |
#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;
}