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: got
1. Bad argument #1 to 'ipairs' (table expected, got boolean)
Witam, zaczn? ?e jestem ca?kowicie zielony w tym temacie :-? , ale wracaj?c
od pewnego czasu zacz??em bawi? si? paczk? MTA, wszystkie skrypty z bazami danych dzia?aj?, ale nie dzia?a jeden z nich. Jest to skrypt do systemu dom?w.
Po jego uruchomieniu wyrzuca b??d: interiory.lua:26: bad argument #1 to 'ipairs' (table expected, got boolean). Wrzucam tutaj skrypt interiory.lua z tym b??dem.
Po rozwi?zaniu problemu stawiam zimne :piwo:


interiory
={}


local dane=exports.srdb2:pobierzTabeleWynikow("SELECT id,interior,entrance,`exit` FROM domy_interiory WHERE `exit` IS NOT NULL AND active=1")
for 
_,v in ipairs(dane) do
local ii tonumber(v.id)
v.entrance=split(v.entrance,",")
v.id=nil
interiory
[ii]=v
end

addEvent
("moveMeTo"true)
addEventHandler("moveMeTo"resourceRoot, function(x,y,z,i,d)
setElementDimension(clientd)
setElementInterior(client,i,x,y,z)
setElementPosition(client,x,y,z)
setElementInterior(client,i)
end)
2. 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 ...
3. Bad argument @ 'bindKey' [Expected player at argument 1, got
z?y argument ? nie czaje tego za cholere my?la?em ,?e wszystko dobrze napisa?em

bindKey
("e""down", function(player)
4. Expected number, got non-convertible string
Witam przychodz? z b??dem kt?ry pierwszy raz mi si? pojawi?.
strona Servera
addEvent("iyw_kurier:give_cash"true)
addEventHandler("iyw_kurier:give_cash"root, function(money)
    if 
money then
        local ss 
getElementData(client,"player:scorespedytor")
        
local sid getElementData(client,"player:sid")
        
givePlayerMoney(client,money)
        
setElementData(client,"player:scorespedytor",ss+1)
        
exports["pystories-db"]:dbSet("UPDATE pystories_users SET scorespedytor=? WHERE id=?"ss+1getElementData(client"player:sid"))
    
end
end
)


bl?d
Expected numbergot non-convertible stringThis warning may be an error in future versions.

i chodzi tu g??wnie o linijk?
givePlayerMoney(client,money)
5. addEventHandler [Expected element at argument 2, got nil]
Wszystko dzia?a na pocz?tku tylko paczki nie mo?na odda? do drugiego markera
addEventHandler("onClientMarkerHit", markerx, function(el, md)
[lua]
function startjob2()
if source ~= buttonstart2 then return end
if getElementData(localPlayer, "mamskrzynke") == true
then outputChatBox("Masz ju? skrzynke!") return end
losuj = math.random ( 1, #markery )
local markerx = createMarker(markery[losuj][1],markery[losuj][2],markery[losuj][3], markery[losuj][4], markery[losuj][5], markery[losuj][6], markery[losuj][7], markery[losuj][8], markery[losuj][9])
blip = createBlipAttachedTo(markerx, 41)
setElementData(localPlayer, "mamskrzynke", true)
box = createObject(2912, 0, 0, 0)
attachElements(box, localPlayer, 0, 0.78, 0.3)
toggleControl ("sprint", false)
toggleControl ("jump", false)
toggleControl ("fire", false)
end
setPedAnimation(localPlayer, "carry", "crry_prtial", 1, false, true)
addEventHandler("onClientMarkerHit", markerx, function(el, md)
if localPlayer == el and md then
setPedAnimation(localPlayer, "CARRY", "putdwn", -1, true, false, false)
setTimer(function()
setElementData(localPlayer, "wezpaczke", false)
setElementData(l...
6. Expected number, got non-convertible string. This warning ma
WARNING: SKRYPTc.lua:136 Expected number, got non-convertible string. This warning may be an error in future version.

exports["INNY_SKRYPT"]:createCustomWindow("TEKST"screenW 0.6615y3screenW 0.2023screenH 0.2830tocolor(255255255a), false)
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. isPlayerInTeam [player expected, got nil]
Wie kto? mo?e co tu jest nie tak? W konsoli wywala b??d "Bad argument 1 @ isPlayerInTeam [player expected, got nil]". Dopiero co zacz??em pisa? skrypty :->

Kod:

brama = createObject ( 980, 1587.9000244141, -1638.3000488281, 13.89999961853, 0, 0, 0 )

function isPlayerInTeam(player, team)
assert(isElement(player) and getElementType(player) == "player", "Bad argument 1 @ isPlayerInTeam [player expected, got " .. tostring(player) .. "]")
assert((not team) or type(team) == "string" or (isElement(team) and getElementType(team) == "team"), "Bad argument 2 @ isPlayerInTeam [nil/string/team expected, got " .. tostring(team) .. "]")
return getPlayerTeam(player) == (type(team) == "string" and getTeamFromName(team) or (type(team) == "userdata" and team or (getPlayerTeam(player) or true)))
end


addCommandHandler("open",function()
local team = getTeamFromName("Milicja")
if isPlayerInTeam(source, team) then
moveObject ( brama, 2500, 1587.9000244141, -1638.3000488281, 8.5 )
end
end)


addCommandHandler("close",function()
local team = getTeamFromName("Milicja")
if isPlayerInTeam(source, team) then
moveObject ( brama, 2500, 1587.9000244141, -1638.3000488281, 13.89999961853 )
end
end )
9. Expected element at argument 2, got to function
Witam, g?owie si? nad tym z 15 minut nie wiem o co mo?e chodzi?.
Wyskakuje mi taki b??d.
Expected element at argument 2, got to function
Oto kod

function psk1 (localPlayer,md)
omarker createMarker(2776.13086, -2495.7402313.66451"cylinder",0.8,0,10,230)
destroyElement(skrzynka1,md)
destroyElement(skrzynkamarker,md)
--
triggerServerEvent("skrzynkao",sd)
end
addEventHandler
("podnies",psk1,root)