17.11.2012, 16:25
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.
Or creating a custom callback.
And then you can use these functions where ever you want to as:
Or Creating your own functions is like:
Creating a stock.
pawn Код:
stock ResetPlayerStats(playerid)
{
PlayerInfo[playerid][pCash] = 0;
PlayerInfo[playerid][pAdmin] = 0;
return 1;
}
pawn Код:
forward ResetPlayerStats(playerid)
public ResetPlayerStats(playerid)
{
PlayerInfo[playerid][pCash] = 0;
PlayerInfo[playerid][pAdmin] = 0;
return 1;
}
pawn Код:
public OnPlayerConnect(playerid)
{
ResetPlayerStats(playerid);
return 1;
}