TriggerEvent('b-notify:notify', 'success', 'SUCCESS', 'You have enough Money')
TriggerEvent('b-notify:notify', 'error', 'ERROR', 'You don't have enough money')
TriggerEvent('b-notify:notify', 'info', 'INFO', 'You received a SMS from Skurllex')
TriggerEvent('b-notify:notify', 'teamchat', 'TEAMCHAT', 'Please check the Player ID 8', 'Bvrtck')
TriggerEvent('b-notify:notify', 'police', 'POLICE', 'PoliceDepartment called')
TriggerEvent('b-notify:notify', 'medic', 'MEDIC', 'Medical Department called')
server examples:
TriggerClientEvent('b-notify:notify', source, 'success', 'SUCCESS', 'You have enough Money')
TriggerClientEvent('b-notify:notify', source, 'error', 'ERROR', 'You don't have enough money')
TriggerClientEvent('b-notify:notify', source,'info', 'INFO', 'You received a SMS from Skurllex')
TriggerClientEvent('b-notify:notify', source,'teamchat', 'TEAMCHAT', 'Please check the Player ID 8', 'Bvrtck')
TriggerClientEvent('b-notify:notify', source,'police', 'POLICE', 'PoliceDepartment called')
TriggerClientEvent('b-notify:notify', source,'medic', 'MEDIC', 'Medical Department called')
-- serverside code example | not made by us.
function get_phone_number(identifier)
MySQL.Async.fetchScalar("SELECT phone_number FROM users WHERE identifier = @identifier", {['@identifier'] = identifier}, function(result)
return result
end)
end
ESX.RegisterServerCallback("b-notify:getPhoneNumber", function(source, cb)
local src = source
local identifier = ESX.GetPlayerFromId(src).identifier
cb(get_phone_number(identifier) or nil, xPlayer.name or nil)
end)
-- clientside code example | not made by us.
ESX.TriggerServerCallback("b-notify:getPhoneNumber", function(number, name)
TriggerEvent('b-lifeinvader', "LIFEINVADER", "TEST AD", name, number, "E")
end)
Teamchat
Snippet
-- serverside code example | not made by us.
local groups = {
"superadmin",
}
function isAllowed(group)
for k, v in pairs(groups) do
if v == group then
return true
end
end
return false
end
RegisterCommand("tc", function(source, args, rawCMD)
local src = source
local msg = table.concat(args, " ")
local xPlayer = ESX.GetPlayerFromId(src)
if isAllowed(xPlayer.getGroup()) then
for key, value in pairs(GetPlayers()) then
local xPlayers = ESX.GetPlayerFromId(value)
if isAllowed(xPlayers.getGroup()) then
TriggerClientEvent('b-notify:notify', xPlayers.source, 'teamchat', 'TEAMCHAT', msg, xPlayer.getName())
end
end
else
TriggerClientEvent('b-notify:notify', source, 'error', 'TEAMCHAT', 'You are not allowed to use this command')
end
end)