Verse
Discord ServerTebex StoreWebsite
  • Home
  • Discord server
  • 🚑Ambulance Job
    • 🧠Configuration
    • 📚Guides
      • Adding a custom dispatch
    • ⁉️Common Errors
    • 🐌For Developers
      • Client Events
  • 💽Modular Website
    • ➕Installation
  • 👮Police Complaint
    • 🔌Adding Departments
    • 👀Examples
  • 📣Announcement
    • 🧠Installation
    • 👀Command examples
    • ⚡Events
  • 📕Exams
    • Functions
Powered by GitBook
On this page
  • Command
  • QB CORE check for job first and then execute
  1. Announcement

Command examples

Some examples what you can do:

Command

RegisterCommand("announce", function(source, args)
    local msg = table.concat(args, " ")
    if msg == "" then return end
    -- design can be default, restart or your own, just create it in index.js
    local design = "default" 
    TriggerServerEvent("p33t-announce:server:announce", msg, design)
end)

QB CORE check for job first and then execute

RegisterCommand("ANY_COMMAND_NAME", function(source, args)
    if QBCore.Functions.GetPlayerData().job.name == "police" then
        local msg = table.concat(args, " ")
        if msg == "" then return end
        local design = "police"
        TriggerServerEvent("p33t-announce:server:announce", msg, design)
    end
end)

If you want to use the local design = "police" you need to make some police design config

} else if (item.design == "police") {
            $("#ann-header").html('<i class="fa-solid fa-handcuffs"></i>'+ " Police announcement")
            $("#announcebox").css("background-color", "#0362fc")
            $("#announcement").css("color", "white")
            $("#ann-header").css("color", "white")
            $("#announcement").text(item.announcement)
        }
PreviousInstallationNextEvents
📣
👀