Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2016-07-13, 13:18


NeroNix







Wiek: 27
Na forum: 3614 dni
Posty: 69

Piwa: 1

Respekt: 40,5

Ostrzeżeń: 100%
Mam problem z DB. Wywala mi takie b??dy i to jest chyba przyczyn?, ?e nie czyta wszystkiego w Mysql.

B??d 1:
ERROR: [skrypty_glowne]/ogrpg-db/s_db.lua81attempt to call global 'mysql_query' <a nil value>



80.function pobierzTabeleWynikow(query)
81.    local result=mysql_query(SQL,query)
82.    if (not resultthen 
83.        outputDebugString("mysql_query failed: (" .. mysql_errno(SQL) .. ") " .. mysql_error(SQL))
84.        outputServerLog("mysql_query failed: (" .. mysql_errno(SQL) .. ") " .. mysql_error(SQL))
85.        return nil 
86.    end
87.    local tabela={}
88.    for result,row in mysql_rows_assoc(result) do
89.        table.insert(tabela,row)
90.    end
91.    mysql_free_result(result)
92.    return tabela
end


Drugi B??d

 ERROR: [skrypty_glowne]/ogrpg-offices/selectjobs/s_selectjob.lua:27:call failet to call 'ogrpg-db:pobierzTabeleWynikow' [string "?"]



26.setTimer(function()
27.        local result=exports["ogrpg-db"]:pobierzTabeleWynikow("SELECT * FROM ogrpg_jobs")
        if (resultthen
            for ii,vv in ipairs(result) do
                if vv["code"] ~= "SAPD" then
                    if vv["actived"] ~= getyesterday() and vv["actived"] ~= getday() then
                        local query=string.format("SELECT * FROM ogrpg_office WHERE code=%q"vv["code"])
                        local result2=exports["ogrpg-db"]:pobierzWyniki(query)
                        if (result2then
                            local query2=string.format("UPDATE ogrpg_office SET spaces=%d WHERE code=%q"result2["spaces"]-1vv["code"])
                            exports["ogrpg-db"]:dbSet(query2)
                            --local query2=string.format("UPDATE ogrpg_office SET spaces=%d WHERE code=%q"result2["spaces"]+1vv["code"])
                            --exports["ogrpg-db"]:dbSet(query2)
                            local query3=string.format("DELETE FROM ogrpg_jobs WHERE code=%q AND uid=%d AND actived=%q LIMIT 1;"vv["code"], vv["uid"], vv["actived"])
                            exports["ogrpg-db"]:dbSet(query3)
                            outputDebugString("Wyczyszczono prace!")
                        end
                    end
                end
            end
        end
    --[[if #result > 0 then
        outputServerLog(tostring(result.actived))
        for key,resulte in pairs(result) do
                outputServerLog("INFO 2:"..tostring(resulte.actived))
                if resulte.code ~= "SAPD" then
                    if resulte.actived ~= getyesterday and resulte.actived ~= getday then
                        local result2=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_office WHERE code=?"resulte.code)
                        if #result2 > 0 then
                            exports["ogrpg-db"]:dbSet("UPDATE ogrpg_office SET spaces=spaces+1 WHERE code=?"result2.spacesresult2.code)
                            exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_jobs WHERE code=? AND uid=? AND actived=?<NOW()"resulte.coderesulte.uidresulte.actived)
                            outputDebugString("Wyczyszczono prace!")
                            outputServerLog("Wyczyszczono prace!")
                        end
                    end
                end
            end
--]]        --end
end150000) -- 86400000 24h 86400000


Trzeci B??d:
ERROR: [skrypty_glowne]/ogrpg-core/vehicles.lua:94callfailet to call 'ogrpg-db:pobierzWyniki' [string "?"


Czwarty B??d:
ERROR: [skrypty_glowne]/ogrpg-core/saveplayers.lua:26callfailed to call 'ogrpg-db:pobierzWyniki' [string "?"]


Prosz? poratujcie !! ! Oczywi?cie Respekt i Piwko!!!!!!!!!

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-13, 13:23


AteX







Wiek: 26
Na forum: 4015 dni
Posty: 927
Nick w MP: #AteX

Piwa: 8360

Respekt: 775,3
Respekt: 775,3Respekt: 775,3

Nie posiadasz pewnie modu?u mysql, lecz on i tak jest przestarza?y. Polecam funkcje z mysql zamieni? na:

Więcej informacji znajdziesz w Wikipedii MTA:

dbConnect


Więcej informacji znajdziesz w Wikipedii MTA:

dbExec


Więcej informacji znajdziesz w Wikipedii MTA:

dbQuery


A jak chcesz modu? to jest do pobrania st?d: https://wiki.multitheftauto.com/wiki/Mysql

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-13, 13:31


NeroNix







Wiek: 27
Na forum: 3614 dni
Posty: 69

Piwa: 1

Respekt: 40,5

Ostrzeżeń: 100%
AteX,
Nie wiem jak to zrobi? ;( nie siedz? w Mysql m?g?by? mi pokaza? na przyk?adzie jak mam to robi??


80.function pobierzTabeleWynikow(query)
81.    local result=mysql_query(SQL,query)
82.    if (not resultthen 
83.        outputDebugString("mysql_query failed: (" .. mysql_errno(SQL) .. ") " .. mysql_error(SQL))
84.        outputServerLog("mysql_query failed: (" .. mysql_errno(SQL) .. ") " .. mysql_error(SQL))
85.        return nil 
86.    end
87.    local tabela={}
88.    for result,row in mysql_rows_assoc(result) do
89.        table.insert(tabela,row)
90.    end
91.    mysql_free_result(result)
92.    return tabela
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-13, 13:44


AteX







Wiek: 26
Na forum: 4015 dni
Posty: 927
Nick w MP: #AteX

Piwa: 8360

Respekt: 775,3
Respekt: 775,3Respekt: 775,3

Przyk?ady s? na wiki... Wystarczy znajomo?? angielskiego oraz ch?ci do nauki, a nie samego CTRL+C CTRL+V.
local qdbQuery(SQL"SELECT * FROM nazwa_tabeli")
local result dbPoll(q, -1)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-13, 16:04


NeroNix







Wiek: 27
Na forum: 3614 dni
Posty: 69

Piwa: 1

Respekt: 40,5

Ostrzeżeń: 100%
AteX, No okej :D , a jak wgra? te modu?y mysql ? ?eby wsp??pracowa?o to wszystko?

Bo pobra?em na wersj? 64 bitow? i doda?em do mtaconfig to
    <module src="mta_mysql.dll" /> 

I nadal nic ;(

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-13, 16:26


Damian_

Skrypter






Wiek: 29
Na forum: 3753 dni
Posty: 66
Nick w MP: Damian

Piwa: 3678

Respekt: 50

musisz stworzy? folder modules dodaj tam i w mta conf nadaj prawa

Podpis
Projekt serwera : ourStory
Adres Forum : www.our-story.pl
Rejestruj się już dziś !

FAQ: Potrzebujesz pomocy w kodowaniu LUA,PHP ? Pisz śmiało postaram się pomóc .
Pomagam tworzyć strony internetowe ! Potrzebujesz? Pisz

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-13, 16:37


NeroNix







Wiek: 27
Na forum: 3614 dni
Posty: 69

Piwa: 1

Respekt: 40,5

Ostrzeżeń: 100%
Damian_,
Ju? to zrobi?em. Nadal nic

Postaw piwo autorowi tego posta
 

 
Tagi: adventure :: rpg
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Adventure Rpg DB Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku