diff --git a/client/main.lua b/client/main.lua index 3b0edf2b..a95c4007 100644 --- a/client/main.lua +++ b/client/main.lua @@ -2,7 +2,7 @@ RegisterNetEvent('esx_rpchat:sendProximityMessage') AddEventHandler('esx_rpchat:sendProximityMessage', function(id, title, message, color) local source = PlayerId() local target = GetPlayerFromServerId(id) - + if target == source then TriggerEvent('chat:addMessage', { args = { title, message }, color = color }) elseif GetDistanceBetweenCoords(GetEntityCoords(GetPlayerPed(source)), GetEntityCoords(GetPlayerPed(target)), true) < 19 then @@ -14,6 +14,7 @@ Citizen.CreateThread(function() TriggerEvent('chat:addSuggestion', '/ooc', _U('ooc_help'), { { name = _U('ooc_argument_name'), help = _U('ooc_argument_help') } } ) TriggerEvent('chat:addSuggestion', '/twt', _U('twt_help'), { { name = _U('ooc_argument_name'), help = _U('ooc_argument_help') } } ) TriggerEvent('chat:addSuggestion', '/me', _U('me_help'), { { name = _U('ooc_argument_name'), help = _U('ooc_argument_help') } } ) + TriggerEvent('chat:addSuggestion', '/do', _U('do_help'), { { name = _U('ooc_argument_name'), help = _U('ooc_argument_help') } } ) TriggerEvent('chat:addSuggestion', '/news', _U('news_help'), { { name = _U('ooc_argument_name'), help = _U('ooc_argument_help') } } ) end) @@ -22,6 +23,7 @@ AddEventHandler('onResourceStop', function(resource) TriggerEvent('chat:removeSuggestion', '/ooc') TriggerEvent('chat:removeSuggestion', '/twt') TriggerEvent('chat:removeSuggestion', '/me') + TriggerEvent('chat:removeSuggestion', '/do') TriggerEvent('chat:removeSuggestion', '/news') end -end) \ No newline at end of file +end) diff --git a/locales/en.lua b/locales/en.lua index 494df83d..e5bd70bf 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -5,9 +5,11 @@ Locales['en'] = { ['twt_prefix'] = '^0[^4Twitter^0] (^5@%s^0)', ['me_help'] = 'personal action', ['me_prefix'] = 'me | %s', + ['do_help'] = 'rP information', + ['do_prefix'] = 'do | %s', ['news_help'] = 'announce news (do not abuse)', ['news_prefix'] = 'news | %s', ['ooc_argument_name'] = 'message', ['ooc_argument_help'] = 'the message', ['ooc_unknown_command'] = '^3%s^0 is not a valid command!', -} \ No newline at end of file +} diff --git a/locales/fi.lua b/locales/fi.lua index 0a2fcc64..bf4fb81a 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -5,9 +5,11 @@ Locales['fi'] = { ['twt_prefix'] = '^0[^4Twitter^0] (^5@%s^0)', ['me_help'] = 'teet jotain', ['me_prefix'] = 'me | %s', + ['do_help'] = 'roolipeliä tiedot', --TODO: check translation + ['do_prefix'] = 'do | %s', ['news_help'] = 'ilmoita uutinen (älä abuse)', ['news_prefix'] = 'news | %s', ['ooc_argument_name'] = 'viesti', ['ooc_argument_help'] = 'viestin sisältö', ['ooc_unknown_command'] = '^3%s^0 ei ole validi komento!', -} \ No newline at end of file +} diff --git a/locales/fr.lua b/locales/fr.lua index a0ac7cd4..108c6bad 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -5,9 +5,11 @@ Locales['fr'] = { ['twt_prefix'] = '^0[^4Twitter^0] (^5@%s^0)', ['me_help'] = 'action personnelle', ['me_prefix'] = 'me | %s', + ['do_help'] = 'rP information', --TODO: check translation + ['do_prefix'] = 'faire | %s', ['news_help'] = 'annonce une information (ne pas en abuser)', ['news_prefix'] = 'info | %s', ['ooc_argument_name'] = 'message', ['ooc_argument_help'] = 'le message', ['ooc_unknown_command'] = '^3%s^0 n\'est pas une commande valide!', -} \ No newline at end of file +} diff --git a/locales/sv.lua b/locales/sv.lua index d4020d27..0d24eb7a 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -5,9 +5,11 @@ Locales['sv'] = { ['twt_prefix'] = '^0[^4Twitter^0] (^5@%s^0)', ['me_help'] = 'skriv en händelse, t.ex \'visar körkort\'', ['me_prefix'] = 'jag | %s', + ['do_help'] = 'rollspelinformation', --TODO: check translation + ['do_prefix'] = 'do | %s', ['news_help'] = 'meddela en nyhet (missbruka inte)', ['news_prefix'] = 'TV4 Stockholm', ['ooc_argument_name'] = 'meddelande', ['ooc_argument_help'] = 'det meddelandet du vill skicka', ['ooc_unknown_command'] = '^3%s^0 är inte ett giltigt kommando!', -} \ No newline at end of file +} diff --git a/server/main.lua b/server/main.lua index d720ca20..cecc16db 100644 --- a/server/main.lua +++ b/server/main.lua @@ -31,6 +31,14 @@ RegisterCommand('me', function(source, args, rawCommand) TriggerClientEvent('esx_rpchat:sendProximityMessage', -1, source, _U('me_prefix', name), rawCommand, { 255, 0, 0 }) end, false) +RegisterCommand('do', function(source, args, rawCommand) + rawCommand = string.sub(rawCommand, 3) + local name = GetPlayerName(source) + if Config.EnableESXIdentity then name = GetCharacterName(source) end + + TriggerClientEvent('esx_rpchat:sendProximityMessage', -1, source, _U('do_prefix', name), rawCommand, { 0, 0, 255 }) +end, false) + RegisterCommand('news', function(source, args, rawCommand) rawCommand = string.sub(rawCommand, 5) local name = GetPlayerName(source) @@ -55,4 +63,4 @@ function GetCharacterName(source) else return GetPlayerName(source) end -end \ No newline at end of file +end