First, make sure the MySQL event scheduler is enabled. It is not enabled by default. To check if it's enabled, run the MySQL query 'show processlist;'(SQL tab of phpMyAdmin will suffice) and see if there's a task under the user 'event_scheduler'. If there isn't, it's not running. Keep in mind, to be able to view processes for all users(IE event scheduler), you'll need to login as root or have the 'process' privledge. So in short, to check, you'll need root access to the server.
If it's indeed not enabled, you'll need to enable it(requires root access):
https://dev.mysql.com/doc/refman/5.1...iguration.html
I'm going to make an assumption that you're using BlueG's MySQL plugin, and you're using a halfway up to date version of it. If not, you still should get the basic idea.
This should do you over just fine, I'd explain, but honestly, it speaks for itself, so if you have questions, you know what to do.
Obviously under the OnGameModeInit callback:
Код:
mysql_query(ConnectionHandle, "CREATE EVENT `autounban` ON SCHEDULE EVERY 1 SECOND DO UPDATE `bans` SET `banned`='0' WHERE `banned`='1' AND UNIX_TIMESTAMP() >= `banexpire`;", false);
Do keep in mind that events do not magically go away after your server is stopped! If you don't stop them, they'll run for an infinite amount of time, which is typically undesireable.
Код:
mysql_query(MainPipeline, "DROP EVENT `tbans`", false);
EDIT: Just noticed your screenshot, and it looks like you already enabled the event scheduler.