[lua] Long function
Viewer
*** This page was generated with the meta tag "noindex, nofollow". This happened because you selected this option before saving or the system detected it as spam. This means that this page will never get into the search engines and the search bot will not crawl it. There is nothing to worry about, you can still share it with anyone.
- function GetPlayerAppPerms()
- local apps = {}
- local playerJob, playerGang = PlayerData.job.name, PlayerData.gang.name
- for _, app in pairs(Config.Apps) do
- local hasAccess = false
- local converted = {
- name = app.app,
- icon = app.icon,
- text = app.name,
- color = app.color,
- background = app.background,
- useimage = app.useimage
- }
- if app.default and not hasAccess then
- apps[#apps + 1] = converted
- hasAccess = true
- end
- if app.job then
- if type(app.job) == 'table' then
- for i = 1, #app.job do
- if app.job[i] == playerJob then
- apps[#apps + 1] = converted
- hasAccess = true
- end
- end
- else
- if app.job == playerJob then
- apps[#apps + 1] = converted
- hasAccess = true
- end
- end
- end
- if app.gang and not hasAccess then
- if type(app.gang) == 'table' then
- for i = 1, #app.gang do
- if app.gang[i] == playerGang then
- apps[#apps + 1] = converted
- hasAccess = true
- end
- end
- else
- if app.gang == playerGang then
- apps[#apps + 1] = converted
- hasAccess = true
- end
- end
- end
- if app.item and not hasAccess then
- if type(app.item) == 'table' then
- for i = 1, #app.item do
- if haveItem(app.item[i]) then
- apps[#apps + 1] = converted
- hasAccess = true
- end
- end
- else
- if haveItem(app.item) then
- apps[#apps + 1] = converted
- hasAccess = true
- end
- end
- end
- end
- return apps
- end
Editor
You can edit this paste and save as new: