19.07.2013, 22:23
I am trying to sync money with this:
And in the game I adjust the player's money with "PlayerInfo[playerid][pCash] (+=/-= amount)"
Now if I decrease the amount of money it syncs perfectly, when I increase the amount of money the moneybar keeps increasing and decreasing every single second, so it remains between old value and new value.
pawn Код:
Timer:MoneySync[2000]()
{
new string[255];
foreach(Player, i)
{
if(PlayerInfo[i][pCash] != GetPlayerMoney(i))
{
ResetPlayerMoney(i);
GivePlayerMoney(i, PlayerInfo[i][pCash]);
}
}
return 1;
}
Now if I decrease the amount of money it syncs perfectly, when I increase the amount of money the moneybar keeps increasing and decreasing every single second, so it remains between old value and new value.