14.05.2014, 13:13
Код:
enum PlayerInfo
{
playername[24]//user's name
}
Код:
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
pInfo[playerid][playername] = pname;
Код:
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid,PlayerName,sizeof(PlayerName));
new INI:file = INI_Open(Path(playerid)); // we will open a new file for them to save their account inside of Scriptfiles/Users folder
INI_SetTag(file,"Players_Data");
INI_WriteString(file,"Name",PlayerName);
Код:
if(playerloggedin[playerid] == 1)
{
if(fexist(Path(playerid)))
{// then
new INI:file = INI_Open(Path(playerid)); //will open their file
INI_SetTag(file,"Players_Data");//We will set a tag inside of user's account called "Players_Data"
INI_WriteInt(file,"Name",pInfo[playerid][playername]);
}
}
Код:
forward loadaccount_Players_Data(playerid, name[], value[]);
public loadaccount_Players_Data(playerid, name[], value[])
{
INI_String("Name", pInfo[playerid][playername], 24);
return 0;
}


