SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 23/01/2018, 03:43 PM   #1
NLDBrian
Little Clucker
 
Join Date: Sep 2017
Posts: 24
Reputation: 0
Default Timer to check database

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
NLDBrian is offline   Reply With Quote
Old 23/01/2018, 09:20 PM   #2
InfiniTy.
High-roller
 
InfiniTy.'s Avatar
 
Join Date: Oct 2012
Location: Romania,Galați
Posts: 1,251
Reputation: 119
Default Re: Timer to check database

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
InfiniTy. is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Database check (R41-2) Allihopp Scripting Help 0 24/01/2017 09:12 AM
[Tutorial] How to make a check timer (will check laggers) Eth Tutorials 9 01/05/2014 02:09 AM
Help with MySQL Database Check Xeiss Scripting Help 1 21/02/2013 06:09 PM
How to change timer to check if XP is equal or above... stormchaser206 Scripting Help 3 17/02/2013 02:22 AM
MySQL Check's Each house except last on the database. Dokins Scripting Help 24 22/11/2011 08:36 PM


All times are GMT. The time now is 03:02 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.