Configuration
config.lua
Config = {}
Config.UpdateInterval = 1 -- in minutes to update the playtime
-- Command
Config.UseCommand = true -- Enable or disable the command
Config.Command = "playtime" -- Command to use for the playtime shop
-- Basic
Config.AFKInSeconds = 30 -- Time in seconds to consider the player AFK
Config.UseOXInventoryImages = false -- Enable or disable the OX inventory images (Requires OX inventory system)
-- Add vehicle
Config.AddVehicle = function(xPlayer, vehicle) -- Add a vehicle to the player
local plate = GeneratePlate()
MySQL.insert("INSERT INTO owned_vehicles SET owner = ?, plate = ?, vehicle = ?", {
xPlayer.getIdentifier(),
plate,
json.encode({ model = GetHashKey(vehicle.vehName), plate = plate }),
})
Config.Notification("You have successfully received your vehicle!", xPlayer)
end
-- Add item
Config.AddItem = function(xPlayer, item) -- Add an item to the player
xPlayer.addInventoryItem(item.itemName, item.count)
Config.Notification("You have successfully received the item!", xPlayer)
end
-- Notification
Config.Notification = function(message, xPlayer) -- Send a notification to the player
if IsDuplicityVersion() then
xPlayer.showNotification(message)
else
ESX.ShowNotification(message)
end
end
-- Add your items here
Config.Items = {
{
label = "NINEF", -- Label for the vehicle
img = "ninef", -- Image for the vehicle
price = 15000, -- Price for the vehicle
vehicle = {
vehName = "ninef", -- Vehicle model for the item
},
},
{
label = "Candy", -- Label for the item
img = "candy", -- Image for the item
price = 15000, -- Price for the item
item = {
itemName = "weapon_candycane", -- Item spawn name
count = 1, -- Count of items to spawn
},
},
}
-- Locales
Config.Locales = {
claim = "CLAIM", -- Text for claiming a vehicle
playTimeShopTitle = "Play Time Shop", -- Title for the playtime shop
ShopItemsTitle = "Shop Items", -- Title for the shop items
search = "Search...", -- Search input placeholder
playtimeRanking = "PLAYTIME RANKING", -- Title for the playtime ranking
minutes = "minutes", -- Text for minutes
viewShopItems = "VIEW SHOP ITEMS", -- Text for viewing shop items
viewShopDescription = "You can buy in exchange for playing time!", -- Description for the playtime shop
noResult = "There are no results!", -- Text for no results
notEnough = "Can't afford", -- Text for not enough money
claiming = "CLAIMING", -- Text for claiming a vehicle
noAvailableRanking = "NO AVAILABLE RANKING", -- Text for no available ranking
}
Last updated
Was this helpful?