changed header and version info

mysql table is automatic created
This commit is contained in:
Felix Geyer 2004-02-01 18:35:26 +00:00
parent 9e999a0ba6
commit 3ceb86753d

View File

@ -1,19 +1,12 @@
/* AMX Mod script.
/* AMX Mod X script.
*
* (c) 2002-2004, dJeyL
* modified by BAILOPAN,Manip,PM,SniperBeamer
*
* (c) 2003, dJeyL
* This file is provided as is (no warranties).
*
* This AMX plugin requires MySQL module.
*
* For this to work, you might create your MySQL admins table with this SQL query :
CREATE TABLE admins (
auth varchar(32) NOT NULL default '',
password varchar(32) NOT NULL default '',
access varchar(32) NOT NULL default '',
flags varchar(32) NOT NULL default ''
) TYPE=MyISAM;
* IMPORTANT:
* o Check $moddir/addons/amx/mysql.cfg for MySQL access configuration
* o Disable admin.amx plugin if you use admin_mysql.amx
@ -24,7 +17,7 @@
#include <amxmisc>
#include <mysql>
#define MAX_ADMINS 64
#define MAX_ADMINS 64
new g_aPassword[MAX_ADMINS][32]
new g_aName[MAX_ADMINS][32]
@ -38,7 +31,7 @@ new g_cmdLoopback[16]
public plugin_init()
{
register_plugin("Admin Base for MySQL","0.9","default")
register_plugin("Admin Base for MySQL","0.1","default")
register_cvar("amx_mode","2.0")
register_cvar("amx_password_field","_pw")
@ -79,6 +72,8 @@ public adminSql(){
return PLUGIN_HANDLED
}
mysql_query(mysql,"CREATE TABLE IF NOT EXISTS admins ( auth varchar(32) NOT NULL default '', password varchar(32) NOT NULL default '', access varchar(32) NOT NULL default '', flags varchar(32) NOT NULL default '' ) TYPE=MyISAM")
if(mysql_query(mysql,"SELECT auth,password,access,flags FROM admins") < 1) {
mysql_error(mysql,error,127)
server_print("MySQL error: can't load admins: '%s'",error)