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
[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 ...
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...
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
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 )