24.09.2010, 16:01
i have this code that when they disconnect it saves theyr score in a .txt file
but when they connect it should be theyr score = txt file but it remaains 0 but in scriptfiles... they score is has the last time they disconnected help
help plz
but when they connect it should be theyr score = txt file but it remaains 0 but in scriptfiles... they score is has the last time they disconnected help
Код:
public OnPlayerConnect(playerid)
{
new file[1];
new name[MAX_PLAYER_NAME];
format(file, sizeof(file), "mygamemode/users/%s.txt", name);
SetPlayerScore(playerid, dini_Int(file, "Score"));
return 1;
}
Код:
public OnPlayerDisconnect(playerid, reason)
{
new file[MAX_PLAYER_NAME+25], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
dini_Create(file);
format(file, sizeof(file), "mygamemode/users/%s.txt", name);
dini_IntSet(file, "Score", GetPlayerScore(playerid));
return 1;
}

