Rp Chat anontweet commad

Im using this for /anontwt and i got this error… How do I fix it so I don’t write a mistake?
Im want ingame /twitter and /anontwt and /ad And I don’t know anything because he keeps making mistakes.Thank you very much for the answers, help in advance.

RegisterCommand(‘anontwt’, function(source, args, rawCommand)

if source == 0 then

    print('esx_rpchat: you can\'t use this command from rcon!')

    return

end

args = table.concat(args, ' ')

local name = GetPlayerName(source)

if Config.EnableESXIdentity then name = GetCharacterName(source) end

TriggerClientEvent('chat:addMessage', -1, { args = { _U('twt_prefix', 'Anonymous'), args }, color = { 0, 153, 204 } })

print(('%s: %s'):format(name, args))

end, false)

this is what my chat looks like with edited esx_rpchat and chat-theme-civlifechat and the chat resource, dunno if my code works without the two other resources.

mychat

 RegisterCommand('anontweet', function(source, args, rawCommand)
    local playerName = GetPlayerName(source)
    local msg = rawCommand:sub(11)
    local name = getIdentity(source)
    fal = name.firstname .. " " .. name.lastname
    TriggerClientEvent('chat:addMessage', -1, {
        template = '<div style="padding: 0.5vw; margin: 0.5vw; background-color: rgba(28, 160, 242, 1); border-radius: 3px;"><i class="fab fa-twitter"></i> @Anonymous:<br> {1}</div>',
        args = { fal, msg }
    })
end, false)

cfx> SCRIPT ERROR: @esx_rpchat/server/main.lua:9: attempt to index a nil value (
global ‘MySQL’)

handler (@esx_rpchat/server/main.lua:30)
handler (@chat/sv_chat.lua:15)
Tbence: teszt
SCRIPT ERROR: @esx_rpchat/server/main.lua:9: attempt to index a nil value (globa
l ‘MySQL’)
handler (@esx_rpchat/server/main.lua:30)
handler (@chat/sv_chat.lua:15)

sure here you go, i hope it works just copy and paste

my chat.7z (134.6 KB)

1 Like

This is the problem our esx_rpchat

cfx> SCRIPT ERROR: @esx_rpchat/server/main.lua:9: attempt to index a nil value (
global ‘MySQL’)

handler (@esx_rpchat/server/main.lua:30)
handler (@chat/sv_chat.lua:15)
Tbence: teszt
SCRIPT ERROR: @esx_rpchat/server/main.lua:9: attempt to index a nil value (globa
l ‘MySQL’)
handler (@esx_rpchat/server/main.lua:30)
handler (@chat/sv_chat.lua:15)

hmm, i just tried making a new esx server from scratch and copied it over and it worked like a charm when i replaced the chat and rpchat and installed chat-theme-civlifechat which is basically just a css script.

im not really that much into coding, just played around with the css code and added commands i needed.

did you delete the chat and rpchat before copying the scripts over?

hi, im having error with your script. it says it doesnt have/load __resource.lua file in [chat]

i solved your ploblem
if u want i`ll give u

1 Like

Can you send me please

[esx].zip (20.3 KB)

put in to resource and start it

TY men

how did you get it to work?

This is a NONE ESX Script but I might still work. [Release] FiveM Chat | NCCPack | FiveM Chat With Changeable Name & More! (Non-ESX)

Anyone know how to make the chat box smaller?

1 Like

yo bro can u sent this chat?