Skip to content
dalmeidasdevPublic

About

Chat de RP gratuito para FiveM (QBCore e standalone) - Almeida Scripts

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

alm_chat

Chat de RP para servidores de FiveM, por Almeida Scripts. Gratuito e de código aberto.

Ele troca o chat padrão do FiveM sem quebrar os scripts que já mandam mensagem no chat, e vem pronto para as regras do RP: fala local com o nome do personagem, máscara, caído, /me sobre a cabeça e atalhos de ação.

O que faz

Fala e cena

  • Texto sem barra vai só para quem está perto (padrão: 15 m), com o nome do personagem. No painel, a fala pode virar global ou ser desligada (aí só os comandos falam).
  • /me aparece no chat de quem está perto e também sobre a cabeça do personagem por alguns segundos (padrão: 6 s, visto até 20 m, só com linha de visão).
  • /do descreve a cena. /ooc é a fala fora do personagem, para quem está perto. /try tenta uma ação, e quem sorteia "conseguiu" ou "falhou" é o servidor.
  • O alcance é calculado no servidor, pela posição de cada jogador, e só conta quem está na mesma dimensão (routing bucket).
  • Máscara: quem está mascarado aparece como "Desconhecido" na fala, no /me, no /do e no /try. O /ooc mostra o nome.
  • Caído (morto ou em último suspiro, no QBCore): só fala no /ooc. Opção ligada por padrão.
  • Cada comando de cena (/me, /do, /ooc, /try) liga e desliga sozinho, no painel ou em Config.Scene. Desligado, some das sugestões e responde que está desligado.
  • O ID do jogador ao lado do nome vem desligado. Liga no painel (aba Geral, Mensagens). Com máscara, o ID não aparece na fala nem nos comandos de cena (nos canais e no anúncio, o nome e o ID aparecem).

Canais e anúncio

  • Canais de grupo, cada um com o seu comando. Vêm dois: /policia (emprego police, em serviço) e /staff (permissão ACE alm_chat.staff). Quem pode escrever é quem lê. Canais novos se criam no painel e o comando passa a valer na hora.
  • /anuncio: mensagem para a cidade inteira, com o nome do personagem e espera entre um anúncio e outro. Vem desligado; pode ficar restrito a alguns empregos. Não cobra nada.

Atalhos de ação

  • Em /atalhos, o jogador grava até 6 mensagens prontas, cada uma como /me ou /do.
  • A tecla de cada atalho se escolhe em Configurações > Atalhos de teclado > FiveM ("Chat: atalho de ação"). Nenhuma vem com tecla.
  • O atalho passa pelas mesmas conferências do servidor que a fala digitada: espera, tamanho, alcance e máscara.

Avisos da cidade e rádio

  • Avisos da cidade: frases suas, com etiqueta, sorteadas de tempos em tempos (padrão: a cada 15 min). Vêm cinco frases neutras de exemplo.
  • Rádio da cidade: outros scripts avisam um fato (exports.alm_chat:News) e a notícia sai depois de um atraso sorteado (padrão: 2 a 6 min), com espaço entre uma notícia e outra. A notícia nunca leva nome de jogador nem local de crime: a rádio não serve de radar. Vêm três tipos de exemplo (weather, arrest, business_open).

Tela

  • Etiqueta por tipo de mensagem e horário em cada linha (ajuda nos prints de denúncia).
  • Contador de letras, sugestões de comando com Tab, histórico do que você mandou com as setas, PageUp e PageDown para rolar.
  • O chat some sozinho depois de alguns segundos. /togglechat alterna entre "some sozinho", "sempre visível" e "só ao digitar"; a escolha fica salva no computador do jogador.
  • Some com a tela escura e com o menu de pausa.
  • /limpar limpa o próprio chat.
  • Cores, tamanho, posição (esquerda ou direita) e transparência ajustáveis.

Painel de configuração (/chatadmin)

  • Abas: Geral, Fala e cena, Canais, Atalhos, Avisos da cidade, Rádio, Backup.
  • Tudo o que está no config.lua se muda no painel, menos idioma, framework, aviso de versão, nomes dos comandos e teclas (esses ficam no arquivo e pedem reinício). O que você salva vale na hora, sem reiniciar.
  • Editor das frases dos avisos e dos tipos de notícia, nas duas línguas.
  • Cada seção tem "Voltar ao padrão" (volta ao config.lua).
  • Backup: exporta o que foi salvo como texto (JSON) e importa em outro servidor. A importação confere tudo antes; se algo estiver errado, nada muda. O webhook nunca vai no backup.
  • Quem abre: permissão ACE alm_chat.admin, ou grupo admin ou god do QBCore.

Registro (opcional)

  • Um webhook do Discord do seu servidor recebe as alterações do painel e, se você ligar "Registrar no webhook" (seção "Registro do que foi dito"), o que foi dito: quem, ID, conta, onde e para quantos. Serve para a staff julgar denúncias. Vem desligado.
  • As falas vão em lotes, uma mensagem do Discord a cada 10 s, para não estourar o limite do Discord.

O que não faz

  • Não tem Twitter, Instagram nem anúncio pago: isso é do celular.
  • Não tem chat de rádio por frequência: isso é da voz (por exemplo, pma-voice).
  • Não tem emojis, GIFs nem imagens.
  • Não filtra palavrão. Quem quiser filtrar usa o evento alm_chat:beforeMessage ou o chatMessage (veja "Para outros scripts").
  • O jogador não tem ID ao lado do nome por padrão, e a entrada e a saída de jogadores não aparecem por padrão (mostrariam o nome da conta).

Baixar

Pegue o alm_chat-<versão>.zip na página de Releases. Não use o "Source code (zip)" nem o botão "Download ZIP" do GitHub: eles entregam a pasta com outro nome. O passo a passo está no INSTALL.md.

Requisitos

  • oxmysql (obrigatório): guarda os ajustes do painel na tabela alm_chat_settings, criada sozinha. É o único uso do banco: nenhuma mensagem é gravada.
  • FXServer recente, com OneSync e lua54.
  • O chat padrão desligado: os dois juntos não funcionam. Veja o INSTALL.md.

Funciona com

Base Situação
QBCore adaptador incluído: nome do personagem, emprego, serviço e caído. testado no jogo (qb-core 1.3.0)
Sem framework (standalone) nome da conta, ninguém caído, canais de emprego por permissão ACE. Escrito e conferido; teste no jogo pendente
vRP / Creative, Qbox, ESX previstos para versões futuras

Desempenho

Ainda não medido no jogo. Não há laço por quadro parado: a tecla do chat vem do mapeamento de teclas do FiveM, e o único laço por quadro é o do texto do /me, que só roda enquanto há texto na tela.

Comandos

Comando Quem usa O que faz
texto sem barra todos fala (local, global ou desligada)
/me <ação> todos ação do personagem, no chat e sobre a cabeça
/do <descrição> todos descrição da cena
/ooc <mensagem> todos fala fora do personagem, para quem está perto
/try <ação> todos tentativa: o servidor sorteia se deu certo
/anuncio <mensagem> todos ou só alguns empregos (desligado por padrão) anúncio para a cidade inteira
/policia <mensagem> police em serviço canal da polícia
/staff <mensagem> quem tem a ACE alm_chat.staff canal da staff
/atalhos todos grava os atalhos de ação
/limpar todos limpa o próprio chat
/togglechat [auto|always|typing] todos some sozinho, sempre visível ou só ao digitar
/chatadmin administrador painel de configuração
say <texto> console do servidor aviso para todos

O chat abre com T e fecha com Esc. Os nomes dos comandos mudam em Config.Commands e as teclas em Config.Key e Config.ToggleKey, no config.lua. O jogador também troca as teclas em Configurações > Atalhos de teclado > FiveM. Os canais se mudam no painel (aba Canais).

/me e /ooc do QBCore. O qb-core tem /me e /ooc próprios. O alm_chat assume os dois (e qualquer comando do qb-core com o nome de um comando ou canal dele) sem editar o qb-core: os do qb-core deixam de rodar.

Compatível com o chat padrão

O manifesto declara provide 'chat': script que tem dependency 'chat' sobe com o alm_chat. Os scripts continuam mandando mensagens do mesmo jeito:

  • eventos de cliente chat:addMessage (tabela ou texto, com args, color, multiline, template e params), chatMessage, chat:addSuggestion, chat:addSuggestions, chat:removeSuggestion, chat:addTemplate, chat:addMode, chat:removeMode e chat:clear;
  • exports de cliente addMessage e addSuggestion; exports de servidor addMessage, registerMessageHook e registerMode;
  • evento de servidor chatMessage, disparado antes de entregar a fala sem barra e cancelável com CancelEvent();
  • códigos de cor ^0 a ^9, ^#rrggbb e ^*;
  • template com HTML filtrado: as tags e classes comuns passam, e script e evento nunca rodam. O filtro foi feito para o cartão do qb-inventory e o aviso do qb-adminmenu aparecerem (teste no jogo pendente);
  • sugestões dos comandos registrados, filtradas pela permissão de cada jogador;
  • convars chat_showJoins e chat_showQuits, que valem por cima do painel.

registerMode funciona numa versão simples: o modo aparece como selo na caixa de texto e o Tab troca entre os modos (Shift+Tab volta).

Os exports respondem por exports.alm_chat. Se exports.chat também aponta para o alm_chat ainda não foi conferido no jogo; nenhum script do QBCore limpo usa exports.chat.

A parte de servidor que passa a fala pelos ganchos e modos de outros scripts foi escrita para aceitar a mesma API do chat padrão do FiveM (updateMessage, cancel, setSeObject, setRouting).

Para outros scripts

Todos do lado do servidor, menos onde está escrito "cliente".

Mandar uma mensagem

-- exports.alm_chat:Send(alvo, texto, tipo, de)
-- alvo: ID do jogador ou -1 para todos. tipo: 'system' (padrão), 'announce' ou 'city' (com a etiqueta `de`).
-- Devolve true se mandou.
exports.alm_chat:Send(-1, 'O servidor reinicia em 10 minutos.')
exports.alm_chat:Send(-1, 'Feira na praça às 20h.', 'city', 'PREFEITURA')

Rádio da cidade

-- exports.alm_chat:News(tipo, dados): o tipo precisa existir no painel (aba Rádio).
-- dados.name preenche o {name} da frase (nome de um comércio, nunca de jogador). Devolve true se a notícia entrou na fila.
exports.alm_chat:News('business_open', { name = 'Mercado da Praça' })

A notícia é recusada (devolve false) se a rádio estiver desligada, o tipo não existir, a fila estiver cheia, o mesmo tipo tiver saído há pouco (padrão: 10 min) ou a frase pedir {name} e o nome não vier.

API do chat padrão: addMessage, addSuggestion (cliente), registerMessageHook e registerMode funcionam como no chat padrão, por exports.alm_chat.

Barrar uma mensagem (filtro de palavras, jogador sem voz)

-- Dispara para a fala sem barra, /me, /do, /ooc, /try, /anuncio, atalhos e canais.
-- tipo: 'say', 'me', 'do', 'ooc', 'try', 'announce' ou 'channel' (com o comando do canal no 4º valor).
AddEventHandler('alm_chat:beforeMessage', function(src, tipo, texto, canal)
    if texto:lower():find('palavra proibida', 1, true) then CancelEvent() end
end)

O evento chatMessage do chat padrão também dispara, mas só para a fala sem barra.

Registro

AddEventHandler('alm_chat:log', function(action, src, data)
    print(action, src, json.encode(data))
end)
action Quando data
chat cada fala, cena, atalho, canal e anúncio kind, text, label (canal, modo ou atalho), heard (quantos receberam)
news cada notícia que vai ao ar (src = 0) kind, text
settings seção salva no painel section, before, after
settings_reset seção (ou tudo, *) de volta ao padrão section
settings_import backup importado {}

O evento dispara sempre. O webhook recebe as ações do painel sempre que estiver preenchido, e as falas só com "Registrar no webhook" ligado (seção "Registro do que foi dito"). As notícias não vão ao webhook.

Configuração

  • Painel (/chatadmin): o jeito mais fácil. Vale por cima do config.lua e fica guardado no banco.
  • config.lua: o valor inicial de tudo, com um comentário por opção. Idioma, framework, aviso de versão, comandos e teclas só mudam aqui.
  • locales/pt-br.lua e locales/en.lua: todos os textos, inclusive os da tela.
  • Webhook: só no painel (aba Geral) ou pela convar set alm_chat_webhook "https://..." no server.cfg. Nunca no config.lua, que vai para o jogo de todos os jogadores.

Arquivos de ajuste e arquivos do sistema

  • De ajuste: config.lua, locales/ e bridge/. É onde você mexe, e o suporte cobre o produto com ajustes nesses três lugares. A pasta bridge/ é a ligação com o framework.
  • Do sistema: client/, server/, html/, shared/, sql/ e fxmanifest.lua. Estão abertos para leitura; alteração ali não é coberta pelo suporte.

Não renomeie a pasta: a tabela do banco, as permissões, a convar do webhook, os eventos e os exports usam o nome alm_chat, e outros scripts chamam exports.alm_chat.

Ponte (para ligar a outro framework)

O código fala com o framework só pela pasta bridge/. Para outro framework, copie o adaptador standalone, troque o nome e acrescente uma linha em KNOWN, no bridge/shared.lua. O chat usa estas funções do adaptador de servidor (bridge/server/<framework>.lua):

Função O que devolve No standalone
GetName(src) nome do personagem, ou nil se não carregou nome da conta
IsDowned(src) true se está caído (morto ou em último suspiro) sempre false
HasJob(src, { emprego = cargo mínimo }, emServiço) true se tem algum dos empregos ACE alm_chat.job.<emprego> (sem cargo nem serviço)
IsAdmin(src) administrador do framework (abre o painel) sempre false
Notify(src, texto, tipo) aviso na tela (info, success ou error) notificação do próprio jogo
TakeCommand(nome, fn) assume um comando que o framework também registra não faz nada

Código aberto

Todo o código deste repositório é aberto para leitura, sem ofuscação e sem trava. O servidor decide tudo: alcance, espera, tamanho, permissões, canais, resultado do /try e o que a rádio diz. A tela só desenha.

O script não coleta nem envia dados do seu servidor. Com Config.VersionCheck ligado, ele só lê um arquivo público (https://raw.githubusercontent.com/dalmeidasdev/versions/main/versions.json) para avisar no console quando sai versão nova (server/version.lua). O único outro envio é o webhook, se você preencher, e ele vai para o Discord do seu servidor.

Licença

Uso livre em qualquer servidor e modificação para uso próprio. Não é permitido vender nem republicar; fork no GitHub para estudar ou propor mudanças é permitido. O texto completo está no arquivo LICENSE.

Suporte

Pelo Discord da Almeida Scripts: https://discord.gg/dfuF2gz8NQ. Mande junto: framework e versão, build do servidor, o erro copiado do console e do F8, e o que você mudou no config.lua, nos locales/ ou na bridge/.


alm_chat (English)

RP chat for FiveM servers, by Almeida Scripts. Free and open source.

It replaces FiveM's default chat without breaking the scripts that already send chat messages, and comes ready for RP rules: local speech with the character's name, masks, downed players, /me above the head and action shortcuts.

What it does

Speech and scene

  • Text without a slash only goes to people nearby (default: 15 m), with the character's name. In the panel, speech can be made global or turned off (then only the commands speak).
  • /me shows in the chat of people nearby and also above the character's head for a few seconds (default: 6 s, seen up to 20 m, only with line of sight).
  • /do describes the scene. /ooc is out-of-character speech, for people nearby. /try attempts an action, and the server draws "succeeded" or "failed".
  • Range is computed on the server, from each player's position, and only counts players in the same dimension (routing bucket).
  • Mask: masked players show as "Unknown" in speech, /me, /do and /try. /ooc shows the name.
  • Downed (dead or in last stand, on QBCore): can only speak in /ooc. Option on by default.
  • Each scene command (/me, /do, /ooc, /try) can be turned on and off on its own, in the panel or in Config.Scene. When off, it leaves the suggestions and replies that it is off.
  • The player ID next to the name is off by default. Turn it on in the panel (General tab, Messages). With a mask, the ID is not shown in speech or scene commands (channels and announcements show the name and ID).

Channels and announcements

  • Group channels, each with its own command. Two come included: /policia (job police, on duty) and /staff (ACE permission alm_chat.staff). Whoever can write is whoever reads. New channels are created in the panel and their command works right away.
  • /anuncio: a message to the whole city, with the character's name and a wait between announcements. Off by default; it can be limited to some jobs. It charges nothing.

Action shortcuts

  • In /atalhos, players save up to 6 ready-made messages, each as /me or /do.
  • Each shortcut's key is chosen in Settings > Key Bindings > FiveM ("Chat: action shortcut"). None come with a key.
  • A shortcut goes through the same server checks as typed speech: wait, length, range and mask.

City notices and radio

  • City notices: your own lines, with a tag, drawn from time to time (default: every 15 min). Five neutral sample lines come included.
  • City radio: other scripts report a fact (exports.alm_chat:News) and the news goes out after a random delay (default: 2 to 6 min), with a gap between news items. News never carries a player's name or a crime location: the radio cannot be used as a radar. Three sample kinds come included (weather, arrest, business_open).

Screen

  • A tag per message type and the time on every line (helps with report screenshots).
  • Letter counter, command suggestions with Tab, history of what you sent with the arrow keys, PageUp and PageDown to scroll.
  • The chat fades on its own after a few seconds. /togglechat switches between "fades on its own", "always visible" and "only while typing"; the choice is saved on the player's computer.
  • Hides when the screen is faded out and with the pause menu.
  • /limpar clears your own chat.
  • Colors, size, position (left or right) and transparency can be adjusted.

Configuration panel (/chatadmin)

  • Tabs (with Config.Locale = 'en'): General, Speech and scene, Channels, Shortcuts, City notices, Radio, Backup.
  • Everything in config.lua can be changed in the panel, except language, framework, version check, command names and keys (those stay in the file and need a restart). What you save applies right away, with no restart.
  • Editor for the notice lines and news kinds, in both languages.
  • Each section has "Back to default" (back to config.lua).
  • Backup: exports what was saved as text (JSON) and imports it on another server. The import checks everything first; if anything is wrong, nothing changes. The webhook is never included in the backup.
  • Who opens it: ACE permission alm_chat.admin, or the QBCore admin or god group.

Logs (optional)

  • A Discord webhook on your server's Discord receives panel changes and, if you turn on "Log to the webhook" (section "Log of what was said"), what was said: who, ID, account, where and to how many players. It helps staff judge reports. Off by default.
  • Speech is sent in batches, one Discord message every 10 s, to stay within Discord's rate limit.

What it does not do

  • No Twitter, Instagram or paid ads: that belongs to the phone.
  • No radio chat by frequency: that belongs to voice (for example, pma-voice).
  • No emojis, GIFs or images.
  • No profanity filter. If you want one, use the alm_chat:beforeMessage event or chatMessage (see "For other scripts").
  • By default, players have no ID next to their name, and joins and leaves are not shown (they would show the account name).

Download

Get alm_chat-<version>.zip from the Releases page. Do not use "Source code (zip)" or GitHub's "Download ZIP" button: they deliver the folder with another name. Installation steps are in INSTALL.md.

Requirements

  • oxmysql (required): stores the panel settings in the alm_chat_settings table, created automatically. That is the only database use: no message is stored.
  • A recent FXServer with OneSync and lua54.
  • The default chat turned off: both together do not work. See INSTALL.md.

Works with

Base Status
QBCore adapter included: character name, job, duty and downed. tested in game (qb-core 1.3.0)
No framework (standalone) account name, nobody downed, job channels by ACE permission. Written and checked; in-game test pending
vRP / Creative, Qbox, ESX planned for future versions

Performance

Not measured in game yet. There is no per-frame loop while idle: the chat key comes from FiveM's key mapping, and the only per-frame loop is the /me text, which only runs while there is text on screen.

Commands

Command Who What it does
text without a slash everyone speech (local, global or off)
/me <action> everyone character action, in the chat and above the head
/do <description> everyone scene description
/ooc <message> everyone out-of-character speech, for people nearby
/try <action> everyone attempt: the server draws whether it worked
/anuncio <message> everyone or only some jobs (off by default) announcement to the whole city
/policia <message> on-duty police police channel
/staff <message> whoever has the alm_chat.staff ACE staff channel
/atalhos everyone saves the action shortcuts
/limpar everyone clears your own chat
/togglechat [auto|always|typing] everyone fades on its own, always visible or only while typing
/chatadmin admin configuration panel
say <text> server console notice to everyone

The chat opens with T and closes with Esc. Command names can be changed in Config.Commands and keys in Config.Key and Config.ToggleKey, in config.lua. Players can also change keys in Settings > Key Bindings > FiveM. Channels are changed in the panel (Channels tab).

QBCore's /me and /ooc. qb-core has its own /me and /ooc. alm_chat takes over both (and any qb-core command with the name of one of its commands or channels) without editing qb-core: the qb-core ones stop running.

Compatible with the default chat

The manifest declares provide 'chat': scripts with dependency 'chat' start with alm_chat. Scripts keep sending messages the same way:

  • client events chat:addMessage (table or text, with args, color, multiline, template and params), chatMessage, chat:addSuggestion, chat:addSuggestions, chat:removeSuggestion, chat:addTemplate, chat:addMode, chat:removeMode and chat:clear;
  • client exports addMessage and addSuggestion; server exports addMessage, registerMessageHook and registerMode;
  • server event chatMessage, fired before delivering speech without a slash and cancelable with CancelEvent();
  • color codes ^0 to ^9, ^#rrggbb and ^*;
  • template with filtered HTML: common tags and classes go through, and scripts and events never run. The filter was built so the qb-inventory card and the qb-adminmenu notice show (in-game test pending);
  • suggestions for registered commands, filtered by each player's permission;
  • the chat_showJoins and chat_showQuits convars, which override the panel.

registerMode works in a simple form: the mode shows as a badge in the text box and Tab switches between modes (Shift+Tab goes back).

Exports answer through exports.alm_chat. Whether exports.chat also points to alm_chat has not been checked in game yet; no script in a clean QBCore uses exports.chat.

The server part that passes speech through other scripts' hooks and modes was written to accept the same API as FiveM's default chat (updateMessage, cancel, setSeObject, setRouting).

For other scripts

All server side, except where it says "client".

Send a message

-- exports.alm_chat:Send(target, text, kind, from)
-- target: player ID or -1 for everyone. kind: 'system' (default), 'announce' or 'city' (with the `from` tag).
-- Returns true if sent.
exports.alm_chat:Send(-1, 'Server restarts in 10 minutes.')
exports.alm_chat:Send(-1, 'Fair at the square at 8 pm.', 'city', 'CITY HALL')

City radio

-- exports.alm_chat:News(kind, data): the kind must exist in the panel (Radio tab).
-- data.name fills the {name} in the line (a business name, never a player). Returns true if the news was queued.
exports.alm_chat:News('business_open', { name = 'Square Market' })

The news is refused (returns false) if the radio is off, the kind does not exist, the queue is full, the same kind went out recently (default: 10 min) or the line needs {name} and no name was sent.

Default chat API: addMessage, addSuggestion (client), registerMessageHook and registerMode work as in the default chat, through exports.alm_chat.

Block a message (word filter, muted player)

-- Fires for speech without a slash, /me, /do, /ooc, /try, /anuncio, shortcuts and channels.
-- kind: 'say', 'me', 'do', 'ooc', 'try', 'announce' or 'channel' (with the channel command as the 4th value).
AddEventHandler('alm_chat:beforeMessage', function(src, kind, text, channel)
    if text:lower():find('forbidden word', 1, true) then CancelEvent() end
end)

The default chat's chatMessage event also fires, but only for speech without a slash.

Logs

AddEventHandler('alm_chat:log', function(action, src, data)
    print(action, src, json.encode(data))
end)
action When data
chat every speech, scene, shortcut, channel message and announcement kind, text, label (channel, mode or shortcut), heard (how many received it)
news every news item that goes on air (src = 0) kind, text
settings a section saved in the panel section, before, after
settings_reset a section (or everything, *) back to default section
settings_import backup imported {}

The event always fires. The webhook gets panel actions whenever it is filled in, and speech only with "Log to the webhook" on (section "Log of what was said"). News does not go to the webhook.

Configuration

  • Panel (/chatadmin): the easiest way. It overrides config.lua and is stored in the database.
  • config.lua: the starting value of everything, with one comment per option. Language, framework, version check, commands and keys only change here.
  • locales/pt-br.lua and locales/en.lua: all texts, including the screen ones.
  • Webhook: only in the panel (General tab) or with the set alm_chat_webhook "https://..." convar in server.cfg. Never in config.lua, which is sent to every player's game.

Adjustable files and system files

  • Adjustable: config.lua, locales/ and bridge/. This is where you make changes, and support covers the product with changes in these three places. The bridge/ folder connects to the framework.
  • System: client/, server/, html/, shared/, sql/ and fxmanifest.lua. They are open to read; changes there are not covered by support.

Do not rename the folder: the database table, permissions, webhook convar, events and exports use the name alm_chat, and other scripts call exports.alm_chat.

Bridge (connecting another framework)

The code only talks to the framework through the bridge/ folder. For another framework, copy the standalone adapter, change the name and add a line to KNOWN in bridge/shared.lua. The chat uses these server adapter functions (bridge/server/<framework>.lua):

Function Returns In standalone
GetName(src) character name, or nil if not loaded account name
IsDowned(src) true if downed (dead or in last stand) always false
HasJob(src, { job = minimum grade }, onDuty) true if the player has any of the jobs ACE alm_chat.job.<job> (no grade or duty)
IsAdmin(src) framework admin (opens the panel) always false
Notify(src, text, kind) on-screen notice (info, success or error) the game's own notification
TakeCommand(name, fn) takes over a command the framework also registers does nothing

Open code

All code in this repository is open to read, with no obfuscation and no lock. The server decides everything: range, wait, length, permissions, channels, the /try result and what the radio says. The screen only draws.

The script does not collect or send data from your server. With Config.VersionCheck on, it only reads a public file (https://raw.githubusercontent.com/dalmeidasdev/versions/main/versions.json) to warn in the console when a new version is out (server/version.lua). The only other outgoing call is the webhook, if you fill it in, and it goes to your server's Discord.

License

Free use on any server and changes for your own use. Selling or republishing is not allowed; forking on GitHub to study or propose changes is allowed. Full text in the LICENSE file.

Support

On the Almeida Scripts Discord: https://discord.gg/dfuF2gz8NQ. Include: framework and version, server build, the error copied from the console and from F8, and what you changed in config.lua, locales/ or bridge/.

About

Chat de RP gratuito para FiveM (QBCore e standalone) - Almeida Scripts

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages