24.09.2015, 14:02
Ok, Now Put the array (variable) on top of your script under your defines / variables,
And OnPlayerUpdate:-
Edit: OnPlayerDisconnect
To reset the array 
For decreased cash;
OnPlayerConnect:-
And OnPlayerUpdate:-
PHP код:
if(GetPlayerMoney(playerid) > Money[playerid])
{
new IncreasedAmount = GetPlayerMoney(playerid) - Money[playerid];
// your code.
Money[playerid] = GetPlayerMoney(playerid); // this to update the variable with the current cash so, it does the same again after cash gets increased again..
}
PHP код:
Money[playerid] = 0;

For decreased cash;
OnPlayerConnect:-
PHP код:
Money[playerid] = PlayerInfo[playerid][pMoney]; // Change to your saved cash for player, if theres no, remove it.
PHP код:
if(GetPlayerMoney(playerid) < Money[playerid])
{
new DecreasedAmount = Money[playerid] - GetPlayerMoney(playerid);
// your code.
Money[playerid] = GetPlayerMoney(playerid) // this to update the variable with the current cash so, it does the same again after cash gets increased again..
}