diff --git a/README.md b/README.md index 14151baa..96fa6c1a 100644 --- a/README.md +++ b/README.md @@ -34,15 +34,13 @@ Client side ```lua RegisterNetEvent('esx_phone:loaded') AddEventHandler('esx_phone:loaded', function(phoneNumber, contacts) + local specialContact = { + name = 'societyName', + number = 'societyNumber', + base64Icon = 'insert base 64 icon' + } - local specialContact = { - name = 'societyName', - number = 'societyNumber', - base64Icon = 'insert base 64 icon (PNG recommended)' - } - - TriggerEvent('esx_phone:addSpecialContact', specialContact.name, specialContact.number, specialContact.base64Icon) - + TriggerEvent('esx_phone:addSpecialContact', specialContact.name, specialContact.number, specialContact.base64Icon) end) ``` @@ -62,7 +60,7 @@ last two booleans are optional ### License esx_phone - phone script for fivem -Copyright (C) 2015-2018 Jérémie N'gadi +Copyright (C) 2015-2019 Jérémie N'gadi This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version. diff --git a/client/main.lua b/client/main.lua index d84ffa76..27d25394 100644 --- a/client/main.lua +++ b/client/main.lua @@ -161,10 +161,10 @@ AddEventHandler('esx_phone:onMessage', function(phoneNumber, message, position, if job == 'player' then ESX.ShowNotification(_U('new_message', message)) else - ESX.ShowNotification('~b~' .. job .. ': ~s~' .. message) + ESX.ShowNotification(('~b~%s:~s~ %s'):format(job, message)) end - PlaySound(-1, "Menu_Accept", "Phone_SoundSet_Default", 0, 0, 1) + PlaySound(-1, 'Menu_Accept', 'Phone_SoundSet_Default', false, 0, true) SendNUIMessage({ newMessage = true, @@ -181,12 +181,12 @@ AddEventHandler('esx_phone:onMessage', function(phoneNumber, message, position, CurrentDispatchRequestId = dispatchRequestId CurrentActionData = { - phoneNumber = phoneNumber, - message = message, - position = position, - actions = actions, - anonyme = anon, - job = job + phoneNumber = phoneNumber, + message = message, + position = position, + actions = actions, + anonyme = anon, + job = job } ESX.SetTimeout(15000, function() diff --git a/html/css/app.css b/html/css/app.css index b1a4a4f4..9540a640 100644 --- a/html/css/app.css +++ b/html/css/app.css @@ -24,7 +24,7 @@ html, body { } #phone { - background-image: url(../img/phone.png); + background-image: url("../img/phone.png"); background-repeat: no-repeat; font-family: 'Catamaran', sans-serif; font-weight: 400; @@ -243,7 +243,7 @@ html, body { text-align: center; } -.message .sender-info, .message .body, .contact .sender-info, { +.message .sender-info, .message .body, .contact .sender-info { margin-right: 30px; } @@ -285,7 +285,7 @@ html, body { display: none; width: 24px; height: 24px; - background: transparent url(../img/icons/location.png) no-repeat 50%; + background: transparent url("../img/icons/location.png") no-repeat 50%; cursor: pointer; } @@ -293,7 +293,7 @@ html, body { display: none; width: 24px; height: 24px; - background: transparent url(../img/icons/ok.png) no-repeat 50%; + background: transparent url("../img/icons/ok.png") no-repeat 50%; cursor: pointer; } diff --git a/locales/br.lua b/locales/br.lua index 3275b1fc..1b1b3ac4 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -1,13 +1,13 @@ Locales['br'] = { - ['new_message'] = '~b~Nova mensagem :~s~ %s', - ['press_take_call'] = '%s - Pressione ~INPUT_CONTEXT~ para aceitar a chamada', - ['taken_call'] = '~y~%s~s~ recebeu uma chamada', - ['gps_position'] = 'destino inserido no GPS', - ['message_sent'] = 'mensagem enviada', - ['cannot_add_self'] = 'você não pode se adicionar', - ['number_in_contacts'] = 'este número já está na sua lista de contatos', - ['contact_added'] = 'contato adicionado', - ['contact_removed'] = 'the contact has been removed!', - ['number_not_assigned'] = 'este número não foi atribuído...', - ['invalid_number'] = 'that\'s not an valid number!', + ['new_message'] = '~b~Nova mensagem :~s~ %s', + ['press_take_call'] = '%s - Pressione ~INPUT_CONTEXT~ para aceitar a chamada', + ['taken_call'] = '~y~%s~s~ recebeu uma chamada', + ['gps_position'] = 'destino inserido no GPS', + ['message_sent'] = 'mensagem enviada', + ['cannot_add_self'] = 'você não pode se adicionar', + ['number_in_contacts'] = 'este número já está na sua lista de contatos', + ['contact_added'] = 'contato adicionado', + ['contact_removed'] = 'the contact has been removed!', + ['number_not_assigned'] = 'este número não foi atribuído...', + ['invalid_number'] = 'that\'s not an valid number!', } diff --git a/locales/de.lua b/locales/de.lua index bea36169..7333c33b 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -1,13 +1,13 @@ Locales['de'] = { - ['new_message'] = '~b~Neue Nachricht', - ['press_take_call'] = '%s - Drücke ~INPUT_CONTEXT~ um den Anruf anzunehmen', - ['taken_call'] = '~y~%s~s~ hat den Anruf angenommen', - ['gps_position'] = 'ziel in GPS eingegeben', - ['message_sent'] = 'nachricht gesendet', - ['cannot_add_self'] = 'du kannst dich nicht selbst hinzufügen', - ['number_in_contacts'] = 'diese Nummer ist bereits in deinen Kontakten', - ['contact_added'] = 'kontakt hinzugefügt', - ['contact_removed'] = 'the contact has been removed!', - ['number_not_assigned'] = 'diese Nummer ist nicht vergeben...', - ['invalid_number'] = 'that\'s not an valid number!', + ['new_message'] = '~b~Neue Nachricht', + ['press_take_call'] = '%s - Drücke ~INPUT_CONTEXT~ um den Anruf anzunehmen', + ['taken_call'] = '~y~%s~s~ hat den Anruf angenommen', + ['gps_position'] = 'ziel in GPS eingegeben', + ['message_sent'] = 'nachricht gesendet', + ['cannot_add_self'] = 'du kannst dich nicht selbst hinzufügen', + ['number_in_contacts'] = 'diese Nummer ist bereits in deinen Kontakten', + ['contact_added'] = 'kontakt hinzugefügt', + ['contact_removed'] = 'the contact has been removed!', + ['number_not_assigned'] = 'diese Nummer ist nicht vergeben...', + ['invalid_number'] = 'that\'s not an valid number!', } diff --git a/locales/en.lua b/locales/en.lua index 9fea81d3..f7c4babe 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -1,13 +1,13 @@ Locales['en'] = { - ['new_message'] = '~b~You have recived a message:~s~ %s', - ['press_take_call'] = '%s - Press ~INPUT_CONTEXT~ to take the call', - ['taken_call'] = '~y~%s~s~ has taken the call', - ['gps_position'] = 'the destination has been added to your GPS', - ['message_sent'] = 'the message has been sent', - ['cannot_add_self'] = 'you can not add yourself!', - ['number_in_contacts'] = 'this number is already in your contact list', - ['contact_added'] = 'the contact has been added!', - ['contact_removed'] = 'the contact has been removed!', - ['number_not_assigned'] = 'the number has not been assigned!', - ['invalid_number'] = 'that\'s not an valid number!', -} \ No newline at end of file + ['new_message'] = '~b~You have recived a message:~s~ %s', + ['press_take_call'] = '%s - Press ~INPUT_CONTEXT~ to take the call', + ['taken_call'] = '~y~%s~s~ has taken the call', + ['gps_position'] = 'the destination has been added to your GPS', + ['message_sent'] = 'the message has been sent', + ['cannot_add_self'] = 'you can not add yourself!', + ['number_in_contacts'] = 'this number is already in your contact list', + ['contact_added'] = 'the contact has been added!', + ['contact_removed'] = 'the contact has been removed!', + ['number_not_assigned'] = 'the number has not been assigned!', + ['invalid_number'] = 'that\'s not an valid number!', +} diff --git a/locales/es.lua b/locales/es.lua index 97ca7ad7..52882d8b 100644 --- a/locales/es.lua +++ b/locales/es.lua @@ -1,13 +1,13 @@ Locales['es'] = { - ['new_message'] = '~b~Nuevo menaje :~s~ %s', - ['press_take_call'] = '%s - Presionar ~INPUT_CONTEXT~ para coger la llamada', - ['taken_call'] = '~y~%s~s~ has contestado la llamada', - ['gps_position'] = 'posición GPS', - ['message_sent'] = 'mensaje enviado', - ['cannot_add_self'] = 'no has podido agregar', - ['number_in_contacts'] = 'este número ya está en tu lista de contactos', - ['contact_added'] = 'contacto añadido', - ['contact_removed'] = 'the contact has been removed!', - ['number_not_assigned'] = 'el número no se ha añadido todavía...', - ['invalid_number'] = 'that\'s not an valid number!', + ['new_message'] = '~b~Nuevo menaje :~s~ %s', + ['press_take_call'] = '%s - Presionar ~INPUT_CONTEXT~ para coger la llamada', + ['taken_call'] = '~y~%s~s~ has contestado la llamada', + ['gps_position'] = 'posición GPS', + ['message_sent'] = 'mensaje enviado', + ['cannot_add_self'] = 'no has podido agregar', + ['number_in_contacts'] = 'este número ya está en tu lista de contactos', + ['contact_added'] = 'contacto añadido', + ['contact_removed'] = 'the contact has been removed!', + ['number_not_assigned'] = 'el número no se ha añadido todavía...', + ['invalid_number'] = 'that\'s not an valid number!', } diff --git a/locales/fr.lua b/locales/fr.lua index aa2f88d2..9b47eb4d 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -1,13 +1,13 @@ Locales['fr'] = { - ['new_message'] = '~b~Nouveau message :~s~ %s', - ['press_take_call'] = '%s - Appuyez sur ~INPUT_CONTEXT~ pour prendre l\'appel', - ['taken_call'] = '~y~%s~s~ a pris l\'appel', - ['gps_position'] = 'position entrée dans le GPS', - ['message_sent'] = 'message envoyé', - ['cannot_add_self'] = 'vous ne pouvez pas vous ajouter vous-même', - ['number_in_contacts'] = 'ce numéro est déja dans votre liste de contacts', - ['contact_added'] = 'contact ajouté', - ['contact_removed'] = 'contact supprimé', - ['number_not_assigned'] = 'ce numéro n\'est pas attribué...', - ['invalid_number'] = 'that\'s not an valid number!', + ['new_message'] = '~b~Nouveau message :~s~ %s', + ['press_take_call'] = '%s - Appuyez sur ~INPUT_CONTEXT~ pour prendre l\'appel', + ['taken_call'] = '~y~%s~s~ a pris l\'appel', + ['gps_position'] = 'position entrée dans le GPS', + ['message_sent'] = 'message envoyé', + ['cannot_add_self'] = 'vous ne pouvez pas vous ajouter vous-même', + ['number_in_contacts'] = 'ce numéro est déja dans votre liste de contacts', + ['contact_added'] = 'contact ajouté', + ['contact_removed'] = 'contact supprimé', + ['number_not_assigned'] = 'ce numéro n\'est pas attribué...', + ['invalid_number'] = 'that\'s not an valid number!', } diff --git a/locales/pl.lua b/locales/pl.lua index b3218307..85b5eee5 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -1,13 +1,13 @@ Locales['pl'] = { - ['new_message'] = '~b~Masz nową wiadomość:~s~ %s', - ['press_take_call'] = '%s - wciśnij ~INPUT_CONTEXT~ aby odebrać telefon', - ['taken_call'] = '~y~%s~s~ odebrał telefon', - ['gps_position'] = 'cel podróży został dodany do GPS\'a', - ['message_sent'] = 'wiadomość wysłana', - ['cannot_add_self'] = 'nie możesz dodać samego siebie!', - ['number_in_contacts'] = 'ten numer jest już na twojej liście kontaktów', - ['contact_added'] = 'kontakt dodany!', - ['contact_removed'] = 'kontakt usunięty!', - ['number_not_assigned'] = 'numer nie jest przypisany!', - ['invalid_number'] = 'to nie jest prawidłowy numer telefonu!', + ['new_message'] = '~b~Masz nową wiadomość:~s~ %s', + ['press_take_call'] = '%s - wciśnij ~INPUT_CONTEXT~ aby odebrać telefon', + ['taken_call'] = '~y~%s~s~ odebrał telefon', + ['gps_position'] = 'cel podróży został dodany do GPS\'a', + ['message_sent'] = 'wiadomość wysłana', + ['cannot_add_self'] = 'nie możesz dodać samego siebie!', + ['number_in_contacts'] = 'ten numer jest już na twojej liście kontaktów', + ['contact_added'] = 'kontakt dodany!', + ['contact_removed'] = 'kontakt usunięty!', + ['number_not_assigned'] = 'numer nie jest przypisany!', + ['invalid_number'] = 'to nie jest prawidłowy numer telefonu!', } diff --git a/locales/sv.lua b/locales/sv.lua index 51e39990..334facfc 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -1,13 +1,13 @@ Locales['sv'] = { - ['new_message'] = '~b~Nytt meddelande:~s~ %s', - ['press_take_call'] = '%s - tryck ~INPUT_CONTEXT~ för att svara', - ['taken_call'] = '~y~%s~s~ har tagit emot ditt meddelande', - ['gps_position'] = 'destinationen är markerad på din GPS!', - ['message_sent'] = 'meddelandet har skickats!', - ['cannot_add_self'] = 'du kan inte lägga till dig själv!', - ['number_in_contacts'] = 'det här nummret finns redan bland dina kontakter!', - ['contact_added'] = 'kontakten har lags till!', - ['contact_removed'] = 'kontakten har tagits bort!', - ['number_not_assigned'] = 'det här nummret finns inte!', - ['invalid_number'] = 'det är inte ett giltigt nummer!', -} \ No newline at end of file + ['new_message'] = '~b~Nytt meddelande:~s~ %s', + ['press_take_call'] = '%s - tryck ~INPUT_CONTEXT~ för att svara', + ['taken_call'] = '~y~%s~s~ har tagit emot ditt meddelande', + ['gps_position'] = 'destinationen är markerad på din GPS!', + ['message_sent'] = 'meddelandet har skickats!', + ['cannot_add_self'] = 'du kan inte lägga till dig själv!', + ['number_in_contacts'] = 'det här nummret finns redan bland dina kontakter!', + ['contact_added'] = 'kontakten har lags till!', + ['contact_removed'] = 'kontakten har tagits bort!', + ['number_not_assigned'] = 'det här nummret finns inte!', + ['invalid_number'] = 'det är inte ett giltigt nummer!', +} diff --git a/server/main.lua b/server/main.lua index 13bcde33..f8c624cb 100644 --- a/server/main.lua +++ b/server/main.lua @@ -6,7 +6,7 @@ function LoadPlayer(source) local xPlayer = ESX.GetPlayerFromId(source) for num,v in pairs(PhoneNumbers) do - if tonumber(num) == num then -- If phonenumber is a player phone number + if tonumber(num) == num then -- if phonenumber is a player phone number for src,_ in pairs(v.sources) do TriggerClientEvent('esx_phone:setPhoneNumberSource', source, num, tonumber(src)) end