Events
Example
local test_command = {
command = "cosmo", -- command to use in terminal
show = true, -- Set to true if you want the command to be visible in the terminal command list
allowed = function(playerId, laptopSerial)
return true
end,
onSuccess = function(playerId, laptopSerial)
local playerMoney = exports['av_laptop']:getMoney(playerId, "cosmo") or 0
local actions = {
{
type = "text",
input = "Your current Cosmo balance is: "..playerMoney,
delay = 600
},
}
TriggerClientEvent("av_laptop:terminal", playerId, actions)
return true
end,
canProcess = function(playerId, laptopSerial, args)
return true
end,
actions = {
{type = "progressbar", input = "Fetching player Cosmo...", delay = 3000},
},
}
CreateThread(function()
while not GetResourceState('av_laptop') == 'started' do
Wait(100)
end
local added, msg = exports['av_laptop']:addCommand(test_command)
print("Adding terminal command:", added, msg)
end)Last updated