I’ve noticed on my server the following has happend.
When I type “/do test” the only thing that appears in chat is
I’ve noticed on my server the following has happend.
When I type “/do test” the only thing that appears in chat is
To add on, I noticed when I did /goto (RANDOMWORD/CHARACTER) (ID) my chat began to run commands.
Not exactly sure what the issue is… /do outputs OOC ? That’s because if a script, not a fivem issue, so you don’t need technical support. Moved to #development:scripts instead.
If you could add your code for commands to the post that would be useful
-- DO COMMAND (/do [Message]) Outcomes: Action: *Name Message
TriggerEvent('es:addCommand', 'do', function(source, args, user)
table.remove(args, 1)
TriggerClientEvent('chatMessage', -1, "^5Action", {255, 0, 0}, " ^0* " .. GetPlayerName(source) .." ".."^0 " .. table.concat(args, " "))
end, function(source, args, user)
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficienct permissions!")
end)
-- ME COMMAND (/me [Message]) Outcomes: Name Message (All in purple)
TriggerEvent('es:addCommand', 'me', function(source, args, user)
table.remove(args, 1)
TriggerClientEvent('chatMessage', -1, "", {255, 0, 0}, " ^6 " .. GetPlayerName(source) .." ".."^6 " .. table.concat(args, " "))
end, function(source, args, user)
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficienct permissions!")
end)
Should fix the /do command. What was wrong with the /me command?
-- DO COMMAND (/do [Message]) Outcomes: Action: *Name Message
TriggerEvent('es:addCommand', 'do', function(source, args, user)
table.remove(args, 1)
TriggerClientEvent('chatMessage', -1, "", {255, 0, 0}, "5Action ^0* " .. GetPlayerName(source) .." ".."^0 " .. table.concat(args, " "))
end, function(source, args, user)
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficienct permissions!")
end)
-- ME COMMAND (/me [Message]) Outcomes: Name Message (All in purple)
TriggerEvent('es:addCommand', 'me', function(source, args, user)
table.remove(args, 1)
TriggerClientEvent('chatMessage', -1, "", {255, 0, 0}, " ^6 " .. GetPlayerName(source) .." ".."^6 " .. table.concat(args, " "))
end, function(source, args, user)
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficienct permissions!")
end)
-- [[-----------------------------------------------------------------------
-- ActionMenu By WolfKnight
-- Script By Kvetz
-- Thanks Titch For The Help!
-- ---------------------------------------------------------------------]]--
AddEventHandler('chatMessage', function(source, name, msg)
sm = stringsplit(msg, " ");
if sm[1] == "/ooc" then
CancelEvent()
TriggerClientEvent('chatMessage', -1, "OOC | " .. name, { 196, 255, 0 }, string.sub(msg,5))
elseif sm[1] == "/pts" then
CancelEvent()
TriggerClientEvent("yt:PlaceCone", source)
TriggerClientEvent('chatMessage', source, 'Service ', { 196, 255, 0 }, 'Cone Placed!')
elseif sm[1] == "/911" then
CancelEvent()
TriggerClientEvent('chatMessage', -1, "911 | " .. name, { 13, 89, 146 }, string.sub(msg,5))
elseif sm[1] == "/tow" then
CancelEvent()
TriggerClientEvent('chatMessage', -1, "Tow | " .. name, { 160, 165, 13 }, string.sub(msg,5))
elseif sm[1] == "/twt" then
CancelEvent()
TriggerClientEvent('chatMessage', -1, "Twitter | " .. name, { 0, 255, 255 }, string.sub(msg,5))
elseif sm[1] == "/dis" then
CancelEvent()
TriggerClientEvent('chatMessage', -1, "Police Dispatcher | " .. name, { 135, 11, 48 }, string.sub(msg,5))
elseif sm[1] == "/help" then
CancelEvent()
TriggerClientEvent('chatMessage', source, 'Server', { 13, 89, 146 }, '/ooc for out of character, /911 to call the emergency services, /tow to call a tow trucker, /twt to tweet tomething, /me to explain an action')
elseif sm[1] == "/anc" then
CancelEvent()
TriggerClientEvent('chatMessage', -1, "Announce | " .. name, { 246, 223, 14 }, string.sub(msg,5))
elseif sm[1] == "/ubr" then
CancelEvent()
TriggerClientEvent('chatMessage', -1, "Uber | " .. name, { 14, 161, 246 }, string.sub(msg,5))
elseif sm[1] == "/loadout" then
CancelEvent()
TriggerClientEvent("ToggleActionmenu", source)
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
Did your /do command get fixed with what I posted? And If so what is wrong with what you just posted.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.