Jump to content

TheBossasdasd

Members
  • Posts

    52
  • Joined

  • Last visited

TheBossasdasd's Achievements

Snitch

Snitch (10/54)

0

Reputation

  1. Szia!Én érdekesnek találom az ötletedet a szeró is szép lesz az biztos,lua-hoz nem annyira értek de szivesen kiprobálnám a mappolást a szerverre.Van jó pár RP-s mappom amit samphoz készitettem ezeket átkonvertelném és már lenne is pár map.Sok sikert a szkriptelésben!!!
  2. Végre ilyen is van,már rég vártam,hogy megnyiljon...
  3. Ok but now when i enter in my server,its written that registrayion is disabled.How can I enable??
  4. Hello everybody! I tried to install mabakos paradise roleplay,but I can't find that .sql file that I have to import using phpMyAdmin! Anyone can help me?
  5. Hello everybody now my question is that how can i turn back my gamemode from mysql back to sqlite? please help
  6. I tried but there is no such thing...
  7. Now i've got this error:my ip adress hasn't got permission to connect to that mysql server... what could i do????
  8. In the tutorial it was written that to dont change it... P.S:And in that case what do I write there?
  9. Ok but im not using my localhost im using the 000webhost free hosting...
  10. Ok I opened that window but how can i do that here???
  11. --[[ Copyright (c) 2010 MTA: Paradise This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . ]] local connection = nil local connection = nil local null = nil local results = { } local max_results = 128 -- connection functions local function connect( ) -- retrieve the settings local server = get( "server" ) or "localhost" local user = get( "user" ) or "a2480772_nhunor5" local password = get( "password" ) or "Ujkarim1" local db = get( "database" ) or "a2480772_rockmta" local port = get( "port" ) or 3306 local socket = get( "socket" ) or nil -- connect connection = mysql_connect ( server, user, password, db, port, socket ) if connection then if user == "root" then setTimer( outputDebugString, 100, 1, "Connecting to your MySQL as 'root' is strongly discouraged.", 2 ) end return true else outputDebugString ( "Connection to MySQL Failed.", 1 ) return false end end local function disconnect( ) if connection and mysql_ping( connection ) then mysql_close( connection ) end end local function checkConnection( ) if not connection or not mysql_ping( connection ) then return connect( ) end return true end addEventHandler( "onResourceStart", resourceRoot, function( ) if not mysql_connect then if hasObjectPermissionTo( resource, "function.shutdown" ) then shutdown( "MySQL module missing." ) end cancelEvent( true, "MySQL module missing." ) elseif not hasObjectPermissionTo( resource, "function.mysql_connect" ) then if hasObjectPermissionTo( resource, "function.shutdown" ) then shutdown( "Insufficient ACL rights for mysql resource." ) end cancelEvent( true, "Insufficient ACL rights for mysql resource." ) elseif not connect( ) then if connection then outputDebugString( mysql_error( connection ), 1 ) end if hasObjectPermissionTo( resource, "function.shutdown" ) then shutdown( "MySQL failed to connect." ) end cancelEvent( true, "MySQL failed to connect." ) else null = mysql_null( ) end end ) addEventHandler( "onResourceStop", resourceRoot, function( ) for key, value in pairs( results ) do mysql_free_result( value.r ) outputDebugString( "Query not free()'d: " .. value.q, 2 ) end disconnect( ) end ) -- function escape_string( str ) if type( str ) == "string" then return mysql_escape_string( connection, str ) elseif type( str ) == "number" then return tostring( str ) end end local function query( str, ... ) checkConnection( ) if ( ... ) then local t = { ... } for k, v in ipairs( t ) do t[ k ] = escape_string( tostring( v ) ) or "" end str = str:format( unpack( t ) ) end local result = mysql_query( connection, str ) if result then for num = 1, max_results do if not results[ num ] then results[ num ] = { r = result, q = str } return num end end mysql_free_result( result ) return false, "Unable to allocate result in pool" end return false, mysql_error( connection ) end function query_free( str, ... ) if sourceResource == getResourceFromName( "runcode" ) then return false end checkConnection( ) if ( ... ) then local t = { ... } for k, v in ipairs( t ) do t[ k ] = escape_string( tostring( v ) ) or "" end str = str:format( unpack( t ) ) end local result = mysql_query( connection, str ) if result then mysql_free_result( result ) return true end return false, mysql_error( connection ) end function free_result( result ) if results[ result ] then mysql_free_result( results[ result ].r ) results[ result ] = nil end end function query_assoc( str, ... ) if sourceResource == getResourceFromName( "runcode" ) then return false end local t = { } local result, error = query( str, ... ) if result then for result, row in mysql_rows_assoc( results[ result ].r ) do local num = #t + 1 t[ num ] = { } for key, value in pairs( row ) do if value ~= null then t[ num ][ key ] = tonumber( value ) or value end end end free_result( result ) return t end return false, error end function query_assoc_single( str, ... ) if sourceResource == getResourceFromName( "runcode" ) then return false end local t = { } local result, error = query( str, ... ) if result then local row = mysql_fetch_assoc( results[ result ].r ) if row then for key, value in pairs( row ) do if value ~= null then t[ key ] = tonumber( value ) or value end end free_result( result ) return t end free_result( result ) return false end return false, error end function query_insertid( str, ... ) if sourceResource == getResourceFromName( "runcode" ) then return false end local result, error = query( str, ... ) if result then local id = mysql_insert_id( connection ) free_result( result ) return id end return false, error end function query_affected_rows( str, ... ) if sourceResource == getResourceFromName( "runcode" ) then return false end local result, error = query( str, ... ) if result then local rows = mysql_affected_rows( connection ) free_result( result ) return rows end return false, error end now is like this everything should work but now i got this error: [2012-12-25 19:00:55] Resource 'guieditor' requests some acl rights. Use the command 'aclrequest list guieditor' [2012-12-25 19:01:02] ERROR: Problem with resource: brpMath; Failed to link to easytext [2012-12-25 19:01:02] ERROR: Problem with resource: randommaths; Failed to link to easytext [2012-12-25 19:01:02] Resources: 90 loaded, 2 failed [2012-12-25 19:01:03] Querying game-monitor.com master server... failed! (302: Moved temporarily) [2012-12-25 19:01:03] Querying backup master server... success! [2012-12-25 19:01:03] MODULE: Loaded "MySQL 5.0 database module" (0.41) by "Alberto Alonso <[email protected]>" [2012-12-25 19:01:03] MODULE: Loaded "SHA Module" (1.02) by "mabako" [2012-12-25 19:01:03] MODULE: Loaded "MySQL 5.0 database module" (0.41) by "Alberto Alonso <[email protected]>" [2012-12-25 19:01:03] Starting resources..... [2012-12-25 19:01:04] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:04] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:04] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:04] Start up of resource sql cancelled by script [2012-12-25 19:01:04] ERROR: Unable to start resource sql; Start up of resource cancelled by script [2012-12-25 19:01:04] Start up of resource irc cancelled by script [2012-12-25 19:01:04] ERROR: Unable to start resource irc; Start up of resource cancelled by script [2012-12-25 19:01:04] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:04] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:04] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:04] Start up of resource sql cancelled by script [2012-12-25 19:01:05] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:05] Start up of resource players cancelled by script [2012-12-25 19:01:05] ERROR: Unable to start resource players; Start up of resource cancelled by script [2012-12-25 19:01:05] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:05] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:05] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:05] Start up of resource sql cancelled by script [2012-12-25 19:01:05] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:05] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:05] Start up of resource vehicles cancelled by script [2012-12-25 19:01:05] ERROR: Unable to start resource vehicles; Start up of resource cancelled by script [2012-12-25 19:01:05] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:05] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:05] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:05] Start up of resource sql cancelled by script [2012-12-25 19:01:05] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:05] Start up of resource interiors cancelled by script [2012-12-25 19:01:05] ERROR: Unable to start resource interiors; Start up of resource cancelled by script [2012-12-25 19:01:05] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:05] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:05] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:05] Start up of resource sql cancelled by script [2012-12-25 19:01:06] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:06] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:06] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:06] Start up of resource sql cancelled by script [2012-12-25 19:01:06] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:06] Start up of resource players cancelled by script [2012-12-25 19:01:06] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:06] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:06] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:06] Start up of resource sql cancelled by script [2012-12-25 19:01:06] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:06] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:06] Start up of resource items cancelled by script [2012-12-25 19:01:06] ERROR: Unable to start resource items; Start up of resource cancelled by script [2012-12-25 19:01:08] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:08] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:08] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:08] Start up of resource sql cancelled by script [2012-12-25 19:01:08] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:08] Start up of resource players cancelled by script [2012-12-25 19:01:08] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:08] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:08] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:08] Start up of resource sql cancelled by script [2012-12-25 19:01:08] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:08] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:08] Start up of resource vehicles cancelled by script [2012-12-25 19:01:08] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:08] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:08] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:08] Start up of resource sql cancelled by script [2012-12-25 19:01:09] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:09] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:09] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:09] Start up of resource sql cancelled by script [2012-12-25 19:01:09] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:09] Start up of resource players cancelled by script [2012-12-25 19:01:09] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:09] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:09] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:09] Start up of resource sql cancelled by script [2012-12-25 19:01:09] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:09] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:09] Start up of resource items cancelled by script [2012-12-25 19:01:09] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:09] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:09] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:09] Start up of resource sql cancelled by script [2012-12-25 19:01:09] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:09] Start up of resource players cancelled by script [2012-12-25 19:01:10] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:10] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:10] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:10] Start up of resource sql cancelled by script [2012-12-25 19:01:10] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:10] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:10] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:10] Start up of resource sql cancelled by script [2012-12-25 19:01:11] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:11] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:11] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:11] Start up of resource sql cancelled by script [2012-12-25 19:01:11] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:11] Start up of resource players cancelled by script [2012-12-25 19:01:11] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:11] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:11] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:11] Start up of resource sql cancelled by script [2012-12-25 19:01:11] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:11] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:11] Start up of resource items cancelled by script [2012-12-25 19:01:11] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:11] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:11] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:11] Start up of resource sql cancelled by script [2012-12-25 19:01:11] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:11] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:11] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:11] Start up of resource sql cancelled by script [2012-12-25 19:01:11] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:11] Start up of resource players cancelled by script [2012-12-25 19:01:11] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:11] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:11] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:11] Start up of resource sql cancelled by script [2012-12-25 19:01:11] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:11] Start up of resource shops cancelled by script [2012-12-25 19:01:11] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:11] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:11] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:11] Start up of resource sql cancelled by script [2012-12-25 19:01:13] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:13] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:13] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:13] Start up of resource sql cancelled by script [2012-12-25 19:01:13] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:13] Start up of resource players cancelled by script [2012-12-25 19:01:13] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:13] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:13] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:13] Start up of resource sql cancelled by script [2012-12-25 19:01:13] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:13] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:13] Start up of resource items cancelled by script [2012-12-25 19:01:13] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:13] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:13] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:13] Start up of resource sql cancelled by script [2012-12-25 19:01:13] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:13] Start up of resource players cancelled by script [2012-12-25 19:01:13] ERROR: Unable to start resource shops; Start up of resource cancelled by script [2012-12-25 19:01:13] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:13] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:13] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:13] Start up of resource sql cancelled by script [2012-12-25 19:01:13] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:13] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:13] Start up of resource vehicles cancelled by script [2012-12-25 19:01:13] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:13] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:13] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:13] Start up of resource sql cancelled by script [2012-12-25 19:01:13] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:13] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:13] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:13] Start up of resource sql cancelled by script [2012-12-25 19:01:14] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:14] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:14] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:14] Start up of resource sql cancelled by script [2012-12-25 19:01:14] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:14] Start up of resource players cancelled by script [2012-12-25 19:01:15] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:15] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:15] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:15] Start up of resource sql cancelled by script [2012-12-25 19:01:15] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:15] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:15] Start up of resource items cancelled by script [2012-12-25 19:01:15] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:15] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:15] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:15] Start up of resource sql cancelled by script [2012-12-25 19:01:15] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:15] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:15] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:15] Start up of resource sql cancelled by script [2012-12-25 19:01:15] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:15] Start up of resource players cancelled by script [2012-12-25 19:01:15] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:15] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:15] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:15] Start up of resource sql cancelled by script [2012-12-25 19:01:15] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:15] Start up of resource shops cancelled by script [2012-12-25 19:01:15] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:15] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:15] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:15] Start up of resource sql cancelled by script [2012-12-25 19:01:16] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:16] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:16] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:16] Start up of resource sql cancelled by script [2012-12-25 19:01:16] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:16] Start up of resource players cancelled by script [2012-12-25 19:01:16] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:16] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:16] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:16] Start up of resource sql cancelled by script [2012-12-25 19:01:16] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:16] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:16] Start up of resource items cancelled by script [2012-12-25 19:01:17] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:17] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:17] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:17] Start up of resource sql cancelled by script [2012-12-25 19:01:17] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:17] Start up of resource players cancelled by script [2012-12-25 19:01:17] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:17] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:17] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:17] Start up of resource sql cancelled by script [2012-12-25 19:01:17] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:17] Start up of resource interiors cancelled by script [2012-12-25 19:01:17] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:17] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:17] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:17] Start up of resource sql cancelled by script [2012-12-25 19:01:17] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:17] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:17] Start up of resource vehicles cancelled by script [2012-12-25 19:01:17] ERROR: Unable to connect to mysql: (1045) Access denied for user 'a2480772_nhunor5'@'localhost' (using password: YES) [2012-12-25 19:01:18] ERROR: sql\mysql.lua:42: Connection to MySQL Failed. [2012-12-25 19:01:18] Server shutdown as requested by resource sql (MySQL failed to connect.) [2012-12-25 19:01:18] Start up of resource sql cancelled by script [2012-12-25 19:01:18] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:18] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:18] Start up of resource vehicles cancelled by script [2012-12-25 19:01:18] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-12-25 19:01:18] Start up of resource maps cancelled by script [2012-12-25 19:01:18] ERROR: Unable to start resource maps; Start up of resource cancelled by script
  12. Yes this is the problem i made like in the tutorial because what was in the original archive i dont like it because it was strange and i cant find that things... --[[ Copyright (c) 2010 MTA: Paradise This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . ]] local connection = nil local connection = nil local null = nil local results = { } local max_results = 128 -- connection functions local function connect( ) -- retrieve the settings local server = get( "server" ) or "localhost" local user = get( "user" ) or "root" local password = get( "password" ) or "" local db = get( "database" ) or "mta" local port = get( "port" ) or 3306 local socket = get( "socket" ) or nil -- connect connection = mysql_connect ( server, user, password, db, port, socket ) if connection then if user == "root" then setTimer( outputDebugString, 100, 1, "Connecting to your MySQL as 'root' is strongly discouraged.", 2 ) end return true else outputDebugString ( "Connection to MySQL Failed.", 1 ) return false end end local function disconnect( ) if connection and mysql_ping( connection ) then mysql_close( connection ) end end local function checkConnection( ) if not connection or not mysql_ping( connection ) then return connect( ) end return true end addEventHandler( "onResourceStart", resourceRoot, function( ) if not mysql_connect then if hasObjectPermissionTo( resource, "function.shutdown" ) then shutdown( "MySQL module missing." ) end cancelEvent( true, "MySQL module missing." ) elseif not hasObjectPermissionTo( resource, "function.mysql_connect" ) then if hasObjectPermissionTo( resource, "function.shutdown" ) then shutdown( "Insufficient ACL rights for mysql resource." ) end cancelEvent( true, "Insufficient ACL rights for mysql resource." ) elseif not connect( ) then if connection then outputDebugString( mysql_error( connection ), 1 ) end if hasObjectPermissionTo( resource, "function.shutdown" ) then shutdown( "MySQL failed to connect." ) end cancelEvent( true, "MySQL failed to connect." ) else null = mysql_null( ) end end ) addEventHandler( "onResourceStop", resourceRoot, function( ) for key, value in pairs( results ) do mysql_free_result( value.r ) outputDebugString( "Query not free()'d: " .. value.q, 2 ) end disconnect( ) end ) -- function escape_string( str ) if type( str ) == "string" then return mysql_escape_string( connection, str ) elseif type( str ) == "number" then return tostring( str ) end end local function query( str, ... ) checkConnection( ) if ( ... ) then local t = { ... } for k, v in ipairs( t ) do t[ k ] = escape_string( tostring( v ) ) or "" end str = str:format( unpack( t ) ) end local result = mysql_query( connection, str ) if result then for num = 1, max_results do if not results[ num ] then results[ num ] = { r = result, q = str } return num end end mysql_free_result( result ) return false, "Unable to allocate result in pool" end return false, mysql_error( connection ) end function query_free( str, ... ) if sourceResource == getResourceFromName( "runcode" ) then return false end checkConnection( ) if ( ... ) then local t = { ... } for k, v in ipairs( t ) do t[ k ] = escape_string( tostring( v ) ) or "" end str = str:format( unpack( t ) ) end local result = mysql_query( connection, str ) if result then mysql_free_result( result ) return true end return false, mysql_error( connection ) end function free_result( result ) if results[ result ] then mysql_free_result( results[ result ].r ) results[ result ] = nil end end function query_assoc( str, ... ) if sourceResource == getResourceFromName( "runcode" ) then return false end local t = { } local result, error = query( str, ... ) if result then for result, row in mysql_rows_assoc( results[ result ].r ) do local num = #t + 1 t[ num ] = { } for key, value in pairs( row ) do if value ~= null then t[ num ][ key ] = tonumber( value ) or value end end end free_result( result ) return t end return false, error end function query_assoc_single( str, ... ) if sourceResource == getResourceFromName( "runcode" ) then return false end local t = { } local result, error = query( str, ... ) if result then local row = mysql_fetch_assoc( results[ result ].r ) if row then for key, value in pairs( row ) do if value ~= null then t[ key ] = tonumber( value ) or value end end free_result( result ) return t end free_result( result ) return false end return false, error end function query_insertid( str, ... ) if sourceResource == getResourceFromName( "runcode" ) then return false end local result, error = query( str, ... ) if result then local id = mysql_insert_id( connection ) free_result( result ) return id end return false, error end function query_affected_rows( str, ... ) if sourceResource == getResourceFromName( "runcode" ) then return false end local result, error = query( str, ... ) if result then local rows = mysql_affected_rows( connection ) free_result( result ) return rows end return false, error end this was the original (unchanged)
  13. local server = get( "server" ) or "localhost" local user = get( "user" ) or "a2480772_nhunor5" local password = get( "password" ) or "Ujkarim1" local db = get( "database" ) or "a2480772_rockmta" local port = get( "port" ) or 3306 local socket = get( "socket" ) or nil
×
×
  • Create New...