mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 15:06:02 +01:00
Deprecate import (now just references lib); when calling or indexing lib for the first time, attempt to load a module else call an export.
10 lines
389 B
Lua
10 lines
389 B
Lua
function lib.checkDependency(resource, minimumVersion)
|
|
local currentVersion = GetResourceMetadata(resource, 'version', 0):match('%d%.%d+%.%d+')
|
|
|
|
if currentVersion < minimumVersion then
|
|
return print(("^1%s requires version '%s' of '%s' (current version: %s)^0"):format(GetInvokingResource() or GetCurrentResourceName(), minimumVersion, resource, currentVersion))
|
|
end
|
|
|
|
return true
|
|
end
|