Hi i was wondering if anyone would know how to get my /me in my server to look like Doj ive been trying diff things but cant seem to find out how to do it any help would be great. this is currently what i have and its bad in game. i am also trying to get it like this i want (> orange) ( : Red) then (persons in game name- White) then what ever you type also white like this…
or just however DOJ /me is if anyone knows how that is and how to make it look like that!!
i have that one working.
Server.lua
AddEventHandler('chatMessage', function(source, name, msg)
sm = stringsplit(msg, " ");
if sm[1] == "/me" then
CancelEvent()
TriggerClientEvent('chatMessage', -1, "^3>^1:^0 " .. name .. '^0' .. string.sub(msg,4))
end
end)
function stringsplit(inputstr, sep)
if sep == nil then
sep = "%s"
end
local t={} ; i=1
for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
t[i] = str
i = i + 1
end
return t
end
alright ill try that out and let you know if its working for me thanks alot ive been trying to do that myself for along time now!!~
Instead of using this old hack, why not use the RegisterCommand native??
RegisterCommand("me", function(source, args, rawCommand)
TriggerClientEvent('chatMessage', -1, "^3>^1:^0 " .. name .. '^0' .. string.sub(rawCommand, 4))
end)
this works thank you so much do you know or have one more thing ive been looking for like the command /textchat to disable txtchat for that person who wants to disable the chat
one more thing ive been looking for like the command /textchat to disable txtchat for that person who wants to disable the chat
what do you mean by that? it works perfect for me
Yes but RegisterCommand is way better to use. It is an actual native not a “hack” as Havoc said.
what does hack mean? and i only used this line out of it
‘chatMessage’, -1, "^3>^1:^0 " … name … ‘^0’ … string.sub(msg,4))
It is up to you what you use but, @Havoc 's solution is better.
alright ill try it but will it be the same exact thing?
his doesnt work for me
Either one is fine all he is saying is, instead of using the old method, with a function, You can just use the native which is designed for creating commands.
ya his wont work yours does tho
here’s the chat toggle just copy and replace the chat resource in /fxserver/resources/system/chat/ and then either restart chat or restart your server then join in and do /togglechat
will it mess with anything els i have my chat to where its transparent will it interfere with that
nope that is in the html folder so to not mess that up just copy the chat client and chat server lua files to your chat folder