Hi,
I need help with a script. I’m trying to insert stuff into a database from fivem and when I try and add spaces it decides not to work for me so for example /mdtremarks ls21 20 ic1 male has been arrested for gbh it only shows ic1 anyone got any idea?
server
RegisterServerEvent("remarks")
AddEventHandler("remarks", function(unit, callid, content)
local identifiers = GetPlayerIdentifiers(source)
if GlobalConfig.UseDatabase then
MySQL.Async.execute("INSERT INTO `remarks` (`unit`, `callid`, `content`) VALUES (@unit, @callid, @content) "..
"ON DUPLICATE KEY UPDATE `unit` = @unit, `callid` = @callid, `content` = @content", {
["@unit"] = unit,
["@callid"] = callid,
['@content'] = content,
}, function()end)
else
end
end)
Client
-- To do an PNC Check
RegisterCommand("mdtremark", function(source, args, raw)
if #args <3 then
TriggerEvent("chat:addMessage", {args = {"^1SERVER^0:^8 Usage: /mdtstate <unit> <caddlid> <remark> "}})
return
end
unit = args[1]
callid = args[2]
content = args[3]
TriggerServerEvent("remarks", unit, callid, content)
TriggerEvent("chat:addMessage", {
multiline = false,
args = {
"^3MDT: You have been cleared"
}
})
end, false)