Skip to content

Commit

Permalink
Merge pull request #27 from Fernando-A-Rocha/2.0.2
Browse files Browse the repository at this point in the history
2.0.2
  • Loading branch information
Fernando-A-Rocha authored Jan 14, 2023
2 parents eeb22e6 + 4a7ba01 commit eeedac6
Show file tree
Hide file tree
Showing 8 changed files with 541 additions and 70 deletions.
9 changes: 3 additions & 6 deletions [examples]/newmodels-example/meta.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
Its version now matches the main newmodels version!
https://github.com/Fernando-A-Rocha/mta-add-models -->

<info author="Fernando" name="newmodels Example"
description="implements mta-add-models library functions"
version="2.0"
type="script" />


<info author="Fernando" name="newmodels Example" description="implements mta-add-models library functions" version="2.0.2" type="script" />

<include resource="newmodels" />

<!-- some skins -->
Expand Down
21 changes: 12 additions & 9 deletions [examples]/newmodels-example/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ function (startedResource)

if not startUpChecks() then return end

local listToAdd = {}

for k,mod in pairs(myMods) do

local uid = mod[1]
Expand All @@ -48,17 +50,18 @@ function (startedResource)
if not baseid then
outputDebugString("Failed to get vehicle model from name: "..tostring(mod[2]), 0, 255,55,55)
else
local worked, reason = exports.newmodels:addExternalMod_CustomFilenames(
et, uid, baseid, name,
dff, txd, col
)

if not worked then
outputDebugString(reason or "Unknown error", 0, 255,110,61)
end
-- ARGS: elementType, id, base_id, name, path_dff, path_txd, path_col, ignoreTXD, ignoreDFF, ignoreCOL, metaDownloadFalse
listToAdd[#listToAdd+1] = {et, uid, baseid, name, dff, txd, col, false, false, false, false}
end
end

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


checkPossibleExistingElements()
end)

Expand Down Expand Up @@ -320,7 +323,7 @@ function testVehiclesCmd(thePlayer, cmd)
for elementType, mods in pairs(modList) do
if elementType == elementType2 then
for k,mod in pairs(mods) do
local veh = createVehicle(400, x,y,z,rx,ry,rz)
local veh = createVehicle(mod.base_id, x,y,z,rx,ry,rz)
if veh then
setElementData(veh, data_name, mod.id)
table.insert(spawned_vehs, veh)
Expand Down
2 changes: 1 addition & 1 deletion [examples]/sampobj_reloaded/meta.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<info author="Fernando" name="SAMP Objects Reloaded"
description="implements mta-add-models library functions to add all SA-MP objects"
version="2.0"
version="2.0.2"
type="script" />

<include resource="newmodels" />
Expand Down
2 changes: 1 addition & 1 deletion [examples]/unittest_newmodels/meta.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<info author="Fernando" name="Newmodels Unit Testing"
description="created for debugging purposes to test all functionalities of newmodels framework"
version="2.0"
version="2.0.2"
type="script" />

<include resource="newmodels"/>
Expand Down
9 changes: 9 additions & 0 deletions newmodels/_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,12 @@ START_STOP_MESSAGES = true -- enable resouce start/stop automatic chat messages
SEE_ALLOCATED_TABLE = true -- automatically executes /allocatedids on startup
ENABLE_DEBUG_MESSAGES = true -- toggle all debug console messages
CHAT_DEBUG_MESSAGES = true -- make debug console messages to go chatbox (better readability imo)

--[[
MTA:SA Async library Settings
Async:setPriority("low"); -- better fps
Async:setPriority("normal"); -- medium
Async:setPriority("high"); -- better perfomance
]]
ASYNC_PRIORITY = "normal"
Loading

0 comments on commit eeedac6

Please sign in to comment.