Simple functions doubles the amount.
#6

Quote:
Originally Posted by AmigaBlizzard
Посмотреть сообщение
PHP код:
stock GivePlayerMoneyEx(playeridamount)
{
    
Account[playerid][PocketMoney] += amount;
        
ResetPlayerMoney(playerid); // You just missed this
    
GivePlayerMoney(playeridAccount[playerid][PocketMoney]);
    return 
true;

You only needed to add ResetPlayerMoney first.

If you had 5000, and add 1000 to it, your server-var "PocketMoney" will hold 6000.
But since your client already has 5000, you'll be adding the 6000 to it, and you'll end up with 11000 while the server only holds 6000.

You need to reset the client money to 0 first, then send the new amount.
No need to repeat what was already said.
Reply


Messages In This Thread
Simple functions doubles the amount. - by CrazyChoco - 27.12.2015, 16:53
Re: Simple functions doubles the amount. - by SecretBoss - 27.12.2015, 17:03
Re: Simple functions doubles the amount. - by SickAttack - 27.12.2015, 17:06
Re: Simple functions doubles the amount. - by CrazyChoco - 27.12.2015, 18:16
Re: Simple functions doubles the amount. - by AmigaBlizzard - 27.12.2015, 23:24
Re: Simple functions doubles the amount. - by SickAttack - 28.12.2015, 00:52
Re: Simple functions doubles the amount. - by jessejanssen - 28.12.2015, 02:23
Re: Simple functions doubles the amount. - by SickAttack - 28.12.2015, 03:04
Re: Simple functions doubles the amount. - by AmigaBlizzard - 05.01.2016, 19:39

Forum Jump:


Users browsing this thread: 2 Guest(s)