INI_String.
#2

INI_String is a function of 'y_INI' which gets a string from a file. For example, if you want to get your password; you gotta do this:
pawn Код:
INI_String(Path, "Password", User[playerid][Password]);
A bit more elaborated:
pawn Код:
#define pPath "Users/%s.ini" //User path.

stock Path(playerid)
{
 new s[128], l[24];
 GetPlayerName(playerid, l, sizeof(l));
 format(s, sizeof(s), pPath, l);
 return s;
} //This functions returns the path with the name of the playerid.
forward LoadPlayer_Password(playerid, name[], value[]); //Forwarding to load the player password. playerid is the player's id, name the line to get, and  value is it's value.

public LoadPlayer_Password(playerid, name[], value)
{
 INI_String(Path(playerid), "Password", User[playerid][Pass]); //Gets the password from player's path and stores in the 'user[playerid][pass]' array.
 return 1;
}

//Execute this function in INI_Parse to perform.

public OnPlayerConnect(playerid)
{
 INI_ParseFile(Path(playerid), "LoadPlayer_Password", .bExtra = true, .extra = playerid);
 return 1;
}
Reply


Messages In This Thread
INI_String. - by Denying - 12.05.2013, 10:41
Re: INI_String. - by Lordzy - 12.05.2013, 11:10
Re: INI_String. - by Denying - 12.05.2013, 11:28
Re: INI_String. - by Lordzy - 12.05.2013, 11:34
Re: INI_String. - by Denying - 12.05.2013, 12:21
Re: INI_String. - by Lordzy - 12.05.2013, 13:04

Forum Jump:


Users browsing this thread: 1 Guest(s)