Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: boolean
1. attempt to perform arithmetic on a boolean value
witam mam taki b??d attempt to perform arithmetic on a boolean value
Kod:

setElementData(source,"player:money",getElementData(source,"player:money")+kwota)
2. attempt to index local 'result' (a boolean value)
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)

W 42 linijce:

Kod:

local result=exports['pystories-db']:dbGet('SELECT 1 FROM pystories_factions WHERE code=? AND sid=? LIMIT 1;', "SAPD", sid)
if result[1] then
3. a boolean value (mysql)
Mam problem z:
[lua]local db = exports['rpg_db']

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

[ Dodano : 2021-03-19, 20:05 ]
struktur...
4. Got boolean
[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


caly kod [lua]
--[[
autor: Eryk (nanky) Nankiewicz (©)
kontakt: [email protected]
dla: PSRPG | 2018/2019 (MTA: SA)

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 ...
5. attempt to get lenght of global 'q' (a boolean value)
Witam, ma kto? pomys? co dok?adnie powinienem zrobi?? B??d wywala na tej linijce: if #q < 1 then
Kod:

q=exports["pystories-db"]:dbSet("select ownerid,koszt,id from lss_domy where id=?", domid)
if #q < 1 then
client:outputChat("Wyst?pi? b??d, nie znaleziono takiego domu!", 255, 0, 0)
return
end
6. attempt to compare boolean with number Expected element at]
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 ...
7. DS3: bad argument #1 od 'ipars' (table expected, got boolean
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...
8. attempt to perform arithmetic on local view a boolean value)

addEventHandler
("onClientRender",root,function ()
   if 
not isPedInVehicle(localPlayerthen return end
   local veh 
getPedOccupiedVehicle(localPlayer)
   
local sx,sy,sz getElementVelocity(veh)
   
local kmhs math.ceil(((sx^2+sy^2+sz^2)^(0.5))*155)
   if 
kmhs >= 10 then
   local view 
getElementData(veh,"viewki")
        
local view view 0.015
        
if view >= 200 then return end
        local viewki 
setElementData(veh,"viewki",view)
        
setElementData(veh,"vehicle:desc","Mapa : [ "..string.format("%01d",view).." MB ]")
    
end
end
)
9. attempt to concatenate a boolean value
Siema, podczas sprawdzania dzia?alno?ci skryptu wyskakuje taki error. Daje fragment kodu. A linijka 598 zaczyna si? tak.
Kod:

desc = getPlayerName(plr).."("..getElementData(plr,"id")..") >> "..getPlayerName(target).."("..getElementData(target,"id").."): "..text

PDM-raport/server.lua:598: attempt to concatenate a boolean value

Kod:

addCommandHandler("raport", function(plr,cmd,cel,...)
if not cel then
outputChatBox("U?yj: /raport <kawa?ek nick'u> <pow?d>", plr)
return
end
local target = findPlayer(plr,cel)
if not target then
outputChatBox("Nie znaleziono podanego gracza.", plr, 255, 0, 0)
return
end
local text=table.concat({...}, " ")
desc = getPlayerName(plr).."("..getElementData(plr,"id")..") >> "..getPlayerName(target).."("..getElementData(target,"id").."): "..text
triggerClientEvent(root, "admin:addReport", resourceRoot, desc, getElementData(target,"id"))
outputChatBox("Pomy?lnie wys?ano zg?oszenie na gracza: "..getPlayerName(target), plr)
end)

Stawiam za dobr? pomoc i wyt?umaczenie :piwo: i R*

PS: Przepraszam jak z?y dzia? ale chyba dobry :) Troch? si? nie orientuj?.
10. a boolean value
Witam, od pewnego czasu m?cz? si? z prac?

jest jeden b??d




eexp 
math.random(12,22)

 
local sparrowexp getElementData(localPlayer"sparrowexp")

setElementData(localPlayer"sparrowexp"sparrowexp+eexp)-- to jest ta 116 linijka

w zapisie statystyk danych gracza jest elementData "sparrowexp"
11. a boolean value
Witam, posiadam cudzy kod jednej z pracy kosiarki i naprawiam w niej b??dy.
Mam problem poniewa? nie wiem jak naprawi? dwa errory:
Kod:


ERROR: praca/client.lua:13: attempt to perform arithmetic on local 'trawa' (a boolean value)
ERROR: praca/client.lua:8: attempt to perform arithmetic on local 'px' (a boolean value)


Kod:

addEventHandler
("onClientRender"root,
    function ()
        if 
not isPedInVehicle(localPlayerthen return end
        local veh 
getPedOccupiedVehicle(localPlayer)
        
        
local px,py,psz getElementVelocity(veh)
        
        
local predkosct math.ceil(((px^2+py^2+psz^2)^(0.5))*140)
        if 
predkosct >= 1 then
        
        local trawa 
getElementData(veh"trawa")
        
        
local zebranat trawa 0.03
        local trawa1 
setElementData(veh"trawa"zebranat)  
        
end
    end
)

addEventHandler("onClientVehicleExit"resourceRoot, function(plrseat)
    if 
seat == 0 then
        
if plr == localPlayer then
            destroyElement
(veh)
        
end
    end
end
)
12. attempt to concatenate a boolean value
nickRoot "#0066cc ["..getElementData(v,"id_uzytkownik").."] #FFFFFF"..getPlayerName )


wywala error attempt to concatenate a boolean value. ktos cos?
13. setElementData i boolean
No cze??. Znowu was nawiedzam (taki paso?yt jestem). Przejd?my to tematu. Mam skrypt na prace wszystko miodzio ale db si? czepia.

function hit (source,gracz)
if (
source == start) and getElementType (gracz) == "player" then
triggerClientEvent
("onHitStart",source)
local pojazd createVehicle(478,-1878.30151,-1559.42346,21.75000)
warpPedIntoVehicle(source,pojazd)
setElementData(gracz,"ni",pojazd)
else
if 
getElementData (gracz,"ni"then
outputChatBox 
("Nie mo?esz powt?rnie wej?? w marker !",source,255,0,0,true)
end
end
end
addEventHandler
("onMarkerHit",start,hit)


DB3:

PS: Mam tu takie piwko bo tacie zabra?em ale dobru?ne jest :D
14. Attempt to compare number with boolean
Gdy uruchamiam ten oto skrypt server-side:
function hermes()
local jedengracz getPlayerFromName(getPlayerName(player))
kasa getPlayerMoney(player)
kaska kasa 6349
if kaska then
createVehicle
(474, -1987.55243.5135.20900)
else
outputChatBox("Nie sta? Ci? na kupno Hermes'a!"jedengracz114184222)
end
end
addEvent
("kupHermes"true)
addEventHandler("kupHermes"getRootElement(), hermes)


wtedy wywala mi w debug'u b??d taki jak w temacie. Wywala on przy linijce "kasa = getPlayerMoney(player)".