26.05.2018, 02:03
The Requirements are:
MySQL by BlueG - MySQL R41-4
3rd Party WebServer for your pc - Download XAMPP
Basic Knowledge pawn - You must have it in your downloaded ZIP 0.3.7-r2
include:
make a connection to your database:
OnGameModeInit() if its for your gamemode
OnFilterScriptInit() if its for your filterscripts
----- Still adding info of help
MySQL by BlueG - MySQL R41-4
3rd Party WebServer for your pc - Download XAMPP
Basic Knowledge pawn - You must have it in your downloaded ZIP 0.3.7-r2
include:
Код:
#include <a_samp> first #include <a_mysql> second
Код:
#define MYSQL_HOST "localhost" //by default #define MYSQL_USER "root" //by default #define MYSQL_PASSWORD "" // default user does not has password #define MYSQL_DATABASE "test" // its allready set by default
Код:
new MySQL:g_SQL; //this is MySQL tag & variable to connect to your webserver mysql
OnFilterScriptInit() if its for your filterscripts
Код:
public OnSomethingInit() // this is example { new MySQLOpt:Option_Id = mysql_init_options(); // that depends what option you will set it mysql_set_option(Option_Id, SERVER_PORT, 3306); // lets say you set it for MySQL Default Port g_SQL = mysql_connect(.....); // Here goes your defines MYSQL_1, 2, 3, 4 // than you check is your mysql open or closed by doing if(mysql_errno() != 0) { //print failed } else { //print success } // here you can create your table for your banned Ips depending on what you want to store return 1; }
Код:
public OnSomeThingExit() { mysql_close(g_SQL); // make sure you close your connection on gamemode exit or filterscript exit return 1; }