mirror of
https://github.com/citizenfx/cfx-server-data.git
synced 2025-01-10 15:43:00 +08:00
35 lines
1.1 KiB
Lua
35 lines
1.1 KiB
Lua
RegisterServerEvent('chatCommandEntered')
|
|
RegisterServerEvent('chatMessageEntered')
|
|
|
|
RegisterServerEvent('chat:init')
|
|
RegisterServerEvent('chat:addTemplate')
|
|
RegisterServerEvent('chat:addMessage')
|
|
RegisterServerEvent('chat:addSuggestion')
|
|
RegisterServerEvent('chat:removeSuggestion')
|
|
RegisterServerEvent('_chat:messageEntered')
|
|
RegisterServerEvent('chat:clear')
|
|
|
|
AddEventHandler('_chat:messageEntered', function(author, color, message)
|
|
if not message or not author then
|
|
return
|
|
end
|
|
|
|
TriggerEvent('chatMessage', source, author, message)
|
|
|
|
if not WasEventCanceled() then
|
|
print("No cancel")
|
|
TriggerClientEvent('chatMessage', -1, author, { 255, 255, 255 }, message)
|
|
end
|
|
|
|
print(author .. ': ' .. message)
|
|
end)
|
|
|
|
-- player join messages
|
|
AddEventHandler('playerActivated', function()
|
|
TriggerClientEvent('chatMessage', -1, '', { 255, 255, 255 }, '^2* ' .. GetPlayerName(source) .. ' joined.')
|
|
end)
|
|
|
|
AddEventHandler('playerDropped', function(reason)
|
|
TriggerClientEvent('chatMessage', -1, '', { 255, 255, 255 }, '^2* ' .. GetPlayerName(source) ..' left (' .. reason .. ')')
|
|
end)
|