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

Wysłany: 2016-07-21, 14:29


Michaler







Wiek: 26
Na forum: 3799 dni
Posty: 77

Piwa: 1009

Respekt: 65,3

witam wyskakuje mi w DB3 taki komunikat gdy wciskam f5:

og-orglider/utils.lua:9callfailed to call 'ogrpg-db:getRekord' [string "?"]
og-orglider/utils.lua:10attempt  to get length of local 'result' (a boolean value)


mog? zdarzy? si? liter?wki podczas przepisywania. dodam ze db jest podpi?te i dziala bo wszystko inne dzia?a (rejestracja, banowanie, system pojazd?w).

Ostatnio zmieniony przez Michaler 2016-07-21, 15:33, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-21, 16:09


NeX.

Calm Story






Wiek: 26
Na forum: 3643 dni
Posty: 56
Nick w MP: NeX

Piwa: 36

Respekt: 140
Respekt: 140

Przedstaw cz??? tego kodu.
B??dy w debugscript nie wiele wnosz? do pomocy w temacie.

Podpis
Wykonuję zasoby programistyczne w języku lua. Osoby zainteresowane proszone są o kontakt.
[email protected]
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-21, 19:02


Fanciak

BOT






Wiek: 25
Na forum: 4446 dni
Posty: 728
Nick w MP: Fanciak

Piwa: 1572

Respekt: 500
Respekt: 500

Zamie? to:

getRekord


na

dbGet


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-21, 21:57


Michaler







Wiek: 26
Na forum: 3799 dni
Posty: 77

Piwa: 1009

Respekt: 65,3

Fanciak, pomog?o. jeszcze tylko jeden b??d.
og-orglider/utils.lua:10attempt  to get length of local 'result' (a boolean value)


Podpis
~~~~ NIE ODPOWIADAM NA ŻADNE KOMENTARZE ~~~~
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-21, 22:41


Fanciak

BOT






Wiek: 25
Na forum: 4446 dni
Posty: 728
Nick w MP: Fanciak

Piwa: 1572

Respekt: 500
Respekt: 500

Nie widze kodu :v

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-21, 22:43


Michaler







Wiek: 26
Na forum: 3799 dni
Posty: 77

Piwa: 1009

Respekt: 65,3

 
function getOrganizationID(plr)
    local result exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_user WHERE uid=?"getElementData(plr"player:uid"))
    if #result > 0 then
        return result[1].id
    else
        return false
    end
end

function getOrganizationName(plr,id)
    local result exports["ogrpg-db"]:getRekord("SELECT * FROM og_organizations WHERE id=?"id)
    if #result > 0 then
        return result[1].name
    else
        return false
    end
end


function isLider(plr)
    local result exports["ogrpg-db"]:getRekord("SELECT * FROM ogrpg_user WHERE uid=? AND rank=? AND id=?"getElementData(plr"player:uid"), "Lider"getOrganizationID(plr))
    if #result > 0 then
        return true
    else
        return false
    end
end

function updateMembersList(plr)
    local result exports["ogrpg-db"]:getRekord("SELECT * FROM `og_orgplayers` x, `og_users` u WHERE x.`id`=? AND u.`id`=x.`uid`"getOrganizationID(plr))
    if #result > 0 then
        for i,v in ipairs(result) do
            triggerClientEvent("onClientShowPlayersOrganization"plrv.idv.loginv.rank)
        end
    end
end


Podpis
~~~~ NIE ODPOWIADAM NA ŻADNE KOMENTARZE ~~~~
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-21, 23:26


Fanciak

BOT






Wiek: 25
Na forum: 4446 dni
Posty: 728
Nick w MP: Fanciak

Piwa: 1572

Respekt: 500
Respekt: 500

function getOrganizationID(plr)
    local result exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_user WHERE uid=?"getElementData(plr"player:uid"))
    if result and #result > 0 then
        return result[1].id
    else
        return false
    end
end

function getOrganizationName(plr,id)
    local result exports["ogrpg-db"]:dbGet("SELECT * FROM og_organizations WHERE id=?"id)
    if result and #result > 0 then
        return result[1].name
    else
        return false
    end
end


function isLider(plr)
    local result exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_user WHERE uid=? AND rank=? AND id=?"getElementData(plr"player:uid"), "Lider"getOrganizationID(plr))
    if result and #result > 0 then
        return true
    else
        return false
    end
end

function updateMembersList(plr)
    local result exports["ogrpg-db"]:dbGet("SELECT * FROM `og_orgplayers` x, `og_users` u WHERE x.`id`=? AND u.`id`=x.`uid`"getOrganizationID(plr))
    if result and #result > 0 then
        for i,v in ipairs(result) do
            triggerClientEvent("onClientShowPlayersOrganization"plrv.idv.loginv.rank)
        end
    end
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-22, 00:22


Michaler







Wiek: 26
Na forum: 3799 dni
Posty: 77

Piwa: 1009

Respekt: 65,3

errory wyeliminowane :) ale teraz ukaza? si? warning:
ogrpg-db/s_db.lua:27dbPoll failedUnknown column 'uid' in 'where clause'
jezeli jaki? kod potrzebny to zaraz dam.

Podpis
~~~~ NIE ODPOWIADAM NA ŻADNE KOMENTARZE ~~~~
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-22, 00:45


Fanciak

BOT






Wiek: 25
Na forum: 4446 dni
Posty: 728
Nick w MP: Fanciak

Piwa: 1572

Respekt: 500
Respekt: 500

Przyda?oby si?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-22, 00:47


Michaler







Wiek: 26
Na forum: 3799 dni
Posty: 77

Piwa: 1009

Respekt: 65,3

tego ogrpg-db tak?

[ Dodano: 2016-07-22, 01:09 ]
db


-- Settings
DBHandler=nil
DBName="db_xxx"
DBUser="db_xxx"
DBPass="xxx" 
DBHost="sqlxxx"

-- Functions
function dbSet(...)
    if not {...} then return end
    local stringe=dbPrepareString(DBHandler,...)
    local query=dbExec(DBHandlerstringe)
    return query
end

function dbGet(...)
    if not {...} then return end
    local stringe=dbPrepareString(DBHandler,...)
    local query=dbQuery(DBHandlerstringe)
    local result=dbPoll(query, -1)
    return result
end


addEventHandler("onResourceStart"resourceRoot, function()
    DBHandler=dbConnect("mysql""dbname="..DBName..";host="..DBHost..""DBUserDBPass"share=1;autoreconnect=1")
    if DBHandler then
        outputDebugString("* Connect to server MYSQL...")
        dbSet("SET NAMES utf8")
    else
        outputDebugString("* No Connecting to server MYSQL..")
    end
end)


local SQL_LOGIN="db_xxx"
local SQL_PASSWD="xxx"
local SQL_DB="db_xxx"
local SQL_HOST="sql-xxx"
local SQL_PORT=3306

local root getRootElement()

local SQL

local function connect()
    SQL mysql_connect(SQL_HOSTSQL_LOGINSQL_PASSWDSQL_DBSQL_PORT)
    if (not SQLthen
        outputServerLog("BRAK POLACZENIA Z BAZA DANYCH!")
    else
        --mysql_query(SQL,"SET NAMES utf8")
        --outputServerLog("Modul mysql polaczony!")
    end

end


local function keepAlive()
    if (not mysql_ping(SQL)) then
        outputServerLog("Zerwane polaczenie z baza danych, nawiazywanie...")
        connect()
    end
end
addEventHandler("onResourceStart",getResourceRootElement(),function()
    connect()
    setTimer(keepAlive300000)
end)

function esc(value)
    return mysql_escape_string(SQL,value)
end

function pobierzTabeleWynikow(query)
    local result=mysql_query(SQL,query)
    if (not resultthen 
        outputDebugString("mysql_query failed: (" .. mysql_errno(SQL) .. ") " .. mysql_error(SQL))
        outputServerLog("mysql_query failed: (" .. mysql_errno(SQL) .. ") " .. mysql_error(SQL))
        return nil 
    end
    local tabela={}
    for result,row in mysql_rows_assoc(result) do
        table.insert(tabela,row)
    end
    mysql_free_result(result)
    return tabela
end

function pobierzWyniki(query)
    local result=mysql_query(SQL,query)
    if (not resultthen return nil end
    row mysql_fetch_assoc(result)
    mysql_free_result(result)
    return row
end


function zapytanie(query)
    local result=mysql_query(SQL,query)
    if (resultthen mysql_free_result(result) return true end
    return
end

function insertID()
    return mysql_insert_id(SQL)
end

function affectedRows()
    return mysql_affected_rows(SQL)
end


function fetchRows(query)
    local result=mysql_query(SQL,query)
    if (not resultthen return nil end
    local tabela={}

    while true do
        local row mysql_fetch_row(result)
        if (not rowthen break end
        table.insert(tabela,row)
    end
    mysql_free_result(result)
    return tabela
end


function getSQLLink()
    return SQL
end


[ Dodano: 2016-07-22, 01:16 ]
http://www64.zippyshare.com/v/Z91ELxso/file.html a tu jest ca?y skrypt og-orglider

Podpis
~~~~ NIE ODPOWIADAM NA ŻADNE KOMENTARZE ~~~~
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-22, 12:18


eject

kurdebele






Wiek: 30
Na forum: 3659 dni
Posty: 182
Nick w MP: EjecT

Piwa: 2456

Respekt: 85,8

Ostrzeżeń: 60%
W jakiej? tabeli nie ma kolumny uid lub jest ona pusta

Postaw piwo autorowi tego posta
 

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


Michaler







Wiek: 26
Na forum: 3799 dni
Posty: 77

Piwa: 1009

Respekt: 65,3

no jak tak do trudno. dzi?ki za pomoc. lec? piwka dla pan?w

Podpis
~~~~ NIE ODPOWIADAM NA ŻADNE KOMENTARZE ~~~~
Postaw piwo autorowi tego posta
 

 
Tagi: problem :: og-orglider :: (błędy :: db3)
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA 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