22.05.2011, 18:43
i have a problem with my serverside money.
all works fine, but when i buy something from ammu nation or from the soda machine my old money will be restored what is annoying.
my current code:
this one is the best.
for example when I use
if(GetPlayerCash(i) > GetPlayerMoney(i)) (so he bought a soda or something)
to set the new money it will bug sometimes (when they received money with my 'GivePlayerCash' function, it will restored).
best solution would be to check if the player is using the soda machine / ammu nation.
all works fine, but when i buy something from ammu nation or from the soda machine my old money will be restored what is annoying.
my current code:
pawn Code:
forward MoneyHack();
public MoneyHack()
{
foreach(Player, i)
{
if(GetPlayerCash(i) != GetPlayerMoney(i))
{
SetPlayerCash(i, GetPlayerCash(i));
}
}
}
for example when I use
if(GetPlayerCash(i) > GetPlayerMoney(i)) (so he bought a soda or something)
to set the new money it will bug sometimes (when they received money with my 'GivePlayerCash' function, it will restored).
best solution would be to check if the player is using the soda machine / ammu nation.