Siema, mam taki problem, doda?em si? do SAPD w mysql i gdy klikam rozpocznij sluzbe pojawia si? w debugscript zebym sprawdzil linijke 42 w s.duty_lua attempt to index local 'result' (a boolean value)
addEvent('login', true)
addEventHandler('login', root, function(login, pass)
local res = db:query("SELECT * FROM authorize WHERE login=?", login)
local resm = db:query(res, -1)
if resm[1].login == 0 then
outputChatBox('takie konto nie istnieje k****')
return
end
if resm[1].pass ~= pass then
outputChatBox('zle haslo')
return
end
setElementData(client, "player:dbid", res[1].dbid)
end)
addEvent('new', true)
addEventHandler('new', root, function(login, pass)
local res = db:query('SELECT * FROM authorize WHERE login=?', login)
local resm = db:query(res, -1)
if #resm > 0 then
outputChatBox('takie konto juz jest')
return
end
db:execute('INSERT INTO authorize (login,pass) VALUES (?,?)', login, pass)
outputChatBox('zrobiles konto')
end)[/lua]
[lua]
function query(...)
local queryHandle = dbQuery(DBConnection, ...)
if (not queryHandle) then
return nil
end
local rows = dbPoll(queryHandle, -1)
return rows
end
function execute(...)
local queryHandle = dbQuery(DBConnection, ...)
local result, numRows = dbPoll(queryHandle, -1)
return numRows
end[/lua]
query i execute:
db3:
[img]https://i.imgur.com/ZRjh34I.png[/img]
pierwsze dwie s? od logowania,
pozosta?e dwie od rejestracji
[lua]addCommandHandler("sara-zaladuj", function(player, command)
if isPedInVehicle(player) then
local veh = getPedOccupiedVehicle(player)
if getElementModel(veh) == 578 and not getElementData(veh, "zaladowane") and getElementData(veh, "laweta") then
if getElementModel(veh) == 578 then
local pojazd = getElementsWithinColShape(colspheres[veh], "vehicle")
attachElements(pojazd[1], veh, 0, -1.2, 0.5)
setElementData(veh, "zaladowane", pojazd[1])
setElementFrozen(pojazd[1], true)
setElementCollisionsEnabled(pojazd[1], false)
end
else
triggerClientEvent(player, "onClientAddNotification", player, "Na lawecie #bf0101znajduje #FFFFFFsi? pojazd", "error" )
end
end
end)
[/lua]
nie wiem czemu ale w tym miejscu [lua]attachElements(pojazd[1], veh, 0, -1.2, 0.5)[/lua] DB3 mowi ze pojazd jest wartoscia boolean
licencja: Art. 67
- 1. Tw?rca mo?e udzieli? upowa?nienia do korzystania z utworu na wymienionych w umowie polach eksploatacji z okre?leniem zakresu, miejsca i czasu tego korzystania.
- 2. Je?eli umowa nie zastrzega wy??czno?ci korzystania z utworu w okre?lony spos?b (licencja wy??czna), udzielenie ...
Witam posiadam dwa problemy
[19-07-24 22:37:57] ERROR: busty/bust_s.lua:20: attempt to compare boolean with number
[19-07-24 22:37:57] WARNING: busty/bust_s.lua:20: Bad argument @ 'getElementData' [Expected element at argument 1, got string 'down']
[lua]
function setbustrpday(plr,days)
if getbustday(plr) then
local queryA=exports['pystories-db']:dbSet(string.format("UPDATE pystories_users SET bust_rp = DATE(bust_rp) + INTERVAL %d DAY WHERE id=%d",days,getElementData(plr,"player:sid")))
return end
local queryA=exports['pystories-db']:dbSet(string.format("UPDATE pystories_users SET bust_rp = DATE(curdate()) + INTERVAL %d DAY WHERE id=%d",days,getElementData(plr,"player:sid")))
end
function getbustday(plr)
local queryA=exports['pystories-db']:dbGet("SELECT * FROM pystories_users WHERE id=? AND bust_rp>NOW() LIMIT 1", getElementData(plr,"player:sid"))
if (queryA and #queryA > 0) then
return queryA[1].bust_rp
end
return false
end
addEvent("dajbusta", true)
addEventHandler("dajbusta", resourceRoot, function(dni,plr,value)
if getElementData(plr,"player:pktgry") == 10 then triggerClientEvent(plr, 'onClientAddNotification', plr, "Kupi?e? busta RP na 1 dzie? ", 'succes')--linijka 18
else
if not getElementData(plr,"player:pktgry")<10 then triggerClientEvent(plr, 'onClientAddNotification', plr, "Nie posiadasz odpowiedniej ...
Wi?c, pr?buje przenie?? system wzywania z ITS 2017 na Pystories 3.0
Wi?c typowo "elementdaty" zosta?y zmienione na odpowiadaj?ce byciu na "s?u?bie" w frakcji, jak i te? rozwi?za?em problem z "font'em". tylko zacz?? pojawia? si? nowy problem, polegaj?cy na tym ?e nie pojawiaj? si? zg?oszenia (mimo tego ?e s? zapisywane w bazie danych) jak i te? pojawia si? b??d w DS3:
[code]ERROR: (?cie?ka skryptu)iyw_zawiadomieniac.lua:209: bad argument #1 od 'ipars' (table expected, got boolean)[/code]
tak wygl?da kawa?ek kodu gdzie wyst?puje b??d:
[lua]addEvent("ZAWIADOMIENIA:SHOWLIST", true)
addEventHandler("ZAWIADOMIENIA:SHOWLIST", localPlayer, function(q,duty)
frakcja=duty
if not isElement(gridlist) then
gridlist = guiCreateGridList(332*w, 288*h, 703*w, 179*h, false)
guiGridListAddColumn(gridlist, "Zg?aszaj?cy:", 0.3)
guiGridListAddColumn(gridlist, "Opis zdarzenia:", 0.2)
guiGridListAddColumn(gridlist, "Data:", 0.2)
guiGridListAddColumn(gridlist, "Lokalizacja:", 0.2)
guiGridListAddColumn(gridlist, "DBID:", 0.1)
guiGridListAddColumn(gridlist, "SID:", 0)
dxfont0_1 = dxCreateFont(":pystories-logging/font/1.ttf", 10)
addEventHandler("onClientRender", root, render)
addEventHandler("onClientClick", root, click)
editing=false
showCursor(true)
for i,v in ipairs(q) do
local row=guiGridListAddRow(gridlist)
i...
Siema, podczas sprawdzania dzia?alno?ci skryptu wyskakuje taki error. Daje fragment kodu. A linijka 598 zaczyna si? tak.
PDM-raport/server.lua:598: attempt to concatenate a boolean value
Stawiam za dobr? pomoc i wyt?umaczenie i
PS: Przepraszam jak z?y dzia? ale chyba dobry Troch? si? nie orientuj?.