Fixed #9, fixed dead opening f6 menu, fixed restarting script, fixed exploit taking more than you can carry

This commit is contained in:
ElPumpo
2018-04-30 23:41:27 +02:00
parent a336783cfc
commit 555f1c8fac
10 changed files with 191 additions and 289 deletions
+30 -18
View File
@@ -25,15 +25,19 @@ local IsNearCustomer = false
local CustomerIsEnteringVehicle = false local CustomerIsEnteringVehicle = false
local CustomerEnteredVehicle = false local CustomerEnteredVehicle = false
local TargetCoords = nil local TargetCoords = nil
local IsDead = false
ESX = nil ESX = nil
GUI.Time = 0 GUI.Time = 0
Citizen.CreateThread(function() Citizen.CreateThread(function()
while ESX == nil do while ESX == nil do
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
Citizen.Wait(0) Citizen.Wait(0)
end end
Citizen.Wait(5000)
PlayerData = ESX.GetPlayerData()
end) end)
function DrawSub(msg, time) function DrawSub(msg, time)
@@ -69,8 +73,6 @@ function GetRandomWalkingNPC()
return search[GetRandomIntInRange(1, #search)] return search[GetRandomIntInRange(1, #search)]
end end
print('Using fallback code to find walking ped')
for i=1, 250, 1 do for i=1, 250, 1 do
local ped = GetRandomPedAtCoord(0.0, 0.0, 0.0, math.huge + 0.0, math.huge + 0.0, math.huge + 0.0, 26) local ped = GetRandomPedAtCoord(0.0, 0.0, 0.0, math.huge + 0.0, math.huge + 0.0, math.huge + 0.0, 26)
@@ -156,6 +158,7 @@ function OpenTaxiActionsMenu()
'default', GetCurrentResourceName(), 'taxi_actions', 'default', GetCurrentResourceName(), 'taxi_actions',
{ {
title = 'Taxi', title = 'Taxi',
align = 'top-left',
elements = elements elements = elements
}, },
function(data, menu) function(data, menu)
@@ -185,7 +188,7 @@ function OpenTaxiActionsMenu()
{ {
title = _U('spawn_veh'), title = _U('spawn_veh'),
align = 'top-left', align = 'top-left',
elements = elements, elements = elements
}, },
function(data, menu) function(data, menu)
@@ -277,6 +280,7 @@ function OpenMobileTaxiActionsMenu()
'default', GetCurrentResourceName(), 'mobile_taxi_actions', 'default', GetCurrentResourceName(), 'mobile_taxi_actions',
{ {
title = 'Taxi', title = 'Taxi',
align = 'top-left',
elements = { elements = {
{label = _U('billing'), value = 'billing'} {label = _U('billing'), value = 'billing'}
} }
@@ -329,9 +333,6 @@ end
function OpenGetStocksMenu() function OpenGetStocksMenu()
ESX.TriggerServerCallback('esx_taxijob:getStockItems', function(items) ESX.TriggerServerCallback('esx_taxijob:getStockItems', function(items)
print(json.encode(items))
local elements = {} local elements = {}
for i=1, #items, 1 do for i=1, #items, 1 do
@@ -342,6 +343,7 @@ function OpenGetStocksMenu()
'default', GetCurrentResourceName(), 'stocks_menu', 'default', GetCurrentResourceName(), 'stocks_menu',
{ {
title = 'Taxi Stock', title = 'Taxi Stock',
align = 'top-left',
elements = elements elements = elements
}, },
function(data, menu) function(data, menu)
@@ -362,9 +364,10 @@ function OpenGetStocksMenu()
else else
menu2.close() menu2.close()
menu.close() menu.close()
OpenGetStocksMenu()
TriggerServerEvent('esx_taxijob:getStockItem', itemName, count) TriggerServerEvent('esx_taxijob:getStockItem', itemName, count)
Citizen.Wait(1000)
OpenGetStocksMenu()
end end
end, end,
@@ -403,6 +406,7 @@ function OpenPutStocksMenu()
'default', GetCurrentResourceName(), 'stocks_menu', 'default', GetCurrentResourceName(), 'stocks_menu',
{ {
title = _U('inventory'), title = _U('inventory'),
align = 'top-left',
elements = elements elements = elements
}, },
function(data, menu) function(data, menu)
@@ -423,9 +427,10 @@ function OpenPutStocksMenu()
else else
menu2.close() menu2.close()
menu.close() menu.close()
OpenPutStocksMenu()
TriggerServerEvent('esx_taxijob:putStockItems', itemName, count) TriggerServerEvent('esx_taxijob:putStockItems', itemName, count)
Citizen.Wait(1000)
OpenPutStocksMenu()
end end
end, end,
@@ -444,7 +449,6 @@ function OpenPutStocksMenu()
end end
RegisterNetEvent('esx:playerLoaded') RegisterNetEvent('esx:playerLoaded')
AddEventHandler('esx:playerLoaded', function(xPlayer) AddEventHandler('esx:playerLoaded', function(xPlayer)
PlayerData = xPlayer PlayerData = xPlayer
@@ -793,7 +797,7 @@ Citizen.CreateThread(function()
AddTextComponentString(CurrentActionMsg) AddTextComponentString(CurrentActionMsg)
DisplayHelpTextFromStringLabel(0, 0, 1, -1) DisplayHelpTextFromStringLabel(0, 0, 1, -1)
if IsControlPressed(0, Keys['E']) and PlayerData.job ~= nil and PlayerData.job.name == 'taxi' and (GetGameTimer() - GUI.Time) > 300 then if IsControlPressed(0, Keys['E']) and PlayerData.job ~= nil and PlayerData.job.name == 'taxi' and (GetGameTimer() - GUI.Time) > 300 then
if CurrentAction == 'taxi_actions_menu' then if CurrentAction == 'taxi_actions_menu' then
OpenTaxiActionsMenu() OpenTaxiActionsMenu()
@@ -825,12 +829,12 @@ Citizen.CreateThread(function()
end end
if IsControlPressed(0, Keys['F6']) and Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.name == 'taxi' and (GetGameTimer() - GUI.Time) > 150 then if IsControlPressed(0, Keys['F6']) and not IsDead and Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.name == 'taxi' and (GetGameTimer() - GUI.Time) > 150 then
OpenMobileTaxiActionsMenu() OpenMobileTaxiActionsMenu()
GUI.Time = GetGameTimer() GUI.Time = GetGameTimer()
end end
if IsControlPressed(0, Keys['DELETE']) and (GetGameTimer() - GUI.Time) > 150 then if IsControlPressed(0, Keys['DELETE']) and not IsDead and (GetGameTimer() - GUI.Time) > 150 then
if OnJob then if OnJob then
StopTaxiJob() StopTaxiJob()
@@ -874,3 +878,11 @@ Citizen.CreateThread(function()
end end
end) end)
AddEventHandler('esx:onPlayerDeath', function()
IsDead = true
end)
AddEventHandler('playerSpawned', function(spawn)
IsDead = false
end)
+112 -112
View File
@@ -1,126 +1,126 @@
Config = {} Config = {}
Config.DrawDistance = 100.0 Config.DrawDistance = 100.0
Config.NPCJobEarnings = {min = 15, max = 40} Config.NPCJobEarnings = {min = 15, max = 40}
Config.MaxInService = 2 Config.MaxInService = -1
Config.EnablePlayerManagement = false Config.EnablePlayerManagement = false
Config.EnableSocietyOwnedVehicles = true Config.EnableSocietyOwnedVehicles = false
Config.Locale = 'fr' Config.Locale = 'en'
Config.Zones = { Config.Zones = {
TaxiActions = { TaxiActions = {
Pos = {x = 915.039, y = -162.187, z = 73.684}, Pos = {x = 915.039, y = -162.187, z = 73.684},
Size = {x = 1.5, y = 1.5, z = 1.0}, Size = {x = 1.5, y = 1.5, z = 1.0},
Color = {r = 204, g = 204, b = 0}, Color = {r = 204, g = 204, b = 0},
Type = 1 Type = 1
}, },
VehicleSpawnPoint = { VehicleSpawnPoint = {
Pos = {x = 911.108, y = -177.867, z = 74.283}, Pos = {x = 911.108, y = -177.867, z = 74.283},
Size = {x = 1.5, y = 1.5, z = 1.0}, Size = {x = 1.5, y = 1.5, z = 1.0},
Type = -1 Type = -1
}, },
VehicleDeleter = { VehicleDeleter = {
Pos = {x = 908.317, y = -183.070, z = 73.201}, Pos = {x = 908.317, y = -183.070, z = 73.201},
Size = {x = 3.0, y = 3.0, z = 1.0}, Size = {x = 3.0, y = 3.0, z = 1.0},
Color = {r = 204, g = 204, b = 0}, Color = {r = 204, g = 204, b = 0},
Type = 1 Type = 1
} }
} }
Config.JobLocations = { Config.JobLocations = {
{x = 293.476, y = -590.163, z = 42.7371}, {x = 293.476, y = -590.163, z = 42.7371},
{x = 253.404, y = -375.86, z = 44.0819}, {x = 253.404, y = -375.86, z = 44.0819},
{x = 120.808, y = -300.416, z = 45.1399}, {x = 120.808, y = -300.416, z = 45.1399},
{x = -38.4132, y = -381.576, z = 38.3456}, {x = -38.4132, y = -381.576, z = 38.3456},
{x = -107.442, y = -614.377, z = 35.6703}, {x = -107.442, y = -614.377, z = 35.6703},
{x = -252.292, y = -856.474, z = 30.5626}, {x = -252.292, y = -856.474, z = 30.5626},
{x = -236.138, y = -988.382, z = 28.7749}, {x = -236.138, y = -988.382, z = 28.7749},
{x = -276.989, y = -1061.18, z = 25.6853}, {x = -276.989, y = -1061.18, z = 25.6853},
{x = -576.451, y = -998.989, z = 21.785}, {x = -576.451, y = -998.989, z = 21.785},
{x = -602.798, y = -952.63, z = 21.6353}, {x = -602.798, y = -952.63, z = 21.6353},
{x = -790.653, y = -961.855, z = 14.8932}, {x = -790.653, y = -961.855, z = 14.8932},
{x = -912.588, y = -864.756, z = 15.0057}, {x = -912.588, y = -864.756, z = 15.0057},
{x = -1069.77, y = -792.513, z = 18.8075}, {x = -1069.77, y = -792.513, z = 18.8075},
{x = -1306.94, y = -854.085, z = 15.0959}, {x = -1306.94, y = -854.085, z = 15.0959},
{x = -1468.51, y = -681.363, z = 26.178}, {x = -1468.51, y = -681.363, z = 26.178},
{x = -1380.89, y = -452.7, z = 34.0843}, {x = -1380.89, y = -452.7, z = 34.0843},
{x = -1326.35, y = -394.81, z = 36.0632}, {x = -1326.35, y = -394.81, z = 36.0632},
{x = -1383.68, y = -269.985, z = 42.4878}, {x = -1383.68, y = -269.985, z = 42.4878},
{x = -1679.61, y = -457.339, z = 39.4048}, {x = -1679.61, y = -457.339, z = 39.4048},
{x = -1812.45, y = -416.917, z = 43.6734}, {x = -1812.45, y = -416.917, z = 43.6734},
{x = -2043.64, y = -268.291, z = 22.9927}, {x = -2043.64, y = -268.291, z = 22.9927},
{x = -2186.45, y = -421.595, z = 12.6776}, {x = -2186.45, y = -421.595, z = 12.6776},
{x = -1862.08, y = -586.528, z = 11.1747}, {x = -1862.08, y = -586.528, z = 11.1747},
{x = -1859.5, y = -617.563, z = 10.8788}, {x = -1859.5, y = -617.563, z = 10.8788},
{x = -1634.95, y = -988.302, z = 12.6241}, {x = -1634.95, y = -988.302, z = 12.6241},
{x = -1283.99, y = -1154.16, z = 5.30998}, {x = -1283.99, y = -1154.16, z = 5.30998},
{x = -1126.47, y = -1338.08, z = 4.63434}, {x = -1126.47, y = -1338.08, z = 4.63434},
{x = -867.907, y = -1159.67, z = 5.00795}, {x = -867.907, y = -1159.67, z = 5.00795},
{x = -847.55, y = -1141.38, z = 6.27591}, {x = -847.55, y = -1141.38, z = 6.27591},
{x = -722.625, y = -1144.6, z = 10.2176}, {x = -722.625, y = -1144.6, z = 10.2176},
{x = -575.503, y = -318.446, z = 34.5273}, {x = -575.503, y = -318.446, z = 34.5273},
{x = -592.309, y = -224.853, z = 36.1209}, {x = -592.309, y = -224.853, z = 36.1209},
{x = -559.594, y = -162.873, z = 37.7547}, {x = -559.594, y = -162.873, z = 37.7547},
{x = -534.992, y = -65.6695, z = 40.634}, {x = -534.992, y = -65.6695, z = 40.634},
{x = -758.234, y = -36.6906, z = 37.2911}, {x = -758.234, y = -36.6906, z = 37.2911},
{x = -1375.88, y = 20.9516, z = 53.2255}, {x = -1375.88, y = 20.9516, z = 53.2255},
{x = -1320.25, y = -128.018, z = 48.097}, {x = -1320.25, y = -128.018, z = 48.097},
{x = -1285.71, y = 294.287, z = 64.4619}, {x = -1285.71, y = 294.287, z = 64.4619},
{x = -1245.67, y = 386.533, z = 75.0908}, {x = -1245.67, y = 386.533, z = 75.0908},
{x = -760.355, y = 285.015, z = 85.0667}, {x = -760.355, y = 285.015, z = 85.0667},
{x = -626.786, y = 254.146, z = 81.0964}, {x = -626.786, y = 254.146, z = 81.0964},
{x = -563.609, y = 267.962, z = 82.5116}, {x = -563.609, y = 267.962, z = 82.5116},
{x = -486.806, y = 271.977, z = 82.8187}, {x = -486.806, y = 271.977, z = 82.8187},
{x = 88.295, y = 250.867, z = 108.188}, {x = 88.295, y = 250.867, z = 108.188},
{x = 234.087, y = 344.678, z = 105.018}, {x = 234.087, y = 344.678, z = 105.018},
{x = 434.963, y = 96.707, z = 99.1713}, {x = 434.963, y = 96.707, z = 99.1713},
{x = 482.617, y = -142.533, z = 58.1936}, {x = 482.617, y = -142.533, z = 58.1936},
{x = 762.651, y = -786.55, z = 25.8915}, {x = 762.651, y = -786.55, z = 25.8915},
{x = 809.06, y = -1290.8, z = 25.7946}, {x = 809.06, y = -1290.8, z = 25.7946},
{x = 490.819, y = -1751.37, z = 28.0987}, {x = 490.819, y = -1751.37, z = 28.0987},
{x = 432.351, y = -1856.11, z = 27.0352}, {x = 432.351, y = -1856.11, z = 27.0352},
{x = 164.348, y = -1734.54, z = 28.8982}, {x = 164.348, y = -1734.54, z = 28.8982},
{x = -57.6909, y = -1501.4, z = 31.1084}, {x = -57.6909, y = -1501.4, z = 31.1084},
{x = 52.2241, y = -1566.65, z = 29.006}, {x = 52.2241, y = -1566.65, z = 29.006},
{x = 310.222, y = -1376.76, z = 31.4442}, {x = 310.222, y = -1376.76, z = 31.4442},
{x = 181.967, y = -1332.79, z = 28.8773}, {x = 181.967, y = -1332.79, z = 28.8773},
{x = -74.6091, y = -1100.64, z = 25.738}, {x = -74.6091, y = -1100.64, z = 25.738},
{x = -887.045, y = -2187.46, z = 8.13248}, {x = -887.045, y = -2187.46, z = 8.13248},
{x = -749.584, y = -2296.59, z = 12.4627}, {x = -749.584, y = -2296.59, z = 12.4627},
{x = -1064.83, y = -2560.66, z = 19.6811}, {x = -1064.83, y = -2560.66, z = 19.6811},
{x = -1033.44, y = -2730.24, z = 19.6868}, {x = -1033.44, y = -2730.24, z = 19.6868},
{x = -1018.67, y = -2732, z = 13.2687}, {x = -1018.67, y = -2732, z = 13.2687},
{x = 797.354, y = -174.423, z = 72.708}, {x = 797.354, y = -174.423, z = 72.708},
{x = 508.156, y = -117.908, z = 60.78}, {x = 508.156, y = -117.908, z = 60.78},
{x = 159.458, y = -27.555, z = 67.38}, {x = 159.458, y = -27.555, z = 67.38},
{x = -36.382, y = -106.912, z = 56.982}, {x = -36.382, y = -106.912, z = 56.982},
{x = -355.801, y = -270.404, z = 33.011}, {x = -355.801, y = -270.404, z = 33.011},
{x = -831.196, y = -76.871, z = 37.323}, {x = -831.196, y = -76.871, z = 37.323},
{x = -1038.707, y = -214.593, z = 37}, {x = -1038.707, y = -214.593, z = 37},
{x = 1918.448, y = 3691.41, z = 32.261}, {x = 1918.448, y = 3691.41, z = 32.261},
{x = 1820.217, y = 3697.115, z = 33.493}, {x = 1820.217, y = 3697.115, z = 33.493},
{x = 1619.323, y = 3827.162, z = 34.482}, {x = 1619.323, y = 3827.162, z = 34.482},
{x = 1418.628, y = 3602.243, z = 34.511}, {x = 1418.628, y = 3602.243, z = 34.511},
{x = 1944.858, y = 3856.252, z = 31.741}, {x = 1944.858, y = 3856.252, z = 31.741},
{x = 2285.278, y = 3839.444, z = 34.023}, {x = 2285.278, y = 3839.444, z = 34.023},
{x = 2760.945, y = 3387.813, z = 55.659}, {x = 2760.945, y = 3387.813, z = 55.659},
{x = 1952.819, y = 2627.731, z = 45.368}, {x = 1952.819, y = 2627.731, z = 45.368},
{x = 1051.414, y = 474.833, z = 93.653}, {x = 1051.414, y = 474.833, z = 93.653},
{x = 866.393, y = 17.635, z = 78.654}, {x = 866.393, y = 17.635, z = 78.654},
{x = 318.985, y = 167.41, z = 103.335}, {x = 318.985, y = 167.41, z = 103.335},
{x = 88.836, y = 254.054, z = 108.236}, {x = 88.836, y = 254.054, z = 108.236},
{x = -44.852, y = 70.414, z = 72.437}, {x = -44.852, y = 70.414, z = 72.437},
{x = -115.496, y = 84.333, z = 70.792}, {x = -115.496, y = 84.333, z = 70.792},
{x = -384.806, y = 226.868, z = 83.548}, {x = -384.806, y = 226.868, z = 83.548},
{x = -578.669, y = 139.085, z = 61.337}, {x = -578.669, y = 139.085, z = 61.337},
{x = -651.334, y = -584.879, z = 34.116}, {x = -651.334, y = -584.879, z = 34.116},
{x = -571.847, y = -1195.648, z = 17.869}, {x = -571.847, y = -1195.648, z = 17.869},
{x = -1513.271, y = -670.039, z = 28.362}, {x = -1513.271, y = -670.039, z = 28.362},
{x = -1297.484, y = -654.913, z = 26.123}, {x = -1297.484, y = -654.913, z = 26.123},
{x = -1645.546, y = 144.571, z = 61.664}, {x = -1645.546, y = 144.571, z = 61.664},
{x = -1160.618, y = 744.418, z = 154.571}, {x = -1160.618, y = 744.418, z = 154.571},
{x = -798.09, y = 831.699, z = 204.351}, {x = -798.09, y = 831.699, z = 204.351},
} }
+12 -8
View File
@@ -1,21 +1,25 @@
USE `essentialmode`; USE `essentialmode`;
INSERT INTO `addon_account` (name, label, shared) VALUES INSERT INTO `addon_account` (name, label, shared) VALUES
('society_taxi','Taxi',1) ('society_taxi', 'Taxi', 1)
;
INSERT INTO `datastore` (name, label, shared) VALUES
('society_taxi', 'Taxi', 1)
; ;
INSERT INTO `addon_inventory` (name, label, shared) VALUES INSERT INTO `addon_inventory` (name, label, shared) VALUES
('society_taxi','Taxi',1) ('society_taxi', 'Taxi', 1)
; ;
INSERT INTO `jobs` (name, label) VALUES INSERT INTO `jobs` (name, label) VALUES
('taxi','Taxi') ('taxi', 'Taxi')
; ;
INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES
('taxi',0,'recrue','Recrue',12,'{}','{}'), ('taxi',0,'recrue','Recrue',12,'{}','{}'),
('taxi',1,'novice','Novice',24,'{}','{}'), ('taxi',1,'novice','Novice',24,'{}','{}'),
('taxi',2,'experimente','Experimente',36,'{}','{}'), ('taxi',2,'experimente','Experimente',36,'{}','{}'),
('taxi',3,'uber','Uber',48,'{}','{}'), ('taxi',3,'uber','Uber',48,'{}','{}'),
('taxi',4,'boss','Patron',0,'{}','{}') ('taxi',4,'boss','Patron',0,'{}','{}')
; ;
+1
View File
@@ -27,4 +27,5 @@ Locales['br'] = {
['must_in_vehicle'] = 'Você deve estar em um veículo para começar a missão', ['must_in_vehicle'] = 'Você deve estar em um veículo para começar a missão',
['have_earned'] = 'Você ganhou ~g~$', ['have_earned'] = 'Você ganhou ~g~$',
['comp_earned'] = 'Sua empresa ganhou ~g~$', ['comp_earned'] = 'Sua empresa ganhou ~g~$',
['player_cannot_hold'] = 'you do ~r~not~w~ have enough ~y~free space~w~ in your inventory!',
} }
+1
View File
@@ -27,4 +27,5 @@ Locales['de'] = {
['must_in_vehicle'] = 'Du musst in einem Fahrzeug sein um die Mission starten zu können', ['must_in_vehicle'] = 'Du musst in einem Fahrzeug sein um die Mission starten zu können',
['have_earned'] = 'verdient ~g~$', ['have_earned'] = 'verdient ~g~$',
['comp_earned'] = 'Die Firma verdient ~g~$', ['comp_earned'] = 'Die Firma verdient ~g~$',
['player_cannot_hold'] = 'you do ~r~not~w~ have enough ~y~free space~w~ in your inventory!',
} }
+1
View File
@@ -37,4 +37,5 @@ Locales['en'] = {
['taxi_client'] = 'taxi Client', ['taxi_client'] = 'taxi Client',
['have_withdrawn'] = 'you have withdrawn x', ['have_withdrawn'] = 'you have withdrawn x',
['added'] = 'you added x', ['added'] = 'you added x',
['player_cannot_hold'] = 'you do ~r~not~w~ have enough ~y~free space~w~ in your inventory!',
} }
+1
View File
@@ -37,4 +37,5 @@ Locales['fr'] = {
['taxi_client'] = 'client Taxi', ['taxi_client'] = 'client Taxi',
['have_withdrawn'] = 'Vous avez retiré x', ['have_withdrawn'] = 'Vous avez retiré x',
['added'] = 'Vous avez ajouté x', ['added'] = 'Vous avez ajouté x',
['player_cannot_hold'] = 'you do ~r~not~w~ have enough ~y~free space~w~ in your inventory!',
} }
-125
View File
@@ -1,125 +0,0 @@
Config = {}
Config.DrawDistance = 100.0
Config.NPCJobEarnings = {min = 15, max = 40}
Config.MaxInService = 2
Config.EnablePlayerManagement = false
Config.Locale = 'de'
Config.Zones = {
TaxiActions = {
Pos = {x = 915.039, y = -162.187, z = 73.684},
Size = {x = 1.5, y = 1.5, z = 1.0},
Color = {r = 204, g = 204, b = 0},
Type = 1
},
VehicleSpawnPoint = {
Pos = {x = 911.108, y = -177.867, z = 74.283},
Size = {x = 1.5, y = 1.5, z = 1.0},
Type = -1
},
VehicleDeleter = {
Pos = {x = 908.317, y = -183.070, z = 73.201},
Size = {x = 3.0, y = 3.0, z = 1.0},
Color = {r = 204, g = 204, b = 0},
Type = 1
}
}
Config.JobLocations = {
{x = 293.476, y = -590.163, z = 42.7371},
{x = 253.404, y = -375.86, z = 44.0819},
{x = 120.808, y = -300.416, z = 45.1399},
{x = -38.4132, y = -381.576, z = 38.3456},
{x = -107.442, y = -614.377, z = 35.6703},
{x = -252.292, y = -856.474, z = 30.5626},
{x = -236.138, y = -988.382, z = 28.7749},
{x = -276.989, y = -1061.18, z = 25.6853},
{x = -576.451, y = -998.989, z = 21.785},
{x = -602.798, y = -952.63, z = 21.6353},
{x = -790.653, y = -961.855, z = 14.8932},
{x = -912.588, y = -864.756, z = 15.0057},
{x = -1069.77, y = -792.513, z = 18.8075},
{x = -1306.94, y = -854.085, z = 15.0959},
{x = -1468.51, y = -681.363, z = 26.178},
{x = -1380.89, y = -452.7, z = 34.0843},
{x = -1326.35, y = -394.81, z = 36.0632},
{x = -1383.68, y = -269.985, z = 42.4878},
{x = -1679.61, y = -457.339, z = 39.4048},
{x = -1812.45, y = -416.917, z = 43.6734},
{x = -2043.64, y = -268.291, z = 22.9927},
{x = -2186.45, y = -421.595, z = 12.6776},
{x = -1862.08, y = -586.528, z = 11.1747},
{x = -1859.5, y = -617.563, z = 10.8788},
{x = -1634.95, y = -988.302, z = 12.6241},
{x = -1283.99, y = -1154.16, z = 5.30998},
{x = -1126.47, y = -1338.08, z = 4.63434},
{x = -867.907, y = -1159.67, z = 5.00795},
{x = -847.55, y = -1141.38, z = 6.27591},
{x = -722.625, y = -1144.6, z = 10.2176},
{x = -575.503, y = -318.446, z = 34.5273},
{x = -592.309, y = -224.853, z = 36.1209},
{x = -559.594, y = -162.873, z = 37.7547},
{x = -534.992, y = -65.6695, z = 40.634},
{x = -758.234, y = -36.6906, z = 37.2911},
{x = -1375.88, y = 20.9516, z = 53.2255},
{x = -1320.25, y = -128.018, z = 48.097},
{x = -1285.71, y = 294.287, z = 64.4619},
{x = -1245.67, y = 386.533, z = 75.0908},
{x = -760.355, y = 285.015, z = 85.0667},
{x = -626.786, y = 254.146, z = 81.0964},
{x = -563.609, y = 267.962, z = 82.5116},
{x = -486.806, y = 271.977, z = 82.8187},
{x = 88.295, y = 250.867, z = 108.188},
{x = 234.087, y = 344.678, z = 105.018},
{x = 434.963, y = 96.707, z = 99.1713},
{x = 482.617, y = -142.533, z = 58.1936},
{x = 762.651, y = -786.55, z = 25.8915},
{x = 809.06, y = -1290.8, z = 25.7946},
{x = 490.819, y = -1751.37, z = 28.0987},
{x = 432.351, y = -1856.11, z = 27.0352},
{x = 164.348, y = -1734.54, z = 28.8982},
{x = -57.6909, y = -1501.4, z = 31.1084},
{x = 52.2241, y = -1566.65, z = 29.006},
{x = 310.222, y = -1376.76, z = 31.4442},
{x = 181.967, y = -1332.79, z = 28.8773},
{x = -74.6091, y = -1100.64, z = 25.738},
{x = -887.045, y = -2187.46, z = 8.13248},
{x = -749.584, y = -2296.59, z = 12.4627},
{x = -1064.83, y = -2560.66, z = 19.6811},
{x = -1033.44, y = -2730.24, z = 19.6868},
{x = -1018.67, y = -2732, z = 13.2687},
{x = 797.354, y = -174.423, z = 72.708},
{x = 508.156, y = -117.908, z = 60.78},
{x = 159.458, y = -27.555, z = 67.38},
{x = -36.382, y = -106.912, z = 56.982},
{x = -355.801, y = -270.404, z = 33.011},
{x = -831.196, y = -76.871, z = 37.323},
{x = -1038.707, y = -214.593, z = 37},
{x = 1918.448, y = 3691.41, z = 32.261},
{x = 1820.217, y = 3697.115, z = 33.493},
{x = 1619.323, y = 3827.162, z = 34.482},
{x = 1418.628, y = 3602.243, z = 34.511},
{x = 1944.858, y = 3856.252, z = 31.741},
{x = 2285.278, y = 3839.444, z = 34.023},
{x = 2760.945, y = 3387.813, z = 55.659},
{x = 1952.819, y = 2627.731, z = 45.368},
{x = 1051.414, y = 474.833, z = 93.653},
{x = 866.393, y = 17.635, z = 78.654},
{x = 318.985, y = 167.41, z = 103.335},
{x = 88.836, y = 254.054, z = 108.236},
{x = -44.852, y = 70.414, z = 72.437},
{x = -115.496, y = 84.333, z = 70.792},
{x = -384.806, y = 226.868, z = 83.548},
{x = -578.669, y = 139.085, z = 61.337},
{x = -651.334, y = -584.879, z = 34.116},
{x = -571.847, y = -1195.648, z = 17.869},
{x = -1513.271, y = -670.039, z = 28.362},
{x = -1297.484, y = -654.913, z = 26.123},
{x = -1645.546, y = 144.571, z = 61.664},
{x = -1160.618, y = 744.418, z = 154.571},
{x = -798.09, y = 831.699, z = 204.351},
}
+12 -8
View File
@@ -1,21 +1,25 @@
USE `essentialmode`; USE `essentialmode`;
INSERT INTO `addon_account` (name, label, shared) VALUES INSERT INTO `addon_account` (name, label, shared) VALUES
('society_taxi','Taxi',1) ('society_taxi', 'Taxi', 1)
;
INSERT INTO `datastore` (name, label, shared) VALUES
('society_taxi', 'Taxi', 1)
; ;
INSERT INTO `addon_inventory` (name, label, shared) VALUES INSERT INTO `addon_inventory` (name, label, shared) VALUES
('society_taxi','Taxi',1) ('society_taxi', 'Taxi', 1)
; ;
INSERT INTO `jobs` (name, label) VALUES INSERT INTO `jobs` (name, label) VALUES
('taxi','Taxi') ('taxi', 'Taxi')
; ;
INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES
('taxi',0,'recrue','Rekrut',12,'{}','{}'), ('taxi',0,'recrue','Rekrut',12,'{}','{}'),
('taxi',1,'novice','Anfänger',24,'{}','{}'), ('taxi',1,'novice','Anfänger',24,'{}','{}'),
('taxi',2,'experimente','Experte',36,'{}','{}'), ('taxi',2,'experimente','Experte',36,'{}','{}'),
('taxi',3,'uber','Schichtführer',48,'{}','{}'), ('taxi',3,'uber','Schichtführer',48,'{}','{}'),
('taxi',4,'boss','Chef',0,'{}','{}') ('taxi',4,'boss','Chef',0,'{}','{}')
; ;
+21 -18
View File
@@ -7,7 +7,7 @@ if Config.MaxInService ~= -1 then
end end
TriggerEvent('esx_phone:registerNumber', 'taxi', _U('taxi_client'), true, true) TriggerEvent('esx_phone:registerNumber', 'taxi', _U('taxi_client'), true, true)
TriggerEvent('esx_society:registerSociety', 'taxi', 'Taxi', 'society_taxi', 'society_taxi', 'society_taxi', {type = 'private'}) TriggerEvent('esx_society:registerSociety', 'taxi', 'Taxi', 'society_taxi', 'society_taxi', 'society_taxi', {type = 'public'})
RegisterServerEvent('esx_taxijob:success') RegisterServerEvent('esx_taxijob:success')
AddEventHandler('esx_taxijob:success', function() AddEventHandler('esx_taxijob:success', function()
@@ -48,24 +48,27 @@ end)
RegisterServerEvent('esx_taxijob:getStockItem') RegisterServerEvent('esx_taxijob:getStockItem')
AddEventHandler('esx_taxijob:getStockItem', function(itemName, count) AddEventHandler('esx_taxijob:getStockItem', function(itemName, count)
local xPlayer = ESX.GetPlayerFromId(source)
TriggerEvent('esx_addoninventory:getSharedInventory', 'society_taxi', function(inventory)
local item = inventory.getItem(itemName)
local sourceItem = xPlayer.getInventoryItem(itemName)
local xPlayer = ESX.GetPlayerFromId(source) -- is there enough in the society?
if count > 0 and item.count >= count then
TriggerEvent('esx_addoninventory:getSharedInventory', 'society_taxi', function(inventory)
-- can the player carry the said amount of x item?
local item = inventory.getItem(itemName) if sourceItem.limit ~= -1 and (sourceItem.count + count) > sourceItem.limit then
TriggerClientEvent('esx:showNotification', xPlayer.source, _U('player_cannot_hold'))
if item.count >= count then else
inventory.removeItem(itemName, count) inventory.removeItem(itemName, count)
xPlayer.addInventoryItem(itemName, count) xPlayer.addInventoryItem(itemName, count)
else TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_withdrawn') .. count .. ' ' .. item.label)
TriggerClientEvent('esx:showNotification', xPlayer.source, _U('quantity_invalid')) end
end else
TriggerClientEvent('esx:showNotification', xPlayer.source, _U('quantity_invalid'))
TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_withdrawn') .. count .. ' ' .. item.label) end
end)
end)
end) end)
ESX.RegisterServerCallback('esx_taxijob:getStockItems', function(source, cb) ESX.RegisterServerCallback('esx_taxijob:getStockItems', function(source, cb)