Mechanic tablet will add the ability for players to modify their vehicle all from a simple-to-use tabet,
This script is written to work withand
The tablet can be opened by using /tablet; however this command can be changed or disabled. You can also trigger an event to open the tablet, which can be added to an item or location.
Features of The Mechanic Tablet:
Ability to Modify Vehicle Mods
Ability to Modify Vehicle Primary, Secondary, Wheel and Pearlescent Colours.
Ability to Modify Vehicle Extras
Whitelist Jobs to specific Vehicle Classes.
Installation
Download the power_mechanicTablet from Keymaster
Add the files to your resources folder
Ensure that the resource file will start (either ensure your resource in the server.cfg or inside a folder which is started on server start)
Edit the config file to your needs
Restart your server
Configuration
Select the tab below for your framework to see the configuration options available.
-- Enables command to open tablet - /tablet
enableCommand = true
-- Change the command to open tablet.
tabletCommand = "tablet"
-- Requires an item to open the tablet.
commandItemRequired = false
-- The item required to use the /command
itemRequired = 'phone'
-- Enable Job Whitelist
useJobWhitelist = false
-- whitelist the tablet to a job and vehicle class only.
-- ['jobName'] = {vehicleClassId, vehicleClassId}
---------------------
-- Vehicle Class List
---------------------
-- 0: Compacts | 1: Sedans | 2: SUVs | 3: Coupes | 4: Muscle | 5: Sports Classics | 6: Sports | 7: Super | 8: Motorcycles | 9: Off-road | 10: Industrial | 11: Utility | 12: Vans | 13: Cycles | 14: Boats | 15: Helicopters | 16: Planes | 17: Service | 18: Emergency | 19: Military | 20: Commercial
---------------------
jobWhitelist = {
['mechanic'] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20},
['police'] = {18},
}
locationOnly = false -- This will only allow the tablet to be used in the locations below.
-- Locations where the tablet can be used.
availableLocations = {
{coords = vector3(0.0, 0.0, 0.0), radius = 10.0}, -- where the tablet can be used and the radius of the location.
}
-- Enable ESX Support
enableESX = true
-- The event names, incase you have renamed standard esx functions
ESX_playerLoadedEvent = 'esx:playerLoaded'
ESX_jobUpdateEvent = 'esx:setJob'
-- Enable QBCore Support
enableQBCore = false
-- Name of your qb-core resource, incase you have renamed it.
QBC_resourceName = 'qb-core'
-- The event names, incase you have renamed standard qbcore functions
QBC_playerLoadedEvent = 'QBCore:Client:OnPlayerLoaded'
QBC_jobUpdateEvent = 'QBCore:Client:OnJobUpdate'
If you want to use an item with standalone, you will need to create a useable item that triggers the following client event:
power_encryptedChat:open
In this section you're able to choose if items are required to perform specific typed of upgrades, what those items are, and if those items should be removed from the player's inventory:
In this section you can edit the language if you need to translate to another language or edit the wording.
Lang = {
['noVehicle'] = "You are not in or near a vehicle.",
['wrongClass'] = "You cannot use this tablet on this vehicle class.",
['cannotUseCommand'] = "You cannot use this command.",
['itemMissing'] = "You are missing required items.",
}
Editable files
notification.lua
Custom Notifications
If you would like to edit the notifications to add your own custom notifications or to match them to your other server notifications, you can edit them in the notification.lua file. Default notifications are as follows:
-- You can edit the notification used in the script here.
AddEventHandler('mechanic:tablet:notification', function(message)
TriggerEvent('chat:addMessage', {color = {255, 255, 255}, args = {"^8SYSTEM", message}})
end)