Posts: 340
Threads: 189
Joined: Apr 2014
Reputation:
0
Ok my question is: If i make a mysql query that check in database which player has 'ToBeKicked = 1' every 1 second, does that function would make lag on server?
Posts: 32
Threads: 0
Joined: Mar 2016
Reputation:
0
Yes. It will. It'll also cause other queries you do to get bottlenecked and could take a while for that query to be processed if there's a constant queue.
Why do you need that in the database? Can't you use a variable for it?
Posts: 319
Threads: 7
Joined: Jul 2012
Reputation:
0
When do you insert that value in the database?
When the player is online or offline?
In case he's online, just kick him immediately instead of saving a 1 in the database and query it every second.
In case he's offline and should be kicked upon connecting, you can simply read the value during OnPlayerConnect and if it's a 1, kick him.
There is no need to run such a query every second per player.
Posts: 882
Threads: 50
Joined: Jun 2012
Reputation:
0
Why do you even want to use MySQL? Why not simply keep an array, ToBeKicked[MAX_PLAYERS]?
Maybe you want to kick from your control panel? If that is the case, use the Sockets plugin. If you are new to sockets, use SAMP's query mechanism to send RCON commands.