From dda412968d43e9d892b5b487ef8574a7a462ce79 Mon Sep 17 00:00:00 2001 From: BrakingESX247 <67766145+BrakingESX247@users.noreply.github.com> Date: Wed, 22 Jul 2020 02:07:34 +0100 Subject: [PATCH] Adding a check If a player is using an authorized vehicles. Co-Authored-By: William Plunkett Jr --- client/main.lua | 13 +++++++++++++ locales/br.lua | 1 + locales/de.lua | 1 + locales/en.lua | 1 + locales/fi.lua | 1 + locales/fr.lua | 1 + locales/pl.lua | 1 + locales/sv.lua | 1 + 8 files changed, 20 insertions(+) diff --git a/client/main.lua b/client/main.lua index 48b398f6..6dce9572 100644 --- a/client/main.lua +++ b/client/main.lua @@ -713,6 +713,19 @@ Citizen.CreateThread(function() end end) +Citizen.CreateThread(function() + while onJob do + Citizen.Wait(10000) + if ESX.PlayerData.job ~= nil and ESX.PlayerData.job.grade < 3 then + if not IsInAuthorizedVehicle() then + ClearCurrentMission() + OnJob = false + ESX.ShowNotification(_U('not_in_taxi')) + end + end + end +end) + -- Key Controls Citizen.CreateThread(function() while true do diff --git a/locales/br.lua b/locales/br.lua index e47b6f2f..21e1b7a1 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -31,6 +31,7 @@ Locales['br'] = { ['return_to_veh'] = 'volte para o seu veículo para continuar a missão', ['must_in_taxi'] = 'você deve estar em um táxi para começar a missão', ['must_in_vehicle'] = 'você deve estar em um veículo para começar a missão', + ['not_in_taxi'] = 'You left the taxi while on mission!', ['have_earned'] = 'você ganhou ~g~$%s~s~', ['comp_earned'] = '- sua empresa ganhou ~g~$%s~s~\n- Você ganhou ~g~$%s~s~', ['deposit_stock'] = 'depositar estoque', diff --git a/locales/de.lua b/locales/de.lua index 8b728530..06a22aa3 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -31,6 +31,7 @@ Locales['de'] = { ['return_to_veh'] = 'bitte kehre zu deinem Fahezeug zurück umd die Mission fortzuführen', ['must_in_taxi'] = 'Du musst in einem Taxis sein umd die Mission starten zu können', ['must_in_vehicle'] = 'Du musst in einem Fahrzeug sein um die Mission starten zu können', + ['not_in_taxi'] = 'You left the taxi while on mission!', ['have_earned'] = 'verdient ~g~$%s~s~', ['comp_earned'] = '- Die Firma verdient ~g~$\n- Verdient ~g~$%s~s~', ['deposit_stock'] = 'deposit Stock', diff --git a/locales/en.lua b/locales/en.lua index a060aa8a..8e5d06c4 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -31,6 +31,7 @@ Locales['en'] = { ['return_to_veh'] = 'please return to your vehicle to continue the mission', ['must_in_taxi'] = 'you must be in a ~y~taxi~s~ to start the mission', ['must_in_vehicle'] = 'you must be in a vehicle to begin the mission', + ['not_in_taxi'] = 'You left the taxi while on mission!', ['have_earned'] = 'you have earned ~g~$%s~s~', ['comp_earned'] = '- your company has earned ~g~$%s~s~\n- you have earned ~g~$%s~s~', ['deposit_stock'] = 'deposit Stock', diff --git a/locales/fi.lua b/locales/fi.lua index 8e2a66e9..a1fb5d91 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -31,6 +31,7 @@ Locales['fi'] = { ['return_to_veh'] = 'Mene takaisin ajoneuvoon, jatkaaksesi töitä', ['must_in_taxi'] = 'Sinun pitää olla taxissa että voit alottaa työn', ['must_in_vehicle'] = 'Sinun pitää olla ajoneuvossa että voit alottaa työn', + ['not_in_taxi'] = 'You left the taxi while on mission!', ['have_earned'] = 'Sinä tienasit ~g~€%s~s~', ['comp_earned'] = '- Yrityksesi tienasi ~g~€%s~s~\n- Sinä tienasit ~g~€%s~s~', ['deposit_stock'] = 'Talleta varastoon', diff --git a/locales/fr.lua b/locales/fr.lua index ffd33099..56aae71b 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -31,6 +31,7 @@ Locales['fr'] = { ['return_to_veh'] = 'veuillez remonter dans votre véhicule pour continuer la mission', ['must_in_taxi'] = 'vous devez être dans un taxi pour commencer la mission', ['must_in_vehicle'] = 'vous devez être dans un véhicule pour commencer la mission', + ['not_in_taxi'] = 'You left the taxi while on mission!', ['have_earned'] = 'vous avez gagné ~g~$%s~s~', ['comp_earned'] = '- Votre société a gagné ~g~$%s~s~\n- Vous avez gagné ~g~$%s~s~', ['deposit_stock'] = 'Déposer Stock', diff --git a/locales/pl.lua b/locales/pl.lua index 5e79fdf1..47a8358a 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -31,6 +31,7 @@ Locales['pl'] = { ['return_to_veh'] = 'proszę wróć do swojego pojazdu aby kontynuować misję', ['must_in_taxi'] = 'musisz być w taksówce aby rozpocząć misję', ['must_in_vehicle'] = 'musisz być w pojeździe aby rozpocząć misję', + ['not_in_taxi'] = 'You left the taxi while on mission!', ['have_earned'] = 'zarabiasz ~g~$%s~s~', ['comp_earned'] = '- Twoja firma zarobiła ~g~$%s~s~\n- Zarabiasz ~g~$%s~s~', ['deposit_stock'] = 'depozyt', diff --git a/locales/sv.lua b/locales/sv.lua index c6ea355f..c703a57c 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -31,6 +31,7 @@ Locales['sv'] = { ['return_to_veh'] = 'vänligen återvänd till ditt fordon och återuppta körningen.', ['must_in_taxi'] = 'du måste vara i en ~y~taxi~s~ för att starta uppdraget.', ['must_in_vehicle'] = 'du måste vara i ett ~b~fordon~s~ för att starta uppdraget.', + ['not_in_taxi'] = 'You left the taxi while on mission!', ['have_earned'] = 'du har tjärnat ~g~%s SEK~s~', ['comp_earned'] = '- ditt företag har tjärnat ~g~%s SEK~s~\n- du har tjärnat ~g~%s SEK~s~', ['deposit_stock'] = 'lagra objekt',