Szerző Téma: Faction-system nem enged duty-zni.  (Megtekintve 1403 alkalommal)

Faction-system nem enged duty-zni.
« Dátum: 2016. Március 09. - 19:50:04 »
0 Show voters
Sziasztok. Adott egy Faction rendszer.Mivel angol még és nem tudom mi lehet az oka, ezért angol írom le a dolgokat.
Nos bele van \"építve\" már hogy Frakció Leader is tudja állítani a duty-t kedve szerint. NEm is lenne rossz hogyha:
Duty Location kiválasztva, megcsinálva, Dutyveh-jelenleg nincs autó ezért semmi és valamint a Duty Perks-ben is kivan választva minden. Elvan mentve de amikor a fegyvert stb-t állítanám be akkor \"loading-t ír\"  ahol a fegyvert kéne ráadni de ez nem gond, mysql-ben megoldható. A lényeg hogy megvan csinálva, de nem enged duty-zni. Esetleg ötlet? (Rotació minden kész benne...)

Faction-system nem enged duty-zni.
« Válasz #1 Dátum: 2016. Március 09. - 22:25:24 »
0 Show voters
Milyen módot használsz?  Mit ír a debugscript? (/debugscript 3)

Faction-system nem enged duty-zni.
« Válasz #2 Dátum: 2016. Március 10. - 05:07:54 »
0 Show voters
Szia szerintem elégé kevés gondolatolvasó van a fórumon hogy tudjuk a semmiből mi a baja a scriptednek :) csatolj 1 debugscriptet vagy küld privátba és utána tudok/unk segíteni

Faction-system nem enged duty-zni.
« Válasz #3 Dátum: 2016. Március 10. - 18:50:44 »
0 Show voters
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
« Utoljára szerkesztve: 2016. Március 10. - 19:08:38 írta anGeL »

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal