License Check
licenseCheck = false, -- false = no license required to open dealership
license = 'driver', -- this is the license name required function ShowroomPreCheck(dealershipId)
local Player = Framework.Client.GetPlayerData()
local licenseCheck = Config.DealershipLocations[dealershipId].licenseCheck
local license = Player.metadata['licences'][Config.DealershipLocations[dealershipId].license]
if licenseCheck then
if not license then
allowed = false
elseif license then
print(license)
allowed = true
end
else
allowed = true
end
if not allowed then
local msg = "You require a ".. Config.DealershipLocations[dealershipId].license
Framework.Client.Notify(msg, "error", 1000 )
return false
end
return true
endLast updated
Was this helpful?