#define FILTERSCRIPT#include <a_samp>#include <a_mysql>new mysql; stock IsPlayerConnectWithLauncher(playerid){ new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof name); new szQueryInput[1500]; format(szQueryInput, sizeof szQueryInput, \"SELECT * FROM `player_joins` WHERE ic_name = \'%s\' AND (NOW() - join_time) < 120 \", name); new rows, fields; cache_get_data(rows, fields); if(!rows) {format(szQueryInput, sizeof(szQueryInput), \"DELETE FROM `player_joins` WHERE ic_name = \'%s\'\", name); mysql_function_query(mysql, szQueryInput, false, \"\", \"\"); return 1; }else{format(szQueryInput, sizeof(szQueryInput), \"DELETE FROM `player_joins` WHERE ic_name = \'%s\'\", name); mysql_function_query(mysql, szQueryInput, false, \"\", \"\"); return 0;} } public OnFilterScriptInit(){mysql = mysql_connect(\"127.0.0.1\",\"root\",\"Kliens\",\"\");if(mysql) printf(\"Adatbázishoz való csatlakozás sikeres!\");return 1;}public OnFilterScriptExit(){new szQueryInput[1500]; new name[MAX_PLAYER_NAME];format(szQueryInput, sizeof(szQueryInput), \"DELETE FROM `player_joins` WHERE ic_name = \'%s\'\", name);mysql_function_query(mysql, szQueryInput, false, \"\", \"\");return 1;}public OnPlayerConnect(playerid){if( IsPlayerConnectWithLauncher(playerid) ){}else{ Kick(playerid);}return 1;}
-- phpMyAdmin SQL Dump-- version 4.2.7.1-- http://www.phpmyadmin.net---- Hoszt: 127.0.0.1-- Létrehozás ideje: 2015. Feb 28. 20:22-- Szerver verzió: 5.5.39-- PHP verzió: 5.4.31SET SQL_MODE = \"NO_AUTO_VALUE_ON_ZERO\";SET time_zone = \"+00:00\"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;/*!40101 SET NAMES utf8 */;---- Adatbázis: `samp_launcher`---- ------------------------------------------------------------ Tábla szerkezet ehhez a táblához `launcher`--CREATE TABLE IF NOT EXISTS `launcher` ( `ic_name` text NOT NULL, `todo` int(11) NOT NULL, `command` text NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=latin1;-- ------------------------------------------------------------ Tábla szerkezet ehhez a táblához `player_joins`--CREATE TABLE IF NOT EXISTS `player_joins` ( `ic_name` text NOT NULL, `join_time` datetime NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=latin1;-- ------------------------------------------------------------ Tábla szerkezet ehhez a táblához `server_open`--CREATE TABLE IF NOT EXISTS `server_open` ( `open` int(11) NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=latin1;---- A tábla adatainak kiíratása `server_open`--INSERT INTO `server_open` (`open`) VALUES(1);-- ------------------------------------------------------------ Tábla szerkezet ehhez a táblához `users`--CREATE TABLE IF NOT EXISTS `users` ( `username` text NOT NULL, `password` text NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=latin1;/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
[20:25:47] >> mysql_connect(127.0.0.1, root, Samp_Launcher, ******) on port 3306[20:25:47] CMySQLHandler::CMySQLHandler() - constructor called.[20:25:47] CMySQLHandler::CMySQLHandler() - Connecting to \"127.0.0.1\" | DB: \"Kliens\" | Username: \"root\"[20:25:47] CMySQLHandler::Connect() - Connection was successful.[20:25:47] CMySQLHandler::Connect() - Auto-Reconnect has been enabled.[20:26:27] >> cache_get_data( Connection handle: 1 )[20:26:27] >> mysql_query_callback( Connection handle: 1 )[20:26:27] Passing query DELETE FROM `player_joins` WHERE ic_name = \'Jim Toretto\' | [20:26:27] ProcessQueryThread() - Query was successful. (DELETE FROM `player_joins` WHERE ic_name = \'Jim Toretto\')[20:26:27] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick()[20:26:27] () - Threaded function called.[20:28:46] >> cache_get_data( Connection handle: 1 )[20:28:46] >> mysql_query_callback( Connection handle: 1 )[20:28:46] Passing query DELETE FROM `player_joins` WHERE ic_name = \'Jim Toretto\' | [20:28:46] ProcessQueryThread() - Query was successful. (DELETE FROM `player_joins` WHERE ic_name = \'Jim Toretto\')[20:28:46] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick()[20:28:46] () - Threaded function called.
Hmm... 120 aposztrofok közé: ...) < \'120\'
#define FILTERSCRIPT#include <a_samp>#include <a_mysql>new mysql; stock IsPlayerConnectWithLauncher(playerid){ new name[MAX_PLAYER_NAME], Query[1024]; GetPlayerName(playerid, name, sizeof name); format(Query, sizeof Query, \"SELECT * FROM `player_joins` WHERE ic_name = \'%s\' AND (NOW() - join_time) < 120 \", name); mysql_query(mysql,Query); if( cache_get_row_count(mysql) > 0) { format(Query, sizeof Query, \"DELETE FROM `player_joins` WHERE ic_name = \'%s\'\", name); mysql_query(mysql,Query); return 1; }else{format(Query, sizeof Query, \"DELETE FROM `player_joins` WHERE ic_name = \'%s\'\", name); mysql_query(mysql,Query); return 0;} } public OnFilterScriptInit(){mysql = mysql_connect(\"127.0.0.1\",\"root\",\"kliens\",\"\");if(mysql) printf(\"Adatbázishoz való csatlakozás sikeres!\");return 1;}public OnPlayerConnect(playerid){if( IsPlayerConnectWithLauncher(playerid) ){}else{ Kick(playerid);}return 1;}