I’m still kind of new to the client and server side of fivem, but lets go. The idea of my script is to send a notification to all members online.
first I test sending a message to everyone on the server with chat: addMenssage and it worked
TriggerClientEvent("chat:addMessage", -1, {color = {255,0,0}, multiline = true, args = {"[System]", "SERVER TEST"}})
but then I tried to do the same thing, creating a notify event on the client, and calling it on the server
Client:
RegisterNetEvent('notificarAll')
AddEventHandler('notificarAll',function(message)
function notifyAll(msg)
SetNotificationTextEntry("STRING")
AddTextComponentString(msg)
DrawNotification(0, 0, 0, -1)
end
notifyAll(message)
end)
Server:
TriggerClientEvent("notificarAll", -1, "SERVER TESTE!")
But unfortunately it doesn’t work, does anyone know how to tell me how to solve it? I already tried in many ways