Good evening
I’m trying to call in a function from my server.lua file in my client.lua file.
I already tried RegisterServerEvent and TriggerServerEvent but this didn’t work out for me.
Files:
Client.lua
function triggerIntraAlert(alertID)
TriggerServerEvent("addIntraAlert", alertID)
SetNotificationTextEntry("STRING")
AddTextComponentString(alertID)
DrawNotification(true, true)
end
Server.lua
RegisterServerEvent("addIntraAlert")
AddEventHandler("addIntraAlert", function()
MySQL.Async.fetchAll("INSERT INTO intraalerts (uid, alertid, message, active) VALUES(@name, @alertid, @message, @active)",
{
["@name"] = "xPlayer.accounts[i].name",
["@alertid"] = "0",
["@message"] = "Vrij",
["@active"] = "1"
}
)
end)
Thanks