[Release] ChatBasics (/pm, /me, /do, localchat, /b)

This plugin is in my opinion what is missing today from a lot of rp servers. Chat basics adds some extra commands for players to use during rp, as well as help filter chat and keep the global ooc to a minimum.

Commands Showcase

/b
This is a local ooc chat if you want to talk to the players that are nearby oocly. This way, only the people involved in the rp scenario will see chat and the other players in the server won’t have to see irrelevant stuff.
Usage: /b message
image

/me
Local /me to describe an action you are doing. Only nearby players can see it.
Usage: /me action
image

/do
Local /do to interact with players in rp. Only nearby players can see it.
Usage: /do question/description
image

/pm
This feature is for sending a Private Message to a player. That way you can communicate with someone on the server without flooding Global OOC chat.
Usage: /pm ID message
image
image

Disclaimer: The /pm function uses the session ID of a player, not the user ID. Session ID is the random number a player gets when joining the server, whilst user ID is the number a player gets when he first joins the server and never changes.

Local IC Chat
I am not sure why anyone would use this in FiveM, but I added it in anyways. How this works is you just type in chat, nothing more. Then, a local chat message will appear, seen only by players nearby. This is aimed for those who do not have a working mic, but still want to participate in rp.
image

Installation guide
In order to install this, you will need to have essentialmode. In case you don’t have essentialmode, I put a download to it below. If you do have it and installed the plugin, but the /me /do and /b don’t work, just use the version I provided below.
essentialmode.zip (65.9 KB)

After that, download the plugin from here and drag it into your \resources folder.
Make sure to add start chatbasic in the server.cfg
chatbasic.zip (1.9 KB)

14 Likes

Is it possible to make it standalone?

2 Likes

Without essentialmode? I don’t think so as that is what I am using for the local chat. However if you take the /pm function, that doesn’t require essentialmode.

Thanks for the release works perfect +1
Can only recommend, perfect to have 1 resource for all of your chat commands

-Clyde

1 Like

why would you use essentialmode in the first place… you could have just made it standalone…

2 Likes

It was easier to do it with the es base, plus I think most people have ES for their server. However if you would like to make a standalone version of it or help me make one, it would be cool with me.

Changelog

  • Fixed a bug with the /pm function
Error running system event handling function for resource essentialmode: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: citizen:/scripting/lua/scheduler.lua:547: Cannot index a funcref
stack traceback:
        [C]: in function 'error'
        citizen:/scripting/lua/scheduler.lua:547: in metamethod '__index'
        server/main.lua:153: in function 'addCommand'
        server/main.lua:167: in upvalue 'handler'
        citizen:/scripting/lua/scheduler.lua:175: in function <citizen:/scripting/lua/scheduler.lua:174>
stack traceback:
        [C]: in function 'error'
        citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow'
        citizen:/scripting/lua/scheduler.lua:174: in function <citizen:/scripting/lua/scheduler.lua:138>

Everytime i try to start it. Does it need to be started in server.cfg to work or can i just start it ingame?

Got the same error but it shouldn’t affect how the plugin works.

Make sure you start essentialmode in server.cfg however, as you need to do it in order for the script to work.

I have essentialmode started, but not the chatbasic one started in server.cfg

Start that one too. You need to have both of them in there.

i’ve taken a look at the source, seems like all you have to do is replace the essentialsmode’s “addcommand” with the native RegisterCommand, nothing that hard…

where and how i should change because it is getting name from stream name not from register i mean it should be ex. John Wick touching his leg. not the steam name

How to repair that?

That isn’t a bug as from the screenshot you can see that the script works fine. You got another resource installed called “commands” most likely that has a global /me (u can see it in the screenshot is the red me). The commands resource doesn’t recognize /do so it tells you that it isn’t a command. However the /do from my script works as in the screen you can see it before the errors from the other resource.

I know. I say how to repair that “/b is not a valid command!” And how to disable that global command /me

Try checking the console for what resource causes that message, as it isn’t from my one.

Changelog

  • Fixed /pm to properly display messages.

Is there a way to have it display character name rather then steam name?

1 Like

Yes you can change up the code to do that