Elnézést kérek hogy nem írtam ki.....
[2016-03-10 18:40:07] ERROR: duty\\g_duty.lua:66: bad argument #1 to \'pairs\' (table expected, got boolean)
[2016-03-10 18:40:13] ERROR: duty\\g_duty.lua:66: bad argument #1 to \'pairs\' (table expected, got boolean)
[2016-03-10 18:40:15] ERROR: duty\\g_duty.lua:66: bad argument #1 to \'pairs\' (table expected, got boolean)
[2016-03-10 18:40:21] ERROR: duty\\g_duty.lua:66: bad argument #1 to \'pairs\' (table expected, got boolean) [DUP x2]
[/quote]
Dupla hozzászólás automatikusan összefûzve. ( [time]2016. március 10. 18:58:04[/time] )
SCript része:
function fetchAvailablePackages( targetPlayer )
local availablePackages = { }
local factionID = tonumber(getElementData(targetPlayer, \"faction\"))
local factionDuty = getElementData(resourceRoot, \"factionDuty\")
local factionLocations = getElementData(resourceRoot, \"factionLocations\")
local DutyColShapes = getElementData(resourceRoot, \"DutyColShapes\")
if factionDuty[factionID] then
for i, factionPackage in pairs ( factionDuty[factionID] ) do -- Loop all the faction packages
local found = false
for index, v in pairs ( factionPackage[4] ) do -- Loop all the colshapes of the factionpackage
if isElement(DutyColShapes[factionID][tonumber(index)]) then
if isElementWithinColShape( targetPlayer, DutyColShapes[factionID][tonumber(index)] ) then
found = true
break -- We found this package already, no need to search the other colshapes
end
end
end
local veh = getPedOccupiedVehicle(targetPlayer) -- Still can\'t find it? Lets see if they are in a duty vehicle
if not found and veh then
local vehid = getElementData(veh, \"dbid\")
for k,v in pairs(factionLocations[factionID]) do
if tonumber(vehid) == tonumber(v[9]) then -- Yep vehicle ID matches!
found = true
end
end
end
if found and canPlayerUseDutyPackage(targetPlayer, i) then
table.insert(availablePackages, factionPackage)
end
end
end
local resource = getResourceRootElement(getResourceFromName(\"faction-system\"))
if resource then
allowList = getElementData(resource, \"dutyAllowTable\")
for k,v in pairs(allowList) do
if tonumber(v[1]) == factionID then
key = k
break
end
end
allowList = allowList[key][3]
end
return availablePackages, allowList
end