25.06.2012, 10:00
Why am I getting 2 tag mismatch warnings for this code? I need to save player score and cash but it saves as 0 In the file. The warnings are the lines SetPlayerScore(playerid, dini_Float(file, "score"));
GivePlayerMoney(playerid, dini_Float(file, "money")-GetPlayerMoney(playerid));
GivePlayerMoney(playerid, dini_Float(file, "money")-GetPlayerMoney(playerid));
Код:
public OnPlayerDisconnect(playerid, reason) { new file[128], pname[MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, sizeof(pname)); format(file, sizeof(file), "/StatSave/%s.ini", pname); new Float:money; GetPlayerMoney(playerid); dini_FloatSet(file,"money", money); new Float:score; GetPlayerScore(playerid); dini_FloatSet(file,"score", score); return 1; } public OnPlayerSpawn(playerid) { new file[128], pname[MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, sizeof(pname)); format(file, sizeof(file), "/StatSave/%s.ini", pname); if(dini_Exists(file)) { SetPlayerScore(playerid, dini_Float(file, "score")); GivePlayerMoney(playerid, dini_Float(file, "money")-GetPlayerMoney(playerid)); return 1; } return 1; }