How to save score!?!?
#10

Quote:
Originally Posted by Claude
Посмотреть сообщение
You have to use GetPlayerTeam and SetPlayerTeam, together your save score thing would be like:

pawn Код:
public OnPlayerDeath(playerid, killerid, reason);
{
    if(GetPlayerTeam(playerid) != GetPlayerTeam(killerid)
    {
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(GetPlayerTeam(i) == GetPlayerTeam(killerid)
            {
                SetPlayerScore(i, GetPlayerScore(i)+1);
                return 1;
            }
        }
    }
}
Also use
pawn Код:
#include <dini>
(must download the include from DracoBlue)

pawn Код:
public OnPlayerDisconnect(playerid)
{
    dini_IntSet(playerid, "Score", GetPlayerScore(playerid);
    return 1;
}

public OnPlayerConnect(playerid);
{
    SetPlayerScore(playerid, dini_Int(playerid, "Score");
    return 1;
}
Not tested, but might work
Some of your code would not work, because.
When you use dini, its not dini_intset(playerid, "score", getplayersc...) its a string insted of playerid.
therefore,
format(string, sizeof(string), "path", parameters) before dini code, then it'll be 100% right
Reply


Messages In This Thread
How to save score!?!? - by Criss_Angel - 07.08.2010, 09:18
Re: How to save score!?!? - by Niixie - 07.08.2010, 09:26
Re: How to save score!?!? - by Criss_Angel - 07.08.2010, 09:29
Re: How to save score!?!? - by Criss_Angel - 07.08.2010, 09:55
Re: How to save score!?!? - by Claude - 07.08.2010, 10:05
Re: How to save score!?!? - by Criss_Angel - 07.08.2010, 10:08
Re: How to save score!?!? - by Criss_Angel - 07.08.2010, 10:18
Re: How to save score!?!? - by Claude - 07.08.2010, 10:38
Re: How to save score!?!? - by Criss_Angel - 07.08.2010, 10:54
Re: How to save score!?!? - by Niixie - 08.08.2010, 10:58

Forum Jump:


Users browsing this thread: 1 Guest(s)