Help OnPlayerConnect
#1

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
Код:
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;
}
help plz
Reply


Messages In This Thread
Help OnPlayerConnect - by FireCat - 24.09.2010, 16:01
Re: Help OnPlayerConnect - by Seven. - 24.09.2010, 16:04
Re: Help OnPlayerConnect - by Mauzen - 24.09.2010, 16:04
Re: Help OnPlayerConnect - by NoobScripter1 - 24.09.2010, 16:05
Re: Help OnPlayerConnect - by FireCat - 24.09.2010, 16:07
Re: Help OnPlayerConnect - by Voldemort - 24.09.2010, 17:23
Re: Help OnPlayerConnect - by FireCat - 24.09.2010, 17:24
Re: Help OnPlayerConnect - by Voldemort - 24.09.2010, 17:34

Forum Jump:


Users browsing this thread: 1 Guest(s)