Well there are too many functions with mysql i don't know the functions of easymysql so.
Код:
public OnGameModeInit()
{
mysql_log(ERROR | WARNING | INFO | DEBUG);
option_Id = mysql_init_options();
mysql_set_option(option_Id, AUTO_RECONNECT, true);
g_Handle = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE, option_Id);
if(g_Handle == MYSQL_INVALID_HANDLE || mysql_errno(g_Handle) != 0)
{
print(MYSQL_FAILURE);
SendRconCommand("exit");
}
else
{
print(MYSQL_SUCCESS);
}
new Query[1024];
mysql_format(g_Handle, Query, sizeof(Query), "CREATE TABLE IF NOT EXISTS `Accounts` (\
`ID` int(11) NOT NULL AUTO_INCREMENT, \
`Name` varchar(24) NOT NULL, \
`Password` varchar(129) NOT NULL, \
`Ip` varchar(18) NOT NULL, \
`Level` int(11) NOT NULL, \
`Money` int(11) NOT NULL, \
`Kills` int(11) NOT NULL, \
`Deaths` int(11) NOT NULL, \
`Scuicides` int(11) NOT NULL, \
`Skin` int(11) NOT NULL, \
`Interior` int(11) NOT NULL, \
`X` float NOT NULL, \
`Y` float NOT NULL, \
`Z` float NOT NULL, \
PRIMARY KEY (`ID`))");
mysql_tquery(g_Handle, Query);
SetGameModeText(GAMEMODE_TEXT);
return 1;
}