Question
#2

There is no function provided in SA-MP to reset the players statistics. However you can create your own functions or Do it the way your doing it Under OnPlayerConnect , that is correct!

Or Creating your own functions is like:

Creating a stock.
pawn Код:
stock ResetPlayerStats(playerid)
{
    PlayerInfo[playerid][pCash] = 0;
    PlayerInfo[playerid][pAdmin] = 0;
    return 1;
}
Or creating a custom callback.

pawn Код:
forward ResetPlayerStats(playerid)
public ResetPlayerStats(playerid)
{
    PlayerInfo[playerid][pCash] = 0;
    PlayerInfo[playerid][pAdmin] = 0;
    return 1;
}
And then you can use these functions where ever you want to as:
pawn Код:
public OnPlayerConnect(playerid)
{
    ResetPlayerStats(playerid);
    return 1;
}
Reply


Messages In This Thread
Question - by JustinAn - 17.11.2012, 16:05
Re: Question - by Ballu Miaa - 17.11.2012, 16:25
Re: Question - by JustinAn - 17.11.2012, 16:28
Re: Question - by Ballu Miaa - 17.11.2012, 16:31
Re: Question - by JustinAn - 17.11.2012, 16:34

Forum Jump:


Users browsing this thread: 2 Guest(s)