Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Sync Fork #644

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bridge/qb/server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ local convertItems = require 'bridge.qb.shared.compat'.convertItems
convertItems(require '@ox_inventory.data.items', require 'shared.items')

---@diagnostic disable-next-line: lowercase-global
qbCoreCompat = {}
local qbCoreCompat = {}

qbCoreCompat.Config = lib.table.merge(require 'config.server', require 'config.shared')
qbCoreCompat.Shared = require 'bridge.qb.shared.main'
Expand Down
1 change: 1 addition & 0 deletions bridge/qb/server/player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ end
---@param citizenid? string
---@param newData? PlayerEntity
---@return boolean success
---@return table playerData
function playerObj.Login(source, citizenid, newData)
return exports.qbx_core:Login(source, citizenid, newData)
end
Expand Down
6 changes: 2 additions & 4 deletions client/character.lua
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,9 @@ local randomPeds = {
local nationalities = {}

if config.characters.limitNationalities then
local nationalityList = lib.load('data.nationalities')

CreateThread(function()
for i = 1, #nationalityList do
nationalities[#nationalities + 1] = { value = nationalityList[i] }
for i = 1, #config.characters.nationalities do
nationalities[#nationalities + 1] = {value = config.characters.nationalities[i]}
end
end)
end
Expand Down
1 change: 1 addition & 0 deletions client/events.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ RegisterNetEvent('QBCore:Player:SetPlayerData', function(val)
local invokingResource = GetInvokingResource()
if invokingResource and invokingResource ~= cache.resource then return end
QBX.PlayerData = val
LocalPlayer.state:set('PlayerData', val, false) -- ONLY ADDED FOR TESTING BACKWARDS COMPATIBILITY
end)

RegisterNetEvent('QBCore:Client:OnPlayerUnload', function()
Expand Down
54 changes: 44 additions & 10 deletions client/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,64 @@ local positionConfig = require 'config.shared'.notifyPosition
---@param text table|string text of the notification
---@param notifyType? NotificationType informs default styling. Defaults to 'inform'
---@param duration? integer milliseconds notification will remain on screen. Defaults to 5000
---@param subTitle? string extra text under the title
---@param notifyPosition? NotificationPosition
---@param notifyStyle? table Custom styling. Please refer too https://overextended.dev/ox_lib/Modules/Interface/Client/notify#libnotify
---@param notifyIcon? string Font Awesome 6 icon name
---@param notifyIconColor? string Custom color for the icon chosen before
function Notify(text, notifyType, duration, subTitle, notifyPosition, notifyStyle, notifyIcon, notifyIconColor)
---@param notifyAnimation? string Custom color for the icon chosen before
---@param notifyStyle? table Custom styling. Please refer too https://overext ended.dev/ox_lib/Modules/Interface/Client/notify#libnotify
---@param notifyPosition? NotificationPosition
function Notify(text, notifyType, duration, notifyIcon, notifyIconColor, notifyAnimation, notifyStyle, notifyPosition)
local title, description
if type(text) == 'table' then
title = text.text or 'Placeholder'
description = text.caption or nil
elseif subTitle then
title = text
description = subTitle
title = text.text or 'Missing text!'
description = text.title or nil
else
description = text
end
local position = notifyPosition or positionConfig

--type set & duration
local type = notifyType or 'inform'
if type == 'primary' then type = 'inform' end
duration = duration or 5000

--icon color
local defaultIconColor = {
info = '#1c75d2',
police = '#1c75d2',
ambulance = '#bf1d1d',
warn = '#ee8a08',
success = '#20bb44',
error = '#bf1d1d'
}

local iconColor = notifyIconColor or defaultIconColor[notifyType] or '#1c75d2' -- Use custom icon color if provided, else use predefined icon color, default to blue

--icon animations
local iconAnimations = {
info = 'beatFade',
police = 'pulse',
ambulance = 'pulse',
warn = 'bounce',
success = 'beat',
error = 'shake'
}

local iconAnimation = notifyAnimation or iconAnimations[notifyType] or 'beatFade' -- Use custom icon animation if provided, else use predefined icon animation, default to beatFade

--default styling
local style = {
borderRadius = '4px 4px 0 0',
borderBottom = '2px solid ' .. iconColor, -- Use selected color for the border
backgroundColor = '#2b2b2bE0',
color = 'white'
}

lib.notify({
id = title,
title = title,
description = description,
duration = duration,
type = notifyType,
type = type,
position = position,
style = notifyStyle,
icon = notifyIcon,
Expand Down
201 changes: 198 additions & 3 deletions config/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,213 @@ return {
statusIntervalSeconds = 5, -- how often to check hunger/thirst status to remove health if 0.
loadingModelsTimeout = 30000, -- Waiting time for ox_lib to load the models before throws an error, for low specs pc

pauseMapText = 'Powered by Qbox', -- Text shown above the map when ESC is pressed. If left empty 'FiveM' will appear
pauseMapText = 'BSTAR', -- Text shown above the map when ESC is pressed. If left empty 'FiveM' will appear

characters = {
useExternalCharacters = false, -- Whether you have an external character management resource. (If true, disables the character management inside the core)
useExternalCharacters = true, -- Whether you have an external character management resource. (If true, disables the character management inside the core)
enableDeleteButton = true, -- Whether players should be able to delete characters themselves.
startingApartment = true, -- If set to false, skips apartment choice in the beginning (requires qbx_spawn if true)

dateFormat = 'YYYY-MM-DD',
dateMin = '1900-01-01', -- Has to be in the same format as the dateFormat config
dateMax = '2006-12-31', -- Has to be in the same format as the dateFormat config

limitNationalities = true, -- Setting this to false will allow people to enter whatever they want in the nationality field (To edit the list of nationalities, head to data/nationalities.lua)
limitNationalities = true, -- Setting this to false will allow people to enter whatever they want in the nationality field
nationalities = {
'Afghan',
'Albanian',
'Algerian',
'American',
'Andorran',
'Angolan',
'Antiguans',
'Argentinean',
'Armenian',
'Australian',
'Austrian',
'Azerbaijani',
'Bahamian',
'Bahraini',
'Bangladeshi',
'Barbadian',
'Barbudans',
'Belarusian',
'Belgian',
'Belizean',
'Beninese',
'Bhutanese',
'Bolivian',
'Bosnian',
'Brazilian',
'British',
'Bruneian',
'Bulgarian',
'Burkinabe',
'Burmese',
'Burundian',
'Cambodian',
'Cameroonian',
'Canadian',
'Cape Verdean',
'Central African',
'Chadian',
'Chilean',
'Chinese',
'Colombian',
'Comoran',
'Congolese',
'Costa Rican',
'Croatian',
'Cuban',
'Cypriot',
'Czech',
'Danish',
'Djibouti',
'Dominican',
'Dutch',
'East Timorese',
'Ecuadorean',
'Egyptian',
'Emirian',
'Equatorial Guinean',
'Eritrean',
'Estonian',
'Ethiopian',
'Fijian',
'Filipino',
'Finnish',
'French',
'Gabonese',
'Gambian',
'Georgian',
'German',
'Ghanaian',
'Greek',
'Grenadian',
'Guatemalan',
'Guinea-Bissauan',
'Guinean',
'Guyanese',
'Haitian',
'Herzegovinian',
'Honduran',
'Hungarian',
'I-Kiribati',
'Icelander',
'Indian',
'Indonesian',
'Iranian',
'Iraqi',
'Irish',
'Israeli',
'Italian',
'Ivorian',
'Jamaican',
'Japanese',
'Jordanian',
'Kazakhstani',
'Kenyan',
'Kittian and Nevisian',
'Kuwaiti',
'Kyrgyz',
'Laotian',
'Latvian',
'Lebanese',
'Liberian',
'Libyan',
'Liechtensteiner',
'Lithuanian',
'Luxembourger',
'Macedonian',
'Malagasy',
'Malawian',
'Malaysian',
'Maldivan',
'Malian',
'Maltese',
'Marshallese',
'Mauritanian',
'Mauritian',
'Mexican',
'Micronesian',
'Moldovan',
'Monacan',
'Mongolian',
'Moroccan',
'Mosotho',
'Motswana',
'Mozambican',
'Namibian',
'Nauruan',
'Nepalese',
'New Zealander',
'Nicaraguan',
'Nigerian',
'Nigerien',
'North Korean',
'Northern Irish',
'Norwegian',
'Omani',
'Pakistani',
'Palauan',
'Panamanian',
'Papua New Guinean',
'Paraguayan',
'Peruvian',
'Polish',
'Portuguese',
'Qatari',
'Romanian',
'Russian',
'Rwandan',
'Saint Lucian',
'Salvadoran',
'Samoan',
'San Marinese',
'Sao Tomean',
'Saudi',
'Scottish',
'Senegalese',
'Serbian',
'Seychellois',
'Sierra Leonean',
'Singaporean',
'Slovakian',
'Slovenian',
'Solomon Islander',
'Somali',
'South African',
'South Korean',
'Spanish',
'Sri Lankan',
'Sudanese',
'Surinamer',
'Swazi',
'Swedish',
'Swiss',
'Syrian',
'Taiwanese',
'Tajik',
'Tanzanian',
'Thai',
'Togolese',
'Tongan',
'Trinbagonian',
'Tunisian',
'Turkish',
'Tuvaluan',
'Ugandan',
'Ukrainian',
'Uruguayan',
'Uzbekistani',
'Venezuelan',
'Vietnamese',
'Wallisian',
'Welsh',
'Yemenite',
'Zambian',
'Zimbabwean'
},

profanityWords = {
['bad word'] = true
Expand Down
26 changes: 13 additions & 13 deletions config/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,21 @@ return {
characterDataTables = {
{'properties', 'owner'},
{'bank_accounts_new', 'id'},
{'playerskins', 'citizenid'},
{'player_mails', 'citizenid'},
{'player_skins', 'citizenid'},
-- {'player_mails', 'citizenid'},
{'player_outfits', 'citizenid'},
{'player_vehicles', 'citizenid'},
{'player_groups', 'citizenid'},
{'players', 'citizenid'},
{'npwd_calls', 'identifier'},
{'npwd_darkchat_channel_members', 'user_identifier'},
{'npwd_marketplace_listings', 'identifier'},
{'npwd_messages_participants', 'participant'},
{'npwd_notes', 'identifier'},
{'npwd_phone_contacts', 'identifier'},
{'npwd_phone_gallery', 'identifier'},
{'npwd_twitter_profiles', 'identifier'},
{'npwd_match_profiles', 'identifier'},
-- {'npwd_calls', 'identifier'},
-- {'npwd_darkchat_channel_members', 'user_identifier'},
-- {'npwd_marketplace_listings', 'identifier'},
-- {'npwd_messages_participants', 'participant'},
-- {'npwd_notes', 'identifier'},
-- {'npwd_phone_contacts', 'identifier'},
-- {'npwd_phone_gallery', 'identifier'},
-- {'npwd_twitter_profiles', 'identifier'},
-- {'npwd_match_profiles', 'identifier'},
}, -- Rows to be deleted when the character is deleted

server = {
Expand All @@ -86,9 +86,9 @@ return {
whitelist = false, -- Enable or disable whitelist on the server
whitelistPermission = 'admin', -- Permission that's able to enter the server when the whitelist is on
discord = '', -- Discord invite link
checkDuplicateLicense = true, -- Check for duplicate rockstar license on join
checkDuplicateDiscord = true, -- Check for duplicate rockstar license on join
---@deprecated use cfg ACE system instead
permissions = { 'god', 'admin', 'mod' }, -- Add as many groups as you want here after creating them in your server.cfg
permissions = { 'god', 'admin', 'dev', 'mod', 'actor','star6','star5', 'star4', 'star3', 'star2', 'star1', 'patron', 'trusted' }, -- Add as many groups as you want here after creating them in your server.cfg
},

characters = {
Expand Down
2 changes: 1 addition & 1 deletion config/shared.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
return {
serverName = 'Server',
defaultSpawn = vec4(-540.58, -212.02, 37.65, 208.88),
notifyPosition = 'top-right', -- 'top' | 'top-right' | 'top-left' | 'bottom' | 'bottom-right' | 'bottom-left'
notifyPosition = 'left-center', -- 'top' | 'top-right' | 'top-left' | 'bottom' | 'bottom-right' | 'bottom-left'
---@type { name: string, amount: integer, metadata: fun(source: number): table }[]
starterItems = { -- Character starting items
{ name = 'phone', amount = 1 },
Expand Down
Loading
Loading