Jump to content

[WIP] Usersystem SQL problem


rafull6

Recommended Posts

Hi, guys! I thing all of you saw Usersystem made by Cannonball [https://forum.multitheftauto.com/viewtopic.php?f=108&t=27549&start=30&st=0&sk=t&sd=a&hilit=message]. I tried to run it on my server but get failed, don't know why...

Here i've posted some screens with my errors:

Console errors:

321bu.png

Chat message:

132oo.png

I think that problem in CFG file where i should change red lines:

--//// Cannonball's Extended usersystem! ////--
--//// Fully MySQL based. ////--
--//// This script may not be shared under any circumstance's. ////--
--//// Copyrights ©Cannonball ////--
--//// Coded by Cannonball ////--
 
local host = "[color=#BF0000]localhost[/color]"
local user = "[color=#BF0000]name[/color]"
local password = "[color=#BF0000]password[/color]"
local database = "[color=#BF0000]basename[/color]"
 
connect_mysql = mysql_connect(host, user, password, database )
if not connect_mysql then
outputChatBox( no_connect_sql_message )
end

I changed lines to this like:

--//// Cannonball's Extended usersystem! ////--
--//// Fully MySQL based. ////--
--//// This script may not be shared under any circumstance's. ////--
--//// Copyrights ©Cannonball ////--
--//// Coded by Cannonball ////--
 
local host = "localhost"
local user = "root"
local password = "mypass"
local database = "mtadatabase"
 
connect_mysql = mysql_connect(host, user, password, database )
if not connect_mysql then
outputChatBox( no_connect_sql_message )
end

But when im joining server as an admin and trying to start this resource it getting failed. You can see result at the pictures, posted at hte start of this topic.

QUESTION: Why it won't work?!!?

P.S. database is installed.

Link to comment

The functions "mysql_connect" and "mysql_errno" are functions from the MTA-MySQL module. In case you don't know what a module is, it's kind of like a file that adds functionality to the MTA server. (in this case, MySQL)

To solve this problem, simply install the MTA-MySQL module like described on the wiki page, and you shouldn't have any problems.

Link to comment

Gamesnert, thank you! I understood how to use it, but it's still won't work, don't know why... I've installed this module but it's still shows me the same errors. Mey be there is a problem in my cfg.lua?

cgf.lua

--//// Cannonball's Extended usersystem! ////--
--//// Fully MySQL based. ////--
--//// This script may not be shared under any circumstance's. ////--
--//// Copyrights ©Cannonball ////--
--//// Coded by Cannonball ////--
 
local host = "localhost"
local user = "root"
local password = "hereismypass"
local database = "mtadatabase"
 
connect_mysql = mysql_connect(host, user, password, database )
if not connect_mysql then
outputChatBox( no_connect_sql_message )
end

Link to comment

Uncompress the file mta_mysql.dll into your C:\Program files\MTA San Andreas\server\mods\deathmatch\modules\ --- There wasn't such directory, so i created it--- directory and the file libmysql.dll into your C:\Program files\MTA San Andreas\server\ directory. --Added--

Then, add the following line in mtaserver.conf:

In mtaconf lines was like that:

<!-- Specifies the module(s) which are loaded with the server. To load several modules, add more <module>
     parameter(s). Optional parameter. -->
<!-- <module src="sample_win32.dll"/> -->
<!-- <module src="sample_linux.so"/> -->

i added mta_mysql.dd line and now it is like that:

<!-- Specifies the module(s) which are loaded with the server. To load several modules, add more <module>
     parameter(s). Optional parameter. -->
<!-- <module src="mta_mysql.dll" /> -->
<!-- <module src="sample_win32.dll"/> -->
<!-- <module src="sample_linux.so"/> -->

What is wrong then?

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...