15.05.2014, 18:11
Hello Guyz ANy One Can Help To Save Score In SATDM ladmin i dont know how to save score pls help me any one?
enum PlayerStats
{
Score,
};
new P_Info[MAX_PLAYERS][PlayerStats];
public OnPlayerConnect(playerid)
{
P_Info[playerid][Score] = 0;
return 1;
}
public OnPlayerSpawn(playerid)
{
SetPlayerScore(playerid, P_Info[playerid][Score]);
return 1;
}
new INI:iFile = INI_Open(PlayerPath(playerid));
INI_SetTag(iFile,"data");
INI_WriteInt(iFile,"Score",0);
INI_Close(iFile);
SetPlayerScore(playerid,P_Info[playerid][Score]); //Loading player score
INI_Int("Score",P_Info[playerid][Score]);
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);
PlayerInfo[playerid][gang] = (dUserINT(PlayerName2(playerid)).("Gang")); |
dUserSetINT(PlayerName2(playerid)).("Gang",PlayerI nfo[playerid][gang]); |