[System Chat] Commands /tweet [Error]

Hello guys.

I would like to ask is it possible to make a “/tweet” command in this fiie:
\resources[system]\chat and then take “sv_chat” file?

so when I type /tweet Hello guys

Then its loke like this:

“[Twitter] Username: Hello guys.”

Hope you will answer this thanks. :slight_smile:

Yes you can have at these for ideas and take note of the code;

A simple search and you could find many more. If this solved your question click the box below to mark as solved.

If i use the first one “Tweet.rar”
Where do i put the files? :slight_smile:

And thanks for post this…

It should be as a resource already if you want it in a /me /do etc. as well look into the second one.

When i go to resource, I only have the resource i use.
im a really noob sorry, but when i have downloaded “servercommands” where do i but that?
do I have to go into: server.cfg
and add: starter servercommands?
please guide me haha :smiley:

It would go into your resources folder

https://wiki.fivem.net/wiki/Resource

EDIT: If you want /me etc. in one script have a look at that second one I sent earlier as it also has a twitter command

Yeah it’s than one i want to use. So i just copy the folder called “Servercommands” into: resources and start the server, and then its should it works right? :smiley:

Copy it over into your resources folder, Open your server.conf and add start Servercommands to the list of starts You can rename the folder if you want just make sure its the same in the config.

1 Like

I don’t know why, but it wont work for me…

34ec319544cb197d4d99569968509b5b

EDIT/ - Sorry if im really stupid, but i ty to be good at this ahah :smiley:

Do i need to have another mod/script - to make it works? :slight_smile:

Make sure, that your servercommands folder, doesnt have another servercommands folder inside of it.
There are tons of instructions around the forums to use at your disposal.

1 Like

There is only 2 files: _resource and server

I get this ERROR everytime i make a command /me or /ooc

Error running system event handling function for resource chat: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: sv_chat.lua:30: bad argument #1 to ‘sub’ (string expected, got nil)
stack traceback:
[C]: in function ‘string.sub’
sv_chat.lua:30: 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
No such command ooc.
[Roeklasker]: d
Error running system event handling function for resource chat: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: sv_chat.lua:30: bad argument #1 to ‘sub’ (string expected, got nil)
stack traceback:
[C]: in function ‘string.sub’
sv_chat.lua:30: 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
No such command me.

any fix to this problem with server files resources[system]\chat

… don’t edit those files and just use a resource listening to events instead? wtf?

i just want a tweet script with an icon on it like this https://gyazo.com/61f1a17b17acb09a2d515864bff5e4a6

you don’t have to edit the chat for that though?

how do you do it then so the icon shows

TriggerEvent('chat:addTemplate', 'tweet', "<img src='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxz%0D%0AdmcKICB2aWV3Ym94PSIwIDAgMjAwMCAxNjI1LjM2IgogIHdpZHRoPSIyMDAwIgogIGhlaWdodD0i%0D%0AMTYyNS4zNiIKICB2ZXJzaW9uPSIxLjEiCiAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAv%0D%0Ac3ZnIj4KICA8cGF0aAogICAgZD0ibSAxOTk5Ljk5OTksMTkyLjQgYyAtNzMuNTgsMzIuNjQgLTE1%0D%0AMi42Nyw1NC42OSAtMjM1LjY2LDY0LjYxIDg0LjcsLTUwLjc4IDE0OS43NywtMTMxLjE5IDE4MC40%0D%0AMSwtMjI3LjAxIC03OS4yOSw0Ny4wMyAtMTY3LjEsODEuMTcgLTI2MC41Nyw5OS41NyBDIDE2MDku%0D%0AMzM5OSw0OS44MiAxNTAyLjY5OTksMCAxMzg0LjY3OTksMCBjIC0yMjYuNiwwIC00MTAuMzI4LDE4%0D%0AMy43MSAtNDEwLjMyOCw0MTAuMzEgMCwzMi4xNiAzLjYyOCw2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Message', { templateId = 'tweet', multiline = true, args = { 'Blu', 'tianshee was mean to me today 🙁' } })

for example

1 Like

Where do i put these command lines?