Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Stuyk/rebar-chat
A chat system for the Rebar Framework
https://github.com/Stuyk/rebar-chat
Last synced: about 22 hours ago
JSON representation
A chat system for the Rebar Framework
- Host: GitHub
- URL: https://github.com/Stuyk/rebar-chat
- Owner: Stuyk
- Created: 2024-05-20T16:41:22.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-09-22T12:59:53.000Z (3 months ago)
- Last Synced: 2024-12-15T08:49:01.126Z (8 days ago)
- Language: Vue
- Size: 20.5 KB
- Stars: 3
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Chat for Rebar Framework
This plugin allows you to speak to other players who are near your player using the chat box.
Press `t` to chat, and type commands with `/` in front to execute commands.
![GTA5_uYyU0yyPUj](https://github.com/Stuyk/rebar-chat/assets/21284100/c4ec07d8-8c0e-4949-b4ae-98a6003088a1)
## Features
- Press `t` to chat
- Type commands or messages in the chat box
- Config for chat distance
- Config for global chat (disabled by default)
- Config for message length
- Config for messages to show on screen
- Chat color support by using `{FF0000} This message is red!`
- API check chat status through callbacks
- API check if player is chatting## API
```ts
import * as alt from 'alt-server';
import { useRebar } from '@Server/index.js';const Rebar = useRebar();
const api = Rebar.useApi();const chat = await api.getAsync('chat-api');
chat.onChatStatusChange((player, isCurrentlyChatting) => {
// do something
});// Ideally you only want to show the chat, after the player has fully logged in
alt.on('playerConnect', async (player) => {
// Check if they're chatting server-side
const isChatting = chat.isChatting(player);
});
```## Installation
From the main directory of your `Rebar` framework.
```
git clone https://github.com/Stuyk/rebar-chat src/plugins/chat
```That's it.
If you wish to save the plugin in your own repository, go to the `src/plugins/chat` folder and delete the `.git` folder.