My code doesn't give cash to the owner, need help!
#5

Quote:
Originally Posted by Sc0pion
Посмотреть сообщение
You misunderstood, assume you own a house, set that house for sale and a guy purchases it the owner you wont receive the cash.

and the problem is with this part so I need to know how to fix:

Код:
GivePlayerMoney(hInfo[houseid][Owner], hInfo[houseid][Price]);
Like I said, don't use GivePlayerMoney, instead use a custom stock to stop money hacking.
pawn Код:
GiveMoney(playerid)
{
    ResetPlayerMoney(playerid);
    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
    return true;
}
Now, you can use
pawn Код:
PlayerInfo[playerid][pCash] += hInfo[houseid][Price];
GiveMoney(playerid);
Also, remember to always "+=" if you're adding money and "-=" if you're minus-ing money.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)