mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-01 10:48:52 +00:00
Security improvements
This commit is contained in:
+3
-3
@@ -23,10 +23,10 @@ Locales['br'] = {
|
||||
['start_job'] = 'start / stop driving NPC jobs',
|
||||
['drive_search_pass'] = 'Dirigindo em busca de ~y~passageiros',
|
||||
['customer_found'] = 'Você ~g~encontrou~s~ um passageiro, dirija até o destino',
|
||||
['client_unconcious'] = 'Seu passageiro está ~r~insconsciente~w~. Procure por outro.',
|
||||
['client_unconcious'] = 'Seu passageiro está ~r~insconsciente~s~. Procure por outro.',
|
||||
['arrive_dest'] = 'Você ~g~chegou~s~ ao seu destino',
|
||||
['take_me_to_near'] = '~w~Leve me para~y~ %s~w~, perto~y~ %s',
|
||||
['take_me_to'] = '~w~Leve me para~y~ %s',
|
||||
['take_me_to_near'] = '~s~Leve me para~y~ %s~s~, perto~y~ %s',
|
||||
['take_me_to'] = '~s~Leve me para~y~ %s',
|
||||
['close_to_client'] = 'Você está perto do passageiro, aproximisse dele',
|
||||
['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',
|
||||
|
||||
+3
-3
@@ -22,14 +22,14 @@ Locales['en'] = {
|
||||
['no_players_near'] = 'no players nearby',
|
||||
['start_job'] = 'start / stop driving NPC jobs',
|
||||
['drive_search_pass'] = 'driving in search of ~y~passengers',
|
||||
['customer_found'] = 'you have ~g~found~s~ a customer, drive until last',
|
||||
['client_unconcious'] = 'your client is ~r~unconscious~s~. Look for another one.',
|
||||
['customer_found'] = 'you have ~g~found~s~ a customer, get closer to them',
|
||||
['client_unconcious'] = 'your client is ~r~unconscious~s~, look for another one',
|
||||
['arrive_dest'] = 'you have ~g~arrived~s~ at your destination',
|
||||
['take_me_to_near'] = '~s~Take me to~y~ %s~s~, near ~y~%s',
|
||||
['take_me_to'] = '~s~Take me to ~y~%s',
|
||||
['close_to_client'] = 'you are too far from the client, get close to them',
|
||||
['return_to_veh'] = 'please return to your vehicle to continue the mission',
|
||||
['must_in_taxi'] = 'you must be in a taxi to start 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',
|
||||
['have_earned'] = 'you have earned ~g~$%s~s~',
|
||||
['comp_earned'] = '- your company has earned ~g~$%s~s~\n- you have earned ~g~$%s~s~',
|
||||
|
||||
+3
-3
@@ -23,10 +23,10 @@ Locales['fr'] = {
|
||||
['start_job'] = 'start / stop driving NPC jobs',
|
||||
['drive_search_pass'] = 'conduisez à la recherche de ~y~passagers',
|
||||
['customer_found'] = 'vous avez ~g~trouvé~s~ un client, conduisez jusqu\'à ce dernier',
|
||||
['client_unconcious'] = 'votre client est ~r~inconscient~w~. Cherchez-en un autre.',
|
||||
['client_unconcious'] = 'votre client est ~r~inconscient~s~. Cherchez-en un autre.',
|
||||
['arrive_dest'] = 'vous êtes ~g~arrivé~s~ à destination',
|
||||
['take_me_to_near'] = '~w~Emmenez-moi à~y~ %s~w~, près de~y~ %s',
|
||||
['take_me_to'] = '~w~Emmenez-moi à~y~ %s',
|
||||
['take_me_to_near'] = '~s~Emmenez-moi à~y~ %s~s~, près de~y~ %s',
|
||||
['take_me_to'] = '~s~Emmenez-moi à~y~ %s',
|
||||
['close_to_client'] = 'vous êtes à proximité du client, approchez-vous de lui',
|
||||
['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',
|
||||
|
||||
+22
-8
@@ -11,11 +11,17 @@ TriggerEvent('esx_society:registerSociety', 'taxi', 'Taxi', 'society_taxi', 'soc
|
||||
|
||||
RegisterServerEvent('esx_taxijob:success')
|
||||
AddEventHandler('esx_taxijob:success', function()
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
|
||||
if xPlayer.job.name ~= 'taxi' then
|
||||
print(('esx_taxijob: %s attempted to trigger success!'):format(xPlayer.identifier))
|
||||
return
|
||||
end
|
||||
|
||||
math.randomseed(os.time())
|
||||
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
local total = math.random(Config.NPCJobEarnings.min, Config.NPCJobEarnings.max)
|
||||
local societyAccount = nil
|
||||
local total = math.random(Config.NPCJobEarnings.min, Config.NPCJobEarnings.max)
|
||||
local societyAccount
|
||||
|
||||
if xPlayer.job.grade >= 3 then
|
||||
total = total * 2
|
||||
@@ -25,16 +31,14 @@ AddEventHandler('esx_taxijob:success', function()
|
||||
societyAccount = account
|
||||
end)
|
||||
|
||||
if societyAccount ~= nil then
|
||||
|
||||
local playerMoney = math.floor(total / 100 * 30)
|
||||
local societyMoney = math.floor(total / 100 * 70)
|
||||
if societyAccount then
|
||||
local playerMoney = ESX.Math.Round(total / 100 * 30)
|
||||
local societyMoney = ESX.Math.Round(total / 100 * 70)
|
||||
|
||||
xPlayer.addMoney(playerMoney)
|
||||
societyAccount.addMoney(societyMoney)
|
||||
|
||||
TriggerClientEvent('esx:showNotification', xPlayer.source, _U('comp_earned', societyMoney, playerMoney))
|
||||
|
||||
else
|
||||
xPlayer.addMoney(total)
|
||||
TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_earned', total))
|
||||
@@ -45,6 +49,11 @@ end)
|
||||
RegisterServerEvent('esx_taxijob:getStockItem')
|
||||
AddEventHandler('esx_taxijob:getStockItem', function(itemName, count)
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
|
||||
if xPlayer.job.name ~= 'taxi' then
|
||||
print(('esx_taxijob: %s attempted to trigger getStockItem!'):format(xPlayer.identifier))
|
||||
return
|
||||
end
|
||||
|
||||
TriggerEvent('esx_addoninventory:getSharedInventory', 'society_taxi', function(inventory)
|
||||
local item = inventory.getItem(itemName)
|
||||
@@ -77,6 +86,11 @@ RegisterServerEvent('esx_taxijob:putStockItems')
|
||||
AddEventHandler('esx_taxijob:putStockItems', function(itemName, count)
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
|
||||
if xPlayer.job.name ~= 'taxi' then
|
||||
print(('esx_taxijob: %s attempted to trigger putStockItems!'):format(xPlayer.identifier))
|
||||
return
|
||||
end
|
||||
|
||||
TriggerEvent('esx_addoninventory:getSharedInventory', 'society_taxi', function(inventory)
|
||||
local item = inventory.getItem(itemName)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user