This script allows you to do /promotion (text) with the required job & job role that will then display a notification on screen to everybody in the server, in regards to promoting their business to announce anything (event/business opening etc..)
Configurable allowed jobs.
Configurable promotional costs for each job.
Configurable job grade to be able to promote.
Configurable text (language).
Configurable blacklisted words in message.
Configurable cooldown.
Configurable amber-alert.
/promotion (text) - display notification to everybody in the city.
This resource is drag/drop. Make sure to choose your framework inside of the config. You will just need to add the following inside of your server.cfg after you've dropped the file into your resources.
ensure adminplus-promotion
Feel free to check the config.lua & customize what jobs have access, the job grade, the pricing & also the cooldown.
-- ███████████████████████████████████████████████████████████████████████████ --
Config = {}
Config.Framework = 1 -- (ESX == 1), (QB == 2)
Config.FrameworkExport = 'es_extended' -- (ESX == 'es_extended'), (QB == 'qb-core' - if QB comment the es_extended line in shared_scripts in fxmanifest.lua, add -- before the '@es_extended')
-- Ox_lib notification to everybody
Config.Ox_LibNotify = false
Config.ChatMessage = true
-- position?: 'top' or 'top-right' or 'top-left' or 'bottom' or 'bottom-right' or 'bottom-left' or 'center-right' or 'center-left'
Config.NotifyPosition = 'bottom-right'
Config.Icon = 'business-time'
Config.BusinessIcon = 'rectangle-ad'
-- amber alert (player must have phone to receive the messages)
-- LBPHONE INTEGRATION
Config.AmberAlert = false
Config.AmberAlertCommand = 'amberalert'
Config.AuthorizedJobs = { -- list of jobs that can use the command and required grade
[1] = {job = 'police', grade = 0},
--[2] = {job = 'ambulance', grade = 0},
}
---
-- I recommend to choose one of these.
Config.LbPhone = {
Twitter = false,
Instagram = false,
YellowPages = false,
Marketplace = false,
Mail = false,
}
Config.AllowedJobs = {
["rea"] = true,
["mechanic"] = true,
}
Config.RequiredGrade = {
["rea"] = 3,
["mechanic"] = 0,
}
Config.PromotionCosts = {
["rea"] = 100,
["mechanic"] = 150,
}
Config.BlacklistWords = {
-- Add more blacklist words here
}
Config.CooldownTime = 0 -- Cooldown time in seconds
Config.Strings = {
amber_alert = 'Amber Alert',
you_are_not_allowed_amberalert = 'You are not allowed to use amber-alert.',
business_promotion = 'Business Promotion',
-- This one is for server-side that will show job name next to it.
business_promotion2 = 'Business Promotion - ',
job = 'Job: ',
wait_for_promotion = 'Please wait before promoting your business again.',
blacklisted_words = 'Your message contains a blacklisted-word.',
not_enough_money = 'You do not have enough money to promote your business.',
not_required_job_grade = 'You do not have the required job grade to promote your business.',
you_are_not_allowed = 'You are not allowed to promote your business.',
not_enough_cash = 'You do not have enough cash.',
player_not_found = 'Player not found.'
}
-- ███████████████████████████████████████████████████████████████████████████ --
Integrated LB-Phone into my promotion script. Added optional features with what you want to display whether its Ox_Lib notification or notify your business through the phone itself on specific apps of your choice in the Config. There is additional features you can check on the docs. ./promote (msg) , will automatically promote your message to the chosen application & display on the phone. It will not be saved under your account as a tweet, but will be displayed.
You can enable/disable which apps would show the notification.
Added configuration to where you want the notify to display.
position?: 'top' or 'top-right' or 'top-left' or 'bottom' or 'bottom-right' or 'bottom-left' or 'center-right' or 'center-left'
V 1.0.2
Integrated Amber Alert for LB-PHONE
V 1.0.3
Integrated Chat message Config option to turn/disable. You can now enable wether you want the lib.notification on the right or a chat message top-left.