open.mp forum
[Question] How to save samp player money on mysql (not on open.mp server) - Printable Version

+ open.mp forum (https://forum.open.mp)
-- Forum: open.mp (https://forum.open.mp/forumdisplay.php?fid=40)
--- Forum: Questions and Suggestions (https://forum.open.mp/forumdisplay.php?fid=42)
--- Thread: [Question] How to save samp player money on mysql (not on open.mp server) (/showthread.php?tid=2488)



How to save samp player money on mysql (not on open.mp server) - angelovj8 - 2023-11-16

How to save samp player money on mysql (not on open.mp server)


RE: How to save samp player money on mysql (not on open.mp server) - Radical - 2023-11-16

Create an integer column named 'money' in the 'accounts' table and store the player's money on disconnect.

query:
PHP Code:
UPDATE `accountsSET `money` = %d WHERE `id` = ? 

And load it when the player is logged into the account:
PHP Code:
new money;
cache_get_value_int(0"money"money);
GivePlayerMoney(playeridmoney); 



RE: How to save samp player money on mysql (not on open.mp server) - Konliner - 2024-02-28

(2023-11-16, 03:42 PM)Radical Wrote: Create an integer column named 'money' in the 'accounts' table and store the player's money on disconnect.

query:
PHP Code:
UPDATE `accountsSET `money` = %d WHERE `id` = ? 

And load it when the player is logged into the account:
PHP Code:
new money;
cache_get_value_int(0"money"money);
GivePlayerMoney(playeridmoney); 
This way is very good. But I couldn't think of this. Thanks