Skip to content

Commit

Permalink
refactor: (esx_mechanicjob): refactor esx_mechanicjob
Browse files Browse the repository at this point in the history
  • Loading branch information
bitpredator committed Apr 2, 2024
1 parent b757d49 commit dd20de8
Show file tree
Hide file tree
Showing 17 changed files with 1,398 additions and 1,486 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ You are not authorized to sell this software (this is free project).

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
816 changes: 344 additions & 472 deletions server-data/resources/[esx_addons]/esx_mechanicjob/client/main.lua

Large diffs are not rendered by default.

86 changes: 45 additions & 41 deletions server-data/resources/[esx_addons]/esx_mechanicjob/config.lua
Original file line number Diff line number Diff line change
@@ -1,70 +1,74 @@
Config = {}
Config.Locale = GetConvar("esx:locale", "en")
Config = {}
Config.Locale = GetConvar('esx:locale', 'en')

Config.DrawDistance = 10.0 -- How close you need to be in order for the markers to be drawn (in GTA units).
Config.MaxInService = -1
Config.EnablePlayerManagement = true -- Enable society managing.
Config.Controls = {
mechanicMenu = "F6",
toggleNPCJob = "F7"
}

Config.DrawDistance = 10.0 -- How close you need to be in order for the markers to be drawn (in GTA units).
Config.MaxInService = -1
Config.EnablePlayerManagement = true -- Enable society managing.
Config.EnableSocietyOwnedVehicles = false

Config.NPCSpawnDistance = 500.0
Config.NPCNextToDistance = 25.0
Config.NPCJobEarnings = { min = 15, max = 40 }
Config.NPCSpawnDistance = 500.0
Config.NPCNextToDistance = 25.0
Config.NPCJobEarnings = { min = 15, max = 40 }

Config.OxInventory = ESX.GetConfig().OxInventory
Config.OxInventory = ESX.GetConfig().OxInventory

Config.Vehicles = {
"adder",
"asea",
"asterope",
"banshee",
"buffalo",
"sultan",
"baller3",
'adder',
'asea',
'asterope',
'banshee',
'buffalo',
'sultan',
'baller3'
}

Config.Zones = {

MechanicActions = {
Pos = vector3(-342.291, -133.370, 39.009),
Size = { x = 1.0, y = 1.0, z = 1.0 },
Pos = vector3(-342.291, -133.370, 39.009 ),
Size = { x = 1.0, y = 1.0, z = 1.0 },
Color = { r = 50, g = 200, b = 50 },
Type = 21,
Type = 21
},

Garage = {
Pos = vector3(-97.5, 6496.1, 31.4),
Size = { x = 1.0, y = 1.0, z = 1.0 },
Pos = vector3(-97.5, 6496.1, 31.4 ),
Size = { x = 1.0, y = 1.0, z = 1.0 },
Color = { r = 50, g = 200, b = 50 },
Type = 21,
Type = 21
},

--[[Craft = {
Craft = {
Pos = vector3( -323.140, -129.882, 38.999 ),
Size = { x = 1.0, y = 1.0, z = 1.0 },
Color = { r = 50, g = 200, b = 50 },
Type = 21
},]]
--
},

VehicleSpawnPoint = {
Pos = vector3(-366.354, -110.766, 37.696),
Size = { x = 1.5, y = 1.5, z = 1.0 },
Type = -1,
Pos = vector3(-366.354, -110.766, 37.696 ),
Size = { x = 1.5, y = 1.5, z = 1.0 },
Type = -1
},

VehicleDeleter = {
Pos = vector3(-386.899, -105.675, 37.683),
Size = { x = 3.0, y = 3.0, z = 1.0 },
Pos = vector3(-386.899, -105.675, 37.683 ),
Size = { x = 3.0, y = 3.0, z = 1.0 },
Color = { r = 204, g = 204, b = 0 },
Type = 1,
Type = 1
},

VehicleDelivery = {
Pos = vector3(-382.925, -133.748, 37.685),
Size = { x = 20.0, y = 20.0, z = 3.0 },
Pos = vector3(-382.925, -133.748, 37.685 ),
Size = { x = 20.0, y = 20.0, z = 3.0 },
Color = { r = 204, g = 204, b = 0 },
Type = -1,
},
Type = -1
}
}

Config.Towables = {
Expand Down Expand Up @@ -107,14 +111,14 @@ Config.Towables = {
vector3(-1709.8, 55.1, 65.7),
vector3(-521.9, -266.8, 34.9),
vector3(-451.1, -333.5, 34.0),
vector3(322.4, -1900.5, 25.8),
vector3(322.4, -1900.5, 25.8)
}

for k, v in ipairs(Config.Towables) do
Config.Zones["Towable" .. k] = {
Pos = v,
Size = { x = 1.5, y = 1.5, z = 1.0 },
for k,v in ipairs(Config.Towables) do
Config.Zones['Towable' .. k] = {
Pos = v,
Size = { x = 1.5, y = 1.5, z = 1.0 },
Color = { r = 204, g = 204, b = 0 },
Type = -1,
Type = -1
}
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
INSERT INTO `addon_account` (name, label, shared) VALUES
('society_mechanic', 'Mechanic', 1)
;

INSERT INTO `addon_inventory` (name, label, shared) VALUES
('society_mechanic', 'Mechanic', 1)
;

INSERT INTO `datastore` (name, label, shared) VALUES
('society_mechanic', 'Mechanic', 1)
;

INSERT INTO `jobs` (name, label) VALUES
('mechanic', 'Mechanic')
;

INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES
('mechanic',0,'recrue','Recrue',12,'{}','{}'),
('mechanic',1,'novice','Novice',24,'{}','{}'),
('mechanic',2,'experimente','Experimente',36,'{}','{}'),
('mechanic',3,'chief',"Chef d\'équipe",48,'{}','{}'),
('mechanic',4,'boss','Patron',0,'{}','{}')
;

INSERT INTO `items` (name, label, weight) VALUES
('gazbottle', 'bouteille de gaz', 2),
('fixtool', 'outils réparation', 2),
('carotool', 'outils carosserie', 2),
('blowpipe', 'Chalumeaux', 2),
('fixkit', 'Kit réparation', 3),
('carokit', 'Kit carosserie', 3)
;
46 changes: 23 additions & 23 deletions server-data/resources/[esx_addons]/esx_mechanicjob/fxmanifest.lua
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
fx_version("adamant")
fx_version 'adamant'

game("gta5")
game 'gta5'

description("ESX Mechanic Job")
lua54("yes")
version("1.0.0")
description 'Allows players to RP as a mechanic (repair and modify vehicles)'
lua54 'yes'
version '1.0.1'

shared_script("@es_extended/imports.lua")
shared_script '@es_extended/imports.lua'

client_scripts({
"@es_extended/locale.lua",
"locales/*.lua",
"config.lua",
"client/main.lua",
})
client_scripts {
'@es_extended/locale.lua',
'locales/*.lua',
'config.lua',
'client/main.lua'
}

server_scripts({
"@es_extended/locale.lua",
"locales/*.lua",
"config.lua",
"server/main.lua",
})
server_scripts {
'@es_extended/locale.lua',
'locales/*.lua',
'config.lua',
'server/main.lua'
}

dependencies({
"es_extended",
"esx_society",
"esx_billing",
})
dependencies {
'es_extended',
'esx_society',
'esx_billing'
}
170 changes: 85 additions & 85 deletions server-data/resources/[esx_addons]/esx_mechanicjob/locales/de.lua
Original file line number Diff line number Diff line change
@@ -1,86 +1,86 @@
Locales["de"] = {
["mechanic"] = "Mechaniker",
["drive_to_indicated"] = "Fahre zum Makierten Standort",
["mission_canceled"] = "Mission abgebrochen",
["vehicle_list"] = "Fahrzeug Liste",
["work_wear"] = "Arbeitskleidung",
["civ_wear"] = "Zivilisten Kleidung",
["deposit_stock"] = "Item einlagern",
["withdraw_stock"] = "Item auslagern",
["boss_actions"] = "Boss Aktionen",
["service_vehicle"] = "Service Fahrzeug",
["flat_bed"] = "Pritsche",
["tow_truck"] = "Abschleppwagen",
["service_full"] = "Service Voll: ",
["open_actions"] = "Drücke [E] um auf das Menü zuzugreifen.",
["harvest"] = "Ernten",
["harvest_menu"] = "Drücke [E] um das Ernte Menü zu öffnen.",
["not_experienced_enough"] = "Du bist zu unerfahren um dass zu machen!.",
["gas_can"] = "Benzinkanister",
["repair_tools"] = "Reparier Tools",
["body_work_tools"] = "bodywork Tools",
["blowtorch"] = "Zündkerze",
["repair_kit"] = "Werkzeugkasten",
["body_kit"] = "Fahrzeugkit",
["craft"] = "Craften",
["craft_menu"] = "Drücke [E] um das Crafting Menü zu öffnen.",
["billing"] = "Rechnung",
["hijack"] = "Aufbrechen",
["repair"] = "Reparieren",
["clean"] = "Sauber machen",
["imp_veh"] = "Abschleppen",
["place_objects"] = "Objekt Platzieren",
["invoice_amount"] = "Rechnungsanzahl",
["amount_invalid"] = "Ungültige Anzahl",
["no_players_nearby"] = "Es gibt keine Person in der Nähe",
["no_vehicle_nearby"] = "Es gibt kein Fahrzeug in der Nähe",
["inside_vehicle"] = "Du kannst das nicht außerhalb eines Fahrzeugs tun!",
["vehicle_unlocked"] = "Das Fahrzeug wurde aufgebrochen",
["vehicle_repaired"] = "Das Fahrzeug wurde repariert",
["vehicle_cleaned"] = "Das Fahrzeug wurde sauber gemacht",
["vehicle_impounded"] = "Das Fahrzeug wurde abgeschleppt",
["must_seat_driver"] = "Du musst auf dem Fahrersitz sein!",
["must_near"] = "Du musst in der nähe eines Fahrzeugs sein, um es abzuschleppen",
["vehicle_success_attached"] = "Fahrzeug erfolgreich aufgeladen",
["please_drop_off"] = "Bitte lade das Fahrzeug an der Garage ab!",
["cant_attach_own_tt"] = "Du kannst deinen eigenen Abschleppwagen nicht abschleppen!",
["no_veh_att"] = "Es gibt kein Fahrzeug was abgeschleppt werden kann!",
["not_right_veh"] = "Dies ist nicht das richtige Fahrzeug",
["not_right_place"] = "Dies ist nicht die richtige Position",
["veh_det_succ"] = "Fahrzeug erfolgreich abgeladen!",
["imp_flatbed"] = "Aktion unmöglich! Du benötigst einen Abschleppwagen um das zu tun!",
["objects"] = "Objekte",
["roadcone"] = "Leitkegel",
["toolbox"] = "Werkzeugkasten",
["mechanic_stock"] = "Mechanikerlager",
["quantity"] = "Anzahl",
["invalid_quantity"] = "Ungültige Anzahl",
["inventory"] = "Inventar",
["veh_unlocked"] = "Fahrzeug aufgebrochen",
["hijack_failed"] = "Aufbrechen fehlgeschlagen",
["body_repaired"] = "Körper repariert",
["veh_repaired"] = "Fahrzeug repariert",
["veh_stored"] = "Drücke [E] um das Fahrzeug einzuparken.",
["press_remove_obj"] = "Drücke [E] um das Objekt zu entfernen",
["please_tow"] = "Bitte Schlepp das Fahrzeug ab",
["wait_five"] = "Du musst 5 Minuten warten",
["must_in_flatbed"] = "Du musst dafür in einem Abschleppwagen sitzen",
["mechanic_customer"] = "Mechaniker Kunde",
["you_do_not_room"] = "Du hast nicht genügend Platz",
["recovery_gas_can"] = "Benzin Kanister wird abgerufen...",
["recovery_repair_tools"] = "Reparierungstools werden abgerufen...",
["recovery_body_tools"] = "Body Tools Abruf...",
["not_enough_gas_can"] = "Du hast nicht genügend Benzinkanister.",
["assembling_blowtorch"] = "Schweißbrenner wird angebracht...",
["not_enough_repair_tools"] = "Du hast nicht genug Reparierungstools.",
["assembling_repair_kit"] = "Zusammenbau des Reparatursatzes...",
["not_enough_body_tools"] = "Du haben nicht genügend Bodytools.",
["assembling_body_kit"] = "Zusammenbau des Bodykits...",
["your_comp_earned"] = "Deine Firma verdient €",
["you_used_blowtorch"] = "Du nutzt einen Schweißbrenner",
["you_used_repair_kit"] = "Du nutzt ein Reparierungskit",
["you_used_body_kit"] = "Du nutzt ein Body Kit",
["have_withdrawn"] = "Du zahlst aus x%s %s",
["have_deposited"] = "Du zahlst ein x%s %s",
["player_cannot_hold"] = "Du hast nicht genügend freien Platz im Inventar!",
Locales['de'] = {
['mechanic'] = 'Mechaniker',
['drive_to_indicated'] = 'Fahre zum Makierten Standort',
['mission_canceled'] = 'Mission abgebrochen',
['vehicle_list'] = 'Fahrzeug Liste',
['work_wear'] = 'Arbeitskleidung',
['civ_wear'] = 'Zivilisten Kleidung',
['deposit_stock'] = 'Item einlagern',
['withdraw_stock'] = 'Item auslagern',
['boss_actions'] = 'Boss Aktionen',
['service_vehicle'] = 'Service Fahrzeug',
['flat_bed'] = 'Pritsche',
['tow_truck'] = 'Abschleppwagen',
['service_full'] = 'Service Voll: ',
['open_actions'] = 'Drücke [E] um auf das Menü zuzugreifen.',
['harvest'] = 'Ernten',
['harvest_menu'] = 'Drücke [E] um das Ernte Menü zu öffnen.',
['not_experienced_enough'] = 'Du bist zu unerfahren um dass zu machen!.',
['gas_can'] = 'Benzinkanister',
['repair_tools'] = 'Reparier Tools',
['body_work_tools'] = 'bodywork Tools',
['blowtorch'] = 'Zündkerze',
['repair_kit'] = 'Werkzeugkasten',
['body_kit'] = 'Fahrzeugkit',
['craft'] = 'Craften',
['craft_menu'] = 'Drücke [E] um das Crafting Menü zu öffnen.',
['billing'] = 'Rechnung',
['hijack'] = 'Aufbrechen',
['repair'] = 'Reparieren',
['clean'] = 'Sauber machen',
['imp_veh'] = 'Abschleppen',
['place_objects'] = 'Objekt Platzieren',
['invoice_amount'] = 'Rechnungsanzahl',
['amount_invalid'] = 'Ungültige Anzahl',
['no_players_nearby'] = 'Es gibt keine Person in der Nähe',
['no_vehicle_nearby'] = 'Es gibt kein Fahrzeug in der Nähe',
['inside_vehicle'] = 'Du kannst das nicht außerhalb eines Fahrzeugs tun!',
['vehicle_unlocked'] = 'Das Fahrzeug wurde aufgebrochen',
['vehicle_repaired'] = 'Das Fahrzeug wurde repariert',
['vehicle_cleaned'] = 'Das Fahrzeug wurde sauber gemacht',
['vehicle_impounded'] = 'Das Fahrzeug wurde abgeschleppt',
['must_seat_driver'] = 'Du musst auf dem Fahrersitz sein!',
['must_near'] = 'Du musst in der nähe eines Fahrzeugs sein, um es abzuschleppen',
['vehicle_success_attached'] = 'Fahrzeug erfolgreich aufgeladen',
['please_drop_off'] = 'Bitte lade das Fahrzeug an der Garage ab!',
['cant_attach_own_tt'] = 'Du kannst deinen eigenen Abschleppwagen nicht abschleppen!',
['no_veh_att'] = 'Es gibt kein Fahrzeug was abgeschleppt werden kann!',
['not_right_veh'] = 'Dies ist nicht das richtige Fahrzeug',
['not_right_place'] = 'Dies ist nicht die richtige Position',
['veh_det_succ'] = 'Fahrzeug erfolgreich abgeladen!',
['imp_flatbed'] = 'Aktion unmöglich! Du benötigst einen Abschleppwagen um das zu tun!',
['objects'] = 'Objekte',
['roadcone'] = 'Leitkegel',
['toolbox'] = 'Werkzeugkasten',
['mechanic_stock'] = 'Mechanikerlager',
['quantity'] = 'Anzahl',
['invalid_quantity'] = 'Ungültige Anzahl',
['inventory'] = 'Inventar',
['veh_unlocked'] = 'Fahrzeug aufgebrochen',
['hijack_failed'] = 'Aufbrechen fehlgeschlagen',
['body_repaired'] = 'Körper repariert',
['veh_repaired'] = 'Fahrzeug repariert',
['veh_stored'] = 'Drücke [E] um das Fahrzeug einzuparken.',
['press_remove_obj'] = 'Drücke [E] um das Objekt zu entfernen',
['please_tow'] = 'Bitte Schlepp das Fahrzeug ab',
['wait_five'] = 'Du musst 5 Minuten warten',
['must_in_flatbed'] = 'Du musst dafür in einem Abschleppwagen sitzen',
['mechanic_customer'] = 'Mechaniker Kunde',
['you_do_not_room'] = 'Du hast nicht genügend Platz',
['recovery_gas_can'] = 'Benzin Kanister wird abgerufen...',
['recovery_repair_tools'] = 'Reparierungstools werden abgerufen...',
['recovery_body_tools'] = 'Body Tools Abruf...',
['not_enough_gas_can'] = 'Du hast nicht genügend Benzinkanister.',
['assembling_blowtorch'] = 'Schweißbrenner wird angebracht...',
['not_enough_repair_tools'] = 'Du hast nicht genug Reparierungstools.',
['assembling_repair_kit'] = 'Zusammenbau des Reparatursatzes...',
['not_enough_body_tools'] = 'Du haben nicht genügend Bodytools.',
['assembling_body_kit'] = 'Zusammenbau des Bodykits...',
['your_comp_earned'] = 'Deine Firma verdient €',
['you_used_blowtorch'] = 'Du nutzt einen Schweißbrenner',
['you_used_repair_kit'] = 'Du nutzt ein Reparierungskit',
['you_used_body_kit'] = 'Du nutzt ein Body Kit',
['have_withdrawn'] = 'Du zahlst aus x%s %s',
['have_deposited'] = 'Du zahlst ein x%s %s',
['player_cannot_hold'] = 'Du hast nicht genügend freien Platz im Inventar!',
}
Loading

0 comments on commit dd20de8

Please sign in to comment.