Posts: 270
Threads: 7
Joined: Apr 2015
Quote:
Originally Posted by PowerPC603
If you just want to give a player some money, you don't need to know the money he has upfront.
PHP код:
UPDATE playerdata SET Money = Money + '%i' WHERE UserID = '%i'
Such a query gets the specified player's money and adds the given money to it, whatever money the player already has.
You may want to use a playername instead of a UserID to reference the correct player offline:
PHP код:
UPDATE playerdata SET Money = Money + '%i' WHERE PlayerName = '%e'
|
Nice but adding money like that is only useful when player is offline.