Announcement Script

This is just an announcement script it fairly simple to edit if you know what you are doing if you don’t i recommend you not touching it but you can if you want to learn how to. This script is also whitelisted to admins.
Picture:

How to use:
Do /announce in chat if you want to use it example /announce I got ice cream it would be the white text But if you want red text do /announce ^1 I got ice cream

Perms Setup: To Setup go to where you permissions are setup and add put your steam hex where it says yoursteamtext if you don’t know your hex go to your steam profile and copy this

image
Copy Your numbers and go to https://steamid.io/lookup

add_ace Admin administrator allow

add_principal identifier.steam:YourSteamHex Admin

Script Provided By
Lean/Snezd

1 Like

Please fix the use of chatMessage as it’s deprecated. See https://docs.fivem.net/resources/chat/events/chatMessage/

1 Like

Looking good. 1 suggestion though. Why not make it all server side?

server.lua:

RegisterCommand("announce", function(source, args)
    local announceMessage = table.concat(args, " ", 1)
    
    if IsPlayerAceAllowed(source, "administrator") then -- pass permission check
        print("[^1Announcement^7]" .. announceMessage )
        TriggerClientEvent("chatMessage", -1, "^7[^4---------^1Announcement^5---------^7]" .. announceMessage)
    else -- Don't pass permission check
        TriggerClientEvent("chatMessage", source, "[Error]", {255,0,0}, "Sorry our system sees your not an admin and can not use this")
    end
end)

That’s how simple and reduced it can be :stuck_out_tongue:

Also could updated all that to chat:addMessage

1 Like

Thanks, I’ll make sure to make it server side thank you.

1 Like

Sorry, I know this is an old post, but I found it funny how you wiped out your username, but I can just look you up using the profile URL you pointed to and you provided your own name in Script Provided by lol

i’d say server config