15.05.2014, 19:50
pawn Код:
enum PlayerStats
{
Score,
};
new P_Info[MAX_PLAYERS][PlayerStats];
pawn Код:
public OnPlayerConnect(playerid)
{
P_Info[playerid][Score] = 0;
return 1;
}
pawn Код:
public OnPlayerSpawn(playerid)
{
SetPlayerScore(playerid, P_Info[playerid][Score]);
return 1;
}
Under dialogid == DIALOG_REGISTER // Or what ever your Dialog name is called;
pawn Код:
new INI:iFile = INI_Open(PlayerPath(playerid));
INI_SetTag(iFile,"data");
INI_WriteInt(iFile,"Score",0);
INI_Close(iFile);
pawn Код:
SetPlayerScore(playerid,P_Info[playerid][Score]); //Loading player score
pawn Код:
INI_Int("Score",P_Info[playerid][Score]);
pawn Код:
P_Info[playerid][Score] = GetPlayerScore(playerid);
new INI:file = INI_Open(PlayerPath(playerid));
INI_SetTag(file,"data");
INI_WriteInt(file,"Score",P_Info[playerid][Score]);
INI_Close(file);