Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local noteText
- function addNotification(plr, cmd, ...)
- if (not hasObjectPermissionTo(plr, "command.em", false)) then
- return false
- end
- local cemOnline = {}
- local plrs = getElementsByType("player")
- for i, cem in ipairs(plrs) do
- if (hasObjectPermissionTo(cem, "command.em", false)) then
- table.insert(cemOnline, cem)
- end
- end
- local text = table.concat({...}, " ")
- local text = string.gsub(text, "#%x%x%x%x%x%x", "")
- if (string.len(text) < 1) then
- exports.CIThelp:opc("(CEM Notification) "..getPlayerName(plr).." removed the CEM Notification", cemOnline, 212, 9, 185, true)
- noteText = nil
- return true
- end
- noteText = "#D409B9(CEM Notification) "..getPlayerName(plr)..": #FFFFFF"..text
- exports.CIThelp:opc(noteText, cemOnline, 255, 255, 255, true)
- end
- addCommandHandler("cemnotif", addNotification)
- function onPlrCmd(cmd)
- if (not hasObjectPermissionTo(source, "command.em", false) or cmd ~= "rb" and cmd ~= "em" or not noteText) then
- return false
- end
- outputChatBox(noteText, source, 255, 255, 255, true)
- end
- addEventHandler("onPlayerCommand", root, onPlrCmd)
Advertisement
Add Comment
Please, Sign In to add comment