[Help] Y_INI + Y_INLINE problem at loading single string.
#4

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 код:
public OnPlayerConnect(playerid)
{
    new 
name[MAX_PLAYER_NAME+1], str[126];
    
GetPlayerName(playeridnamesizeof(name));
    
    
inline SingleString(string:name[], string:value[])
    {
        
INI_String("pName"str126);
    }
    
INI_ParseFile(name"SingleString");
    return 
true;

That would be the correct code but you should bear in mind that you are loading the value of "pname" in a local string, to return to use it would have to reload it, apart from the file should be as follows: "server/scriptfiles/%s.ini"

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 код:
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(playeridnamesizeof(name));
    
format(stringsizeof(string), "/Folder/%s.ini"name);
    return 
string;

Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)