[Release] Admin Announcement

A NEW Admin Announcement script

I created this script as I couldn’t find any so I created one my self

also if you need some help join my discord: https://discord.gg/MctrWbK

[YOU THIS]
1.1 /adgan
1.2 /adga
1.3 OWNER /owan ADMIN /adga
1.4 OWNER /ownerannouce ADMIN /adminannouce

[Updates]
[1.4] {LATEST}
AdminOwner-Annoucement-1.4.zip (10.5 KB)

[1.3]
AdminOwner-Annoucement-1.3.zip (5.9 KB)

[1.2] {HAS NO COULER CHOICE AND HAS NO OWNER ANOUCEMENT}
Admin-Announcement-1.2.zip (1.4 KB)

[1.1] NOT RECOMMENDED {has bug}
Admin-Announcement.zip (1.2 KB)

IF YOU NEED HELP FEEL FREE TO COMMENT OR JOIN MY DISCORD

2 Likes

if you guys need help feel free to comment

so… whos announcing ? what if u dont have the logs (the server is hosted through a website) and an admin gets raged ? how can u know who posted it ?

well you can get logs
and why should an admin spam it anyway
he should be trusted

If someone uses this, other people will probably find this “so called release” on the forums and spam the command on their server. You should add in a permission system.

2 Likes

̶A̶d̶m̶i̶n̶ announcement

1 Like

You can also change the command

How do I add Admins?

you dont its a command

So anyone can use it then?

well if they know the command
you can change the command if you like look at read me

Oh right, thanks.
[20 characters]

and it btw i am workign to get more but you can only have 4 character

Ok
Thanks for releasing

lol you can have more, learn abit about coding and then talk
change this > (msg,5)), to use more letters in the command

ok sir you change that yeah tell me if it works

i have tried that bud

m8 it works perfectly :wink:

AddEventHandler('chatMessage', function(source, name, msg)
	sm = stringsplit(msg, " ");
	if sm[1] == "/announce" then
        CancelEvent()
        TriggerClientEvent("chatMessage", -1, "^4Admin Announcement", {255, 255, 255}, string.sub(msg,10))
    end
	sm = stringsplit(msg, " ");
	if sm[1] == "/oannounce" then
        CancelEvent()
        TriggerClientEvent("chatMessage", -1, "^2Owner Announcement", {255, 255, 255}, string.sub(msg,11))
    end
end)
function stringsplit(inputstr, sep)
    if sep == nil then
        sep = "%s"
    end
    local t={} ; i=1
    for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
        t[i] = str
        i = i + 1
    end
    return t
end

work like a charm :roll_eyes:

also remove the part from "end " to sm = stringsplit thats so unnecessary
just use elseif

AddEventHandler('chatMessage', function(source, name, msg)
	sm = stringsplit(msg, " ");
	if sm[1] == "/announce" then
        CancelEvent()
        TriggerClientEvent("chatMessage", -1, "^4Admin Announcement", {255, 255, 255}, string.sub(msg,10))
	elseif sm[1] == "/oannounce" then
        CancelEvent()
        TriggerClientEvent("chatMessage", -1, "^2Owner Announcement", {255, 255, 255}, string.sub(msg,11))
    end
end)
function stringsplit(inputstr, sep)
    if sep == nil then
        sep = "%s"
    end
    local t={} ; i=1
    for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
        t[i] = str
        i = i + 1
    end
    return t
end