Kills and Death
#5

Here's something I wrote that might be helpful. (Using dini)

At the top, with other variables:
pawn Код:
new Kills[MAX_PLAYERS];
new Deaths[MAX_PLAYERS];
Now:
pawn Код:
public OnPlayerConnect(playerid)
{
    Kills[playerid]=0;
    Deaths[playerid]=0;
    new file[128];
    format(file, sizeof(file), "%s.ini", GetName(playerid));
    if(!fexist(file)
    {
        dini_Create(file)
        dini_IntSet(file, "Kills", 0);
        dini_IntSet(file, "Deaths", 0);
        Kills[playerid] = dini_Int(file, "Kills");
        Deaths[playerid] = dini_Int(file, "Deaths");
    }
    else
    {
        Kills[playerid] = dini_Int(file, "Kills");
        Deaths[playerid] = dini_Int(file, "Deaths");
    }
    return 1;
}
Saving stats when player disconnects;
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new file[128];
    format(file, sizeof(file), "%s.ini", GetName(playerid));
    dini_IntSet(file, "Kills", Kills[playerid]);
    dini_IntSet(file, "Deaths", Deaths[playerid]);
    return 1;
}

_______
Please reputation +, if this helped

-Kane
Reply


Messages In This Thread
Kills and Death - by Shockey HD - 29.07.2011, 06:50
Re: Kills and Death - by rbN. - 29.07.2011, 07:00
Re: Kills and Death - by Shockey HD - 29.07.2011, 07:07
Re: Kills and Death - by rbN. - 29.07.2011, 07:31
Re: Kills and Death - by [DM]Kane - 29.07.2011, 07:35
Re: Kills and Death - by Kush - 29.07.2011, 07:37
Re: Kills and Death - by Shockey HD - 29.07.2011, 07:42
Re: Kills and Death - by rbN. - 29.07.2011, 07:43
Re: Kills and Death - by Steven82 - 29.07.2011, 07:56
Re: Kills and Death - by Lorenc_ - 29.07.2011, 09:13

Forum Jump:


Users browsing this thread: 1 Guest(s)