Skip to content

Commit

Permalink
F sampobj_reloaded + new cmd /sampobj [id]
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernando-A-Rocha committed Jan 14, 2023
1 parent 6408d33 commit 5564b99
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 14 deletions.
5 changes: 2 additions & 3 deletions [examples]/newmodels-example/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,12 @@ function (startedResource)
end
end

local count, reason = exports.newmodels:addExternalMods_CustomFileNames(listToAdd)
if not count then
local worked, reason = exports.newmodels:addExternalMods_CustomFileNames(listToAdd)
if not worked then
outputDebugString("[newmodels-example] Failed to add models: "..tostring(reason), 0, 255,110,61)
return
end


checkPossibleExistingElements()
end)

Expand Down
8 changes: 3 additions & 5 deletions [examples]/sampobj_reloaded/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1450,7 +1450,7 @@ function (startedResource)
local folder = "models/"
local listToAdd = {}

for k, id in pairs(ids) do
for _, id in ipairs(ids) do
local dff = folder..id..".dff"
local txd = folder..id..".txd"
local col = folder..id..".col"
Expand All @@ -1466,12 +1466,10 @@ function (startedResource)
listToAdd[#listToAdd+1] = {"object", id, 1337, name, dff, txd, col, false, false, false, metaDownloadFalse}
end

local count, reason = exports.newmodels:addExternalMods_CustomFileNames(listToAdd)
if not count then
local worked, reason = exports.newmodels:addExternalMods_CustomFileNames(listToAdd)
if not worked then
outputDebugString("[sampobj_reloaded] Failed to add models: "..tostring(reason), 1)
return
end

outputDebugString("[sampobj_reloaded] Added "..count.." new models successfully", 4, 22,255,255)
end)

Loading

0 comments on commit 5564b99

Please sign in to comment.