Merge pull request #1310 (Add hook for autowear)

Add hook for autowear
This commit is contained in:
Python1320 2023-10-10 00:23:30 +03:00 committed by GitHub
commit fc118d112d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -258,9 +258,18 @@ do
elseif pace.IsActive() then elseif pace.IsActive() then
pac.Message("not wearing autoload outfit, editor is open") pac.Message("not wearing autoload outfit, editor is open")
else else
pac.Message("Wearing autoload...") local autoload_file = "autoload"
pace.LoadParts("autoload") local autoload_result = hook.Run("PAC3Autoload", autoload_file)
pace.WearParts()
if autoload_result ~= false then
if isstring(autoload_result) then
autoload_file = autoload_result
end
pac.Message("Wearing " .. autoload_file .. "...")
pace.LoadParts(autoload_file)
pace.WearParts()
end
end end
pac.RemoveHook("Think", "pac_request_outfits") pac.RemoveHook("Think", "pac_request_outfits")