SA-MP Forums Archive
how to make that - 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)
+--- Thread: how to make that (/showthread.php?tid=636357)



how to make that - HoussemGaming - 25.06.2017

Hey all.
i wanna some help.
i wanna make something in mysql
example :
if in bank withdraw dialog the player have 200 in his bank account , he want withdraw 100, so the 100 will be deducted from the mysql table.
hwo to make that ? plz


Re: how to make that - Abagail - 25.06.2017

Deduct 100 from the current value. This is easy as an SQL statement:
pawn Код:
UPDATE players SET bank_cash = bank_cash - 100 WHERE UserID = %d



Re: how to make that - HoussemGaming - 25.06.2017

Oh thx abagail.
You helped me alot.
Thank you


Re: how to make that - saffierr - 25.06.2017

A possible better query would be (In other cases)
PHP код:
mysql_format(connectionHandlequerysizeof query"UPDATE players SET bank_cash = bank_cash - %i WHERE UserID = %i"withdrawnyourUserVariable); 
I hope you got my tip :P


Re: how to make that - HoussemGaming - 25.06.2017

Quote:
Originally Posted by saffierr
Посмотреть сообщение
A possible better query would be (In other cases)
PHP код:
mysql_format(connectionHandlequerysizeof query"UPDATE players SET bank_cash = bank_cash - %i WHERE UserID = %i"withdrawnyourUserVariable); 
I hope you got my tip :P
Thank you