Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2021-12-31, 21:49


HarnesHa12







Wiek: 25
Na forum: 1824 dni
Posty: 5



Respekt: 50

Witam, dzi? zacz??em bawi? si? paczk? OwlGaming, gdy doda?em siebie do frakcji oraz stworzy?em miejsce znacznik /duty to gdy zaczynam wpisywa? /duty komenda nie odpowiada tak jakby nie istnia?a, jeszcze raz powtarzam ja si? tylko bawi? to paczk?, nie chce tworzy? jakiego? g?wna za przeproszeniem na MTA z paczk? owla.

[ Dodano: 2022-01-01, 02:32 ]
Ma?a aktualizacja, po jakie? godzinie znalaz?em poradnik aby doda? tabele w MySQL, teraz komenda odpowiada, lecz gdy jestem w polu duty, kt?ry przed chwil? zrobi?em, komenda zacze?a wy?wietla? "There is no duty available for you at this spot!" a jestem w miejscu duty kt?rym przed chwil? stworzy?em.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2022-01-01, 12:48


TheBestv4

Przyszły programista LUA






Wiek: 30
Na forum: 2024 dni
Posty: 52
Nick w MP: Absolwent

Piwa: 838

Respekt: 50

debugscript 3
W konsoli i podaj b??d, bo napewno taki wyst?puje

Podpis



Dołącz do najlepszego community!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2022-01-01, 19:38


HarnesHa12







Wiek: 25
Na forum: 1824 dni
Posty: 5



Respekt: 50

"TheBestv4" napisał/a:

debugscript 3
W konsoli i podaj b??d, bo napewno taki wyst?puje


No i jest b??d

B??d:
ERROR: duty/g_duty.lua:46 attempt to index local 'factionDuty' (a boolean value)

Kod duty/g_duty.lua
Kod:

DutyColShapes = { }
function createDutyColShape(posX, posY, posZ, size, interior, dimension, factionID, locationID)
if type(DutyColShapes[tonumber(factionID)]) ~= "table" then
DutyColShapes[tonumber(factionID)] = { }
end

if not DutyColShapes[tonumber(factionID)][tonumber(locationID)] then
tempShape = createColSphere(tonumber(posX), tonumber(posY), tonumber(posZ), tonumber(size))
setElementDimension(tempShape, tonumber(dimension) or 0)
setElementInterior(tempShape, tonumber(interior) or 0)
if tempShape then
DutyColShapes[tonumber(factionID)][tonumber(locationID)] = tempShape
setElementData(resourceRoot, "DutyColShapes", DutyColShapes)
return true
end
end
end

function destroyDutyColShape(factionID, locationID)
if DutyColShapes[tonumber(factionID)] and DutyColShapes[tonumber(factionID)][tonumber(locationID)] then
destroyElement(DutyColShapes[tonumber(factionID)][tonumber(locationID)])
DutyColShapes[tonumber(factionID)][tonumber(locationID)] = nil
setElementData(resourceRoot, "DutyColShapes", DutyColShapes)
return true
end
end

-- -------------------------- --
-- General checking functions -- Revised by Chaos for OwlGaming < Old way was shitty less loops now
-- -------------------------- --

function fetchAvailablePackages( targetPlayer )
local availablePackages = { }
local allowList = { }
local faction = getElementData(targetPlayer, "faction")
local factionDuty = getElementData(resourceRoot, "factionDuty")
local factionLocations = getElementData(resourceRoot, "factionLocations")
local DutyColShapes = getElementData(resourceRoot, "DutyColShapes") or {}

local resource = getResourceRootElement(getResourceFromName("factions"))
if resource then
allowListTemp = getElementData(resource, "dutyAllowTable")
end

for factionID, _ in pairs(faction) do
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 type(DutyColShapes[factionID]) ~= 'table' then
DutyColShapes[factionID] = {}
end

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, factionID) then
factionPackage.factionID = factionID
table.insert(availablePackages, factionPackage)
end
end
table.insert(allowList, allowListTemp[factionID][3])
end
end
return availablePackages, allowList
end

function getGrant(thePlayer, grantID, factionID)
local factionID = tonumber(factionID)
local factionDuty = getElementData(resourceRoot, "factionDuty")
if factionDuty[factionID] then
return factionDuty[factionID][tonumber(grantID)]
end
end

function canPlayerUseDutyPackage(targetPlayer, packageID, factionID)
local package = tonumber(packageID)
local playerPackagePermission = getElementData(targetPlayer, "faction")[factionID].perks
if playerPackagePermission then
for index, permissionID in ipairs(playerPackagePermission) do
if (tonumber(permissionID) == tonumber(package)) then
return true
end
end
end
return false
end

function getFactionPackages( factionID )
if not factionID or not tonumber( factionID ) then
return false
end
local factionDuty = getElementData(resourceRoot, "factionDuty")

if type(factionDuty) ~= 'table' then
factionDuty = {}
factionDuty[tonumber(factionID)] = {}
end

return factionDuty[tonumber(factionID)]
end
addEvent("onPlayerDuty", true)


[ Dodano: 2022-02-22, 01:22 ]
Kto? co??

Postaw piwo autorowi tego posta
 

 
Tagi: niedziałające :: /duty :: owlgamingu
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Odpowiedz do tematu

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku