Examples and Commands
RegisterCommand('addSupplies', function(source, args, rawCommand)
local town = args[1] -- The town name passed as the first argument
local suppliesAmount = tonumber(args[2]) -- The amount of supplies to add
if town and suppliesAmount then
TriggerServerEvent('codex-studios-supplies:city_resupplies', town, suppliesAmount)
else
CodexCore.Notification("Invalid parameters. Usage: /addSupplies [town] [amount]", 2000)
end
end, false)-- Remove supplies from a specific town
RegisterCommand('removeSupplies', function(source, args, rawCommand)
local town = args[1] -- The town name passed as the first argument
local suppliesAmount = tonumber(args[2]) -- The amount of supplies to remove
if town and suppliesAmount then
TriggerServerEvent('codex-studios-supplies:city_removesupplies', town, suppliesAmount)
else
CodexCore.Notification("Invalid parameters. Usage: /removeSupplies [town] [amount]", 2000)
end
end, false)Last updated
Was this helpful?

