Add of /do (#18)

* Add /do

!Needs check of translations except for English!

* Hotfix: locales first letter case

* Hotfix: French typo
This commit is contained in:
David Rychlý
2018-08-13 20:13:35 +02:00
committed by Anthony
parent cef4bbd8a1
commit 4e4484f0ff
6 changed files with 25 additions and 7 deletions
+4 -2
View File
@@ -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)
end)
+3 -1
View File
@@ -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!',
}
}
+3 -1
View File
@@ -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!',
}
}
+3 -1
View File
@@ -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!',
}
}
+3 -1
View File
@@ -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!',
}
}
+9 -1
View File
@@ -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
end