/pay bugs amount x2
#1

Fixed! Thanks for Konstantinos!
Reply
#2

Can anyone help me please?
Reply
#3

pawn Код:
PlayerInfo[playerid][pMoney] -= amount;
PlayerInfo[giveplayerid][pMoney] += amount;
SafeGivePlayerMoney(playerid, -amount);
SafeGivePlayerMoney(giveplayerid, amount);
I assume in SafeGivePlayerMoney already sets the amount of money into PlayerInfo[playerid][pMoney]. Can you post SafeGivePlayerMoney so we'll be sure?
Reply
#4

pawn Код:
stock SafeGivePlayerMoney(playerid, money)
{
    PlayerInfo[playerid][pMoney] += money;
    GivePlayerMoney(playerid, money);
    return 1;
}
This one?
Reply
#5

Yes, it sets the amount of money and you set it before using SafeGivePlayerMoney as well, so it basically sets the amount twice.

Replace:
pawn Код:
PlayerInfo[playerid][pMoney] -= amount;
PlayerInfo[giveplayerid][pMoney] += amount;
SafeGivePlayerMoney(playerid, -amount);
SafeGivePlayerMoney(giveplayerid, amount);
to:
pawn Код:
SafeGivePlayerMoney(playerid, -amount);
SafeGivePlayerMoney(giveplayerid, amount);
Reply
#6

Got this error
pawn Код:
C:\Users\user\Desktop\b\BlankGameMode-Fix\gamemodes\ad.pwn(10680) : error 017: undefined symbol "giveplayerid"
C:\Users\user\Desktop\b\BlankGameMode-Fix\gamemodes\ad.pwn(10682) : error 017: undefined symbol "giveplayerid"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
Reply
#7

Add at the start of the cmd;

pawn Код:
new giveplayerid;
Reply
#8

I thought that I should add them on stock SafeGivePlayerMoney, but on cmd:pay ?
Reply
#9

Above where the errors are coming from.
Reply
#10

EDITED


It works now! My mistake I read in a wrong side

thanks! repped
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)