Badotti_Loko Posted November 6, 2012 Share Posted November 6, 2012 Hello guys, I recently brought a server in vortexservers.com and I'm having some problems with registration system, I downloaded the gamemode "Fort Carson Roleplay" but when I get in I can't register or log in, I made a table in "phpmyadmin" and changed the connection.sql (I set the MySQL username and password and things like that) and added libmysql to MTA/server and mta_mysql.dll to resources and deathmatch folder and added it in mta_config, what's the problem ? What I did wrong or what I've to do ? Can someone please help me ? I do have teamviewer and skype, if you've it too, let's use it, my skype is Hbadotti. Thanks a lot guys Link to comment
fmj02 Posted November 6, 2012 Share Posted November 6, 2012 What about debug errors? This server is on linux or windows? Make sure mysql is correctly configured. Link to comment
Badotti_Loko Posted November 6, 2012 Author Share Posted November 6, 2012 It's in Windows and I think the MySQL is good, do you've skype ? Link to comment
fmj02 Posted November 6, 2012 Share Posted November 6, 2012 I will try to solve your problem on forums, tell me if you have modules folder created where server folder is located? put it into the mtaserver.conf: <module src="mta_mysql.dll" /> <module src="sha.dll" /> <module src="ml_sockets.dll" /> Link to comment
Badotti_Loko Posted November 6, 2012 Author Share Posted November 6, 2012 Ok, I already had and I added the other 2.. I've modules in server/mods/deathmatch folder and in server/mods/deathmatch/resources folder Do I've to create another one in server folder ? Link to comment
fmj02 Posted November 6, 2012 Share Posted November 6, 2012 MTA San Andreas 1.3\server\mods\deathmatch\modules I think your mysql connection file isn't correctly configured. Link to comment
Badotti_Loko Posted November 6, 2012 Author Share Posted November 6, 2012 Where's that file ? Link to comment
myonlake Posted November 6, 2012 Share Posted November 6, 2012 Ok, I already had and I added the other 2..I've modules in server/mods/deathmatch folder and in server/mods/deathmatch/resources folder Do I've to create another one in server folder ? No. You need to have ONLY ONE in /modules and ONLY ONE in /server. Also, if you haven't already, you need to get the MySQL library and put it in the /deathmatch folder. http://code.google.com/p/multitheftauto ... l&can=2&q= Link to comment
fmj02 Posted November 6, 2012 Share Posted November 6, 2012 yes but depends what type of mysql module fc is using/ the best solution is to put all these modules Link to comment
Badotti_Loko Posted November 6, 2012 Author Share Posted November 6, 2012 But I've 2 modules folder, one in deathmatch and other one in deathmatch/resources Link to comment
fmj02 Posted November 6, 2012 Share Posted November 6, 2012 this in deathmatch/resorces is unnecessary Link to comment
Badotti_Loko Posted November 6, 2012 Author Share Posted November 6, 2012 Added. I'll test it right now. Link to comment
Badotti_Loko Posted November 6, 2012 Author Share Posted November 6, 2012 Still not working, If you wanna take a look in it, there's the IP: 96.8.115.230:22005. So, do you've skype or teamviewer ? Link to comment
fmj02 Posted November 6, 2012 Share Posted November 6, 2012 find resource in server folder called "mysql" or "sql" ( i think fort carson have it0 Link to comment
Badotti_Loko Posted November 6, 2012 Author Share Posted November 6, 2012 (edited) In server folder there's none. But there're in deathmatch modules. files in server folder: mods (folder), core.dll, libcurl.dll, libmysql.dll, net.dll, phthreadVC2.dll and xmll.dll Edited November 6, 2012 by Guest Link to comment
fmj02 Posted November 6, 2012 Share Posted November 6, 2012 so where did u configure mysql? Link to comment
Badotti_Loko Posted November 6, 2012 Author Share Posted November 6, 2012 Server/deathmatch/recourses/mysql I edited the last post, take a look in it, I said the archives what there're in server folder. Link to comment
fmj02 Posted November 6, 2012 Share Posted November 6, 2012 post here content of these scripts from mysql in [lua] tags Link to comment
Badotti_Loko Posted November 6, 2012 Author Share Posted November 6, 2012 There're 3 files connection.lua meta.xml s_mysql.lua connection.lua -- connection settings local hostname = "localhost" local username = "HeitorB" local password = "mypass" local database = "HeitorBdb" local port = tonumber( get( "port" ) ) or 3306 -- global things. local MySQLConnection = nil local resultPool = { } local sqllog = false local countqueries = 0 -- connectToDatabase - Internal function, to spawn a DB connection function connectToDatabase(res) MySQLConnection = mysql_connect(hostname, username, password, database, port) if (not MySQLConnection) then if (res == getThisResource()) then cancelEvent(true, "Cannot connect to the database.") end return nil end return nil end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), connectToDatabase, false) -- destroyDatabaseConnection - Internal function, kill the connection if theres one. function destroyDatabaseConnection() if (not MySQLConnection) then return nil end mysql_close(MySQLConnection) return nil end addEventHandler("onResourceStop", getResourceRootElement(getThisResource()), destroyDatabaseConnection, false) -- do something usefull here function logSQLError(str) local message = str or 'N/A' outputDebugString("MYSQL ERROR "..mysql_errno(MySQLConnection) .. ": " .. mysql_error(MySQLConnection)) exports['logs']:logMessage("MYSQL ERROR ! [QUERY] " .. message .. " [ERROR] " .. mysql_errno(MySQLConnection) .. ": " .. mysql_error(MySQLConnection), 24) end function getFreeResultPoolID() local size = #resultPool if (size == 0) then return 1 end for index, query in ipairs(resultPool) do if (query == nil) then return index end end return (size + 1) end ------------ EXPORTED FUNCTIONS --------------- function ping() if (mysql_ping(MySQLConnection) == false) then -- FUU, NO MOAR CONNECTION destroyDatabaseConnection() connectToDatabase(nil) if (mysql_ping(MySQLConnection) == false) then logSQLError() return false end return true end return true end function escape_string(str) if (ping()) then return mysql_escape_string(MySQLConnection, str) end return false end function query(str) if sqllog then exports['logs']:logMessage(str, 24) end countqueries = countqueries + 1 if (ping()) then local result = mysql_query(MySQLConnection, str) if (not result) then logSQLError(str) return false end local resultid = getFreeResultPoolID() resultPool[resultid] = result return resultid end return false end function unbuffered_query(str) if sqllog then exports['logs']:logMessage(str, 24) end countqueries = countqueries + 1 if (ping()) then local result = mysql_unbuffered_query(MySQLConnection, str) if (not result) then logSQLError(str) return false end local resultid = getFreeResultPoolID() resultPool[resultid] = result return resultid end return false end function query_free(str) local queryresult = query(str) if not (queryresult == false) then free_result(queryresult) return true end return false end function rows_assoc(resultid) if (not resultPool[resultid]) then return false end return mysql_rows_assoc(resultPool[resultid]) end function fetch_assoc(resultid) if (not resultPool[resultid]) then return false end return mysql_fetch_assoc(resultPool[resultid]) end function free_result(resultid) if (not resultPool[resultid]) then return false end mysql_free_result(resultPool[resultid]) table.remove(resultPool, resultid) return nil end -- incase a nub wants to use it, FINE function result(resultid, row_offset, field_offset) if (not resultPool[resultid]) then return false end return mysql_result(resultPool[resultid], row_offset, field_offset) end function num_rows(resultid) if (not resultPool[resultid]) then return false end return mysql_num_rows(resultPool[resultid]) end function insert_id() return mysql_insert_id(MySQLConnection) or false end function query_fetch_assoc(str) local queryresult = query(str) if not (queryresult == false) then local result = fetch_assoc(queryresult) free_result(queryresult) return result end return false end function query_rows_assoc(str) local queryresult = query(str) if not (queryresult == false) then local result = rows_assoc(queryresult) free_result(queryresult) return result end return false end function query_insert_free(str) local queryresult = query(str) if not (queryresult == false) then local result = insert_id() free_result(queryresult) return result end return false end function escape_string(str) return mysql_escape_string(MySQLConnection, str) end function debugMode() if (sqllog) then sqllog = false else sqllog = true end return sqllog end function returnQueryStats() return countqueries -- maybe later more end meta.xml <meta> <info author="vG MTA Scripting Team" type="script" description="MySQL"/> <script src="s_mysql.lua" type="server"/> <export function="getMySQLUsername" type="server"/> <export function="getMySQLPassword" type="server"/> <export function="getMySQLDBName" type="server"/> <export function="getMySQLHost" type="server"/> <export function="getMySQLPort" type="server"/> <!-- above is legacy --> <script src="connection.lua" type="server" /> <export function="ping" type="server" http="false" /> <export function="escape_string" type="server" http="false" /> <export function="query" type="server" http="false" /> <export function="unbuffered_query" type="server" http="false" /> <export function="query_free" type="server" http="false" /> <export function="fetch_assoc" type="server" http="false" /> <export function="rows_assoc" type="server" http="false" /> <export function="free_result" type="server" http="false" /> <export function="result" type="server" http="false" /> <export function="num_rows" type="server" http="false" /> <export function="query_fetch_assoc"type="server" http="false" /> <export function="query_rows_assoc" type="server" http="false" /> <export function="insert_id" type="server" http="false" /> <export function="query_rows_assoc" type="server" http="false" /> <export function="query_insert_free"type="server" http="false" /> <export function="escape_string" type="server" http="false" /> <export function="debugMode" type="server" http="false" /> <export function="returnQueryStats" type="server" http="false" /> </meta> s_mysql.lua username = "HeitorB" password = "mypass" db = "HeitorBdb" host = "localhost" port = tonumber( get( "port" ) ) or 3306 function getMySQLUsername() return username end function getMySQLPassword() return password end function getMySQLDBName() return db end function getMySQLHost() return host end function getMySQLPort() return port end Link to comment
fmj02 Posted November 6, 2012 Share Posted November 6, 2012 local hostname = "localhost" it's wrong, search for real hostname( you aren't using xampp right?) Link to comment
Badotti_Loko Posted November 6, 2012 Author Share Posted November 6, 2012 Oh yes, Yea, I'm not using XAMPP, but where can I find the REAL hostname ? :SS Is it the IP ? Link to comment
fmj02 Posted November 6, 2012 Share Posted November 6, 2012 There where your MySQL server is located Link to comment
Badotti_Loko Posted November 6, 2012 Author Share Posted November 6, 2012 I don't know exacly, beucase It's a hosted server from vortexservers.com, it comes with a server/control painel plus a phpmyadmin database, where can I find the locale of my MySQL ? Link to comment
fmj02 Posted November 6, 2012 Share Posted November 6, 2012 (edited) all information you should find on vortexservers.com or in phpmyadmin 127.0.0.1(host) » my_db » some_table Edited November 6, 2012 by Guest Link to comment
Badotti_Loko Posted November 6, 2012 Author Share Posted November 6, 2012 http://mysql.vortexservers.com/phpmyadmin ? Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now