Timer to check database
#1

Hi there!

As I'm working on a webshop system I am trying to figure out if it's possible to make the GM check certain values in the SQL database every 5/10 minutes..

For example:

Player buys 4 gold coins

DB player account:
"gold" was 0 is now 4

Timer checks and notices "coins" is 4

Gamemessage for player if value changed (if unchanged, no matter what number)
You have bought 4 gold coins!

Or is there a better way to do this?

Thanks
Reply
#2

The best way IMO is to use sockets (plugin), but you could also do it your way, that would work too, but if you are doing a query for each player at the same time for example, that could be bad in the long-run when you are probable to have lots of players. If you are not limited by your samp host then i'd suggest you use sockets
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)