You start by adding variables you want to save in the enum:
Код:
enum pInfo
{
pPass,
pCash,
pAdmin,
pKills,
pDeaths,
pNextVariable,
pVariableForSavingFactionRank,
pVariableForSavingFactionEtc
}
Then you add to load them in the LoadUser_data function (more information about reading different TYPES can be read about here
https://sampforum.blast.hk/showthread.php?tid=570957):
Код:
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
INI_Int("Password",PlayerInfo[playerid][pPass]);
INI_Int("Cash",PlayerInfo[playerid][pCash]);
INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
INI_Int("Kills",PlayerInfo[playerid][pKills]);
INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
INI_Int("FactionRank",PlayerInfo[playerid][pVariableForSavingFactionRank]);
INI_Int("FactionEtc",PlayerInfo[playerid][pVariableForSavingFactionEtc]);
return 1;
}
When you want to write to those you simply do same as Step X/XI but you add your variables as well:
Код:
INI_WriteInt(File,"FactionRank",0); //or any other value instead of 0
INI_WriteInt(File,"FactionEtc",0); //or any other value instead of 0
When you don't want to save them in the file (at least not directly) but do want to save them in-game you simply just:
Код:
PlayerInfo[playerid][pVariableForSavingFactionEtc] = SOME_VARIABLE_ASSIGNED;
Obviously I didn't make everything complete, the whole faction system for instance will have to be implemented by you. Reading the y_ini thread will help a lot:
https://sampforum.blast.hk/showthread.php?tid=570957 or
https://sampforum.blast.hk/showthread.php?tid=570912