Szerző Téma: New MTA mysql nem indul el.  (Megtekintve 1958 alkalommal)

New MTA mysql nem indul el.
« Dátum: 2017. január 09. - 16:20:44 »
0 Show voters
Sziasztok letöltöttem mivel elvileg see v2 és megszeretném nézni mi merre.. csakhogy nem indul el az sgs_mysql resource és a log nem ír róla semmit csak annyit hogy [2017-01-09 10:10:37] ERROR: sgs_accounts/sources.lua:1: exports: Call to non-running server resource (sgs_mysql) [string \"?\"]
 
mysql:
 

local hostname = \"127.0.0.1\"
local username = \"mta_22299\"
local password = \"h6p5bLxI\"
local database = \"mta_22299\"
local port = 3306
local MySQLConnection = nil
local resultPool = { }
local sqllog = false
local countqueries = 0
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)

function destroyDatabaseConnection()
if (not MySQLConnection) then
   return nil
end
mysql_close(MySQLConnection)
return nil
end
addEventHandler(\"onResourceStop\", getResourceRootElement(getThisResource()), destroyDatabaseConnection, false)
function sgs_logsQLError(str)
local message = str or \'N/A\'
outputDebugString(\"MYSQL ERROR \"..mysql_errno(MySQLConnection) .. \": \" .. mysql_error(MySQLConnection))
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
function ping()
if (mysql_ping(MySQLConnection) == false) then
   destroyDatabaseConnection()
   connectToDatabase(nil)
   if (mysql_ping(MySQLConnection) == false) then
      sgs_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)
countqueries = countqueries + 1

if (ping()) then
   local result = mysql_query(MySQLConnection, str)
   if (not result) then
      sgs_logsQLError(str)
      return false
   end
   local resultid = getFreeResultPoolID()
   resultPool[resultid] = result
   return resultid
end
return false
end
function unbuffered_query(str)
countqueries = countqueries + 1

if (ping()) then
   local result = mysql_unbuffered_query(MySQLConnection, str)
   if (not result) then
      sgs_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
end
function queryNullaz()
countqueries = 0
end

 
s_mysql: 
 

username =  \"mta_22299\"
password =  \"h6p5bLxI\"
db = \"mta_22299\"
host = \"127.0.0.1\"
port = 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

 
Mtaserver.conf :  <module src=\"mta_mysql.so\"/>
 
<resource src=\"sgs_mysql\" startup=\"1\" protected=\"0\"/>
 
 
 
 
 
SG functions mappába a mysql : 
 

local host = \"127.0.0.1\"
local username = \"mta_22299\"
local password = \"h6p5bLxI\"
local db = \"mta_22299\"
local results = {}
addEventHandler(\"onResourceStart\", resourceRoot, function()
dbHandler = dbConnect(\"mysql\",\"dbname=\".. db ..\";host=\"..host, username, password, \"autoreconnect=1\")
if not dbHandler then
   outputChatBox(\"#1 mysql kapcsolódás meghiúsult\")
   cancelEvent(true)
end
end)
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
function query_free(q,poll)
local this = #results + 1
results[this] = dbQuery(dbHandler, q)
if poll then
   local result, num_affected_rows, last_insert_id = dbPoll(results[this], -1)
   if result == nil then
      dbFree(results[this])
      return this, nil
   elseif result == false then
      dbFree(results[this])
      return this, nil
   else
      dbFree(results[this])
      return this, tonumber(last_insert_id)
   end
end
dbFree(results[this])
return this
end
function getConnection()
return dbHandler
end
function singleQuery(str,...)
    if (dbHandler) then
        local query = dbQuery(dbHandler,str,...)
        local result = dbPoll(query,-1)
        if (type(result == \"table\")) then
      return result[1]
        else
      return result
        end
    else
        return false
    end
end
function execute(str)
    if (dbHandler) then
   local query, id = query_free(str, true)
   return query
    else
        return false
    end
end
function getFreeResultPoolID()
return #results + 1
end
function escape_string(str)
if (str) then
   return str
end
return false
end
function query_rows_assoc(str,...)
    if (dbHandler) then
   local this = #results + 1
   results[this] = dbQuery(dbHandler, str, ...)
   return dbPoll(results[this],-1)
    else
        return false
    end
end
function query(str,...)
    if (dbHandler) then
   return query_rows_assoc(str,...)
    else
        return false
    end
end
function query_fetch_assoc(str,...)
if(not str)then
   return false
end
return singleQuery(str,...)
end
function query_insert_free(str)
    if (dbHandler) then
   local query, id = query_free(str, true)
   return id
    else
        return false
    end
end
function num_rows(result)
if(not result)then
   return 0
end
if (type(result == \"table\")) then
   return (#result or 0)
else
   return 1
end
end

 
 

New MTA mysql nem indul el.
« Válasz #1 Dátum: 2017. január 09. - 20:11:48 »
0 Show voters
Beszarok. :D Régen beszéltem ennek a szervernek a tulajdonosával, és, hát nem csak see-t használt, hanem SAS-t is. :D Elkezdett egy Metin2 in MTA szervert, azért van a HUD-ban egy-két metines kép. :D Ne haragudj, hogy a kérdésedre nem tudtam választ adni, megnézem gyorsan. :D

New MTA mysql nem indul el.
« Válasz #2 Dátum: 2017. január 09. - 20:21:28 »
0 Show voters
Rájöttem. előre kell írni az sgs_mysql,  meg sgs_core-t mtaserver.conf-ba viszont a karakterkészítés elő se jön mert erre a sorra 
 

            spawnPlayer(source, -2314.1779785156, 1543.7047119141, 18.7734375, 270, 0, 14, 65000+playerid)

 
ezt írja :  attempt to perform arithmetic on local \'playeridd\' (a boolean value)

New MTA mysql nem indul el.
« Válasz #3 Dátum: 2017. január 09. - 20:32:25 »
0 Show voters
playerid van megadva a spawnPlayer-ben, viszont playeridd a gond. Keress rá, a \"playeridd\"-re.

New MTA mysql nem indul el.
« Válasz #4 Dátum: 2017. január 09. - 20:39:25 »
0 Show voters
ja nem, csak elírtam 1 d-t .. 1d vel van írva

New MTA mysql nem indul el.
« Válasz #5 Dátum: 2017. január 09. - 20:41:22 »
0 Show voters
Érdekes. Mi lenne ha kiszednéd azt a playerid-t onnan?

New MTA mysql nem indul el.
« Válasz #6 Dátum: 2017. január 09. - 20:43:37 »
0 Show voters
ugyan ezt írja

New MTA mysql nem indul el.
« Válasz #7 Dátum: 2017. január 09. - 20:45:31 »
0 Show voters
A conf-ot el tudod küldeni? Lusta vagyok most beírogatni. :D Megnézem gyorsan.

New MTA mysql nem indul el.
« Válasz #8 Dátum: 2017. január 09. - 20:46:51 »
0 Show voters
mtaserver.confot?

New MTA mysql nem indul el.
« Válasz #9 Dátum: 2017. január 09. - 20:47:04 »
0 Show voters
Igen-igen.

New MTA mysql nem indul el.
« Válasz #10 Dátum: 2017. január 09. - 20:47:55 »
0 Show voters



   

<config>
   
    <!-- Itt adhatod meg a szerverednek a sgs_ét, és ezen a néven tudják felkeresni a játékosok
    az MTA-n belül! A \"| by: PixelHosting.eu\"-t semmiképp ne vedd le a szervered sgs_éből, különben törölni fogjuk a szervered! -->
    <servername>MTA Szerver | by: PixelHosting.eu</servername>
   
    <!-- Ezt ne írd át, hiszen automatikusan visszaírja! -->
    <serverip></serverip>
   
    <!-- Ezt ne írd át, hiszen automatikusan visszaírja! -->
    <serverport>22003</serverport>
   
    <!-- Ezt ne írd át, hiszen automatikusan visszaírja! -->
    <maxplayers>32</maxplayers>
   
    <!-- Ezt ne írd át, hiszen automatikusan visszaírja! -->
    <httpport>22005</httpport>
   
    <httpdownloadurl></httpdownloadurl>
    <httpmaxconnectionsperclient>5</httpmaxconnectionsperclient>
    <httpdosthreshold>20</httpdosthreshold>
    <http_dos_exclude></http_dos_exclude>
    <allow_gta3_img_mods>none</allow_gta3_img_mods>
    <disableac></disableac>
    <enablesd></enablesd>
    <minclientversion>1.5.3-9.10835.0</minclientversion>
    <minclientversion_auto_update>1</minclientversion_auto_update>
    <recommendedclientversion></recommendedclientversion>
    <ase>1</ase>
    <donotbroadcastlan>0</donotbroadcastlan>
   
    <!-- Itt tudod megadni a szervered jelszavát! -->
    <password></password>
   
    <bandwidth_reduction>medium</bandwidth_reduction>
    <player_sync_interval>100</player_sync_interval>
    <lightweight_sync_interval>1500</lightweight_sync_interval>
    <camera_sync_interval>500</camera_sync_interval>
    <ped_sync_interval>400</ped_sync_interval>
    <unoccupied_vehicle_sync_interval>400</unoccupied_vehicle_sync_interval>
    <keysync_mouse_sync_interval>100</keysync_mouse_sync_interval>
    <keysync_analog_sync_interval>100</keysync_analog_sync_interval>
    <bullet_sync>1</bullet_sync>
    <vehext_percent>0</vehext_percent>
    <vehext_ping_limit>150</vehext_ping_limit>
    <latency_reduction>0</latency_reduction>
    <idfile>server-id.keys</idfile>
    <logfile>logs/server.log</logfile>
    <authfile>logs/server_auth.log</authfile>
    <dbfile>logs/db.log</dbfile>
    <acl>acl.xml</acl>
    <scriptdebuglogfile>logs/scripts.log</scriptdebuglogfile>
    <scriptdebugloglevel>0</scriptdebugloglevel>
    <htmldebuglevel>0</htmldebuglevel>
    <filter_duplicate_log_lines>1</filter_duplicate_log_lines>
    <fpslimit>99</fpslimit>
    <autologin>0</autologin>
    <voice>0</voice>
    <voice_samplerate>1</voice_samplerate>
    <voice_quality>4</voice_quality>
    <backup_path>backups</backup_path>
    <backup_interval>3</backup_interval>
    <backup_copies>5</backup_copies>
    <compact_internal_databases>1</compact_internal_databases>
    <crash_dump_upload>1</crash_dump_upload>
   
    <!-- Ide írhatod be a resource-nek a sgs_eit, ez elengedhetetlen ahoz, hogy tökéletesen müködjenek! -->
   
    <module src=\"mta_mysql.so\" />
   
    <resource src=\"sgs_core\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_mysql\" startup=\"1\" protected=\"0\" />
    <resource src=\"as\" startup=\"1\" protected=\"0\" />
    <resource src=\"bmw\" startup=\"1\" protected=\"0\" />
    <resource src=\"cursor_rotalas\" startup=\"1\" protected=\"0\" />
    <resource src=\"kavics_a\" startup=\"1\" protected=\"0\" />
    <resource src=\"kavics_b\" startup=\"1\" protected=\"0\" />
    <resource src=\"mts_pdrive\" startup=\"1\" protected=\"0\" />
    <resource src=\"sas_radar\" startup=\"1\" protected=\"0\" />
    <resource src=\"scott_eltunteti\" startup=\"1\" protected=\"0\" />
    <resource src=\"seevmap\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_accounts\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_administration\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_animals_\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_arrow\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_cache\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_cards\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_chat\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_construction\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_damage\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_disco\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_dog\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_friendzone\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_gps\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_info\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_infobox\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_infos\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_injure\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_interior\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_inuyashaskin\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_item\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_itemshop\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_jobhandler\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_license\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_loader\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_logs\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_maps\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_mods\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_names\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_nametags\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_nightshader\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_peds\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_playereffects\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_radar\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_refill\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_save\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_scoreboard\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_snev\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_taxiclock\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_utils\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_vehiclepanel\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_vehicles\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_walkstyle\" startup=\"1\" protected=\"0\" />
    <resource src=\"sgs_weather\" startup=\"1\" protected=\"0\" />
    <resource src=\"shader_radar\" startup=\"1\" protected=\"0\" />
    <resource src=\"skin_sgs\" startup=\"1\" protected=\"0\" />
    <resource src=\"valami\" startup=\"1\" protected=\"0\" />
    <resource src=\"x_radio\" startup=\"1\" protected=\"0\" />
    <resource src=\"bmw_hand\" startup=\"1\" protected=\"0\" />
    <resource src=\"raba_mod\" startup=\"1\" protected=\"0\" />
    <resource src=\"shader_bloom\" startup=\"1\" protected=\"0\" />
    <resource src=\"shader_contrast\" startup=\"1\" protected=\"0\" />
    <resource src=\"shader_detail\" startup=\"1\" protected=\"0\" />
    <resource src=\"shader_skybox_alt\" startup=\"1\" protected=\"0\" />
   
</config>

   
       
   

[/quote]
 
 

New MTA mysql nem indul el.
« Válasz #11 Dátum: 2017. január 09. - 21:21:26 »
0 Show voters
Na megvan. 
 

   local playerid = getElementData(thePlayer, \"playerid\") or 0
spawnPlayer(thePlayer, -2314.1779785156, 1543.7047119141, 18.7734375, 270, 0, 14, 65000+tonumber(playerid))

 
 

New MTA mysql nem indul el.
« Válasz #12 Dátum: 2017. január 09. - 21:31:54 »
0 Show voters

local playerid = getElementData(getLocalPlayer(), \"playerid\")
      setElementDimension(getLocalPlayer(), 65000+playerid)

 
ez meg most client oldalon..

New MTA mysql nem indul el.
« Válasz #13 Dátum: 2017. január 09. - 21:33:40 »
0 Show voters
megoldottam :D

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal