SA-MP Forums Archive
Saving a Statistic to a MySQL Field - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Saving a Statistic to a MySQL Field (/showthread.php?tid=109056)



Saving a Statistic to a MySQL Field - darkrider366 - 17.11.2009

Hey guys. I have currently done myself a MySQL Login and Register script.
The only thing is. I need a command to send a query to the database to save the amount of cash the player has.
Such as.
INSERT (cash) INTO money WHERE username=(username)

Something like that guys, but the users get to do it via command. Cheers.


Re: Saving a Statistic to a MySQL Field - JakeB - 17.11.2009

Quote:
Originally Posted by darkrider366
Hey guys. I have currently done myself a MySQL Login and Register script.
The only thing is. I need a command to send a query to the database to save the amount of cash the player has.
Such as.
INSERT (cash) INTO money WHERE username=(username)

Something like that guys, but the users get to do it via command. Cheers.
Add a cash column to your users table then use
Код:
UPDATE users SET cash=(cash) WHERE username=(username)



Re: Saving a Statistic to a MySQL Field - darkrider366 - 17.11.2009

wow tyyy

Would this work? ~
Код:
mysql_query("UPDATE users SET cash=%d WHERE username=%d", GetPlayerMoney, GetPlayerName);