Exports
File: shared/commands.lua
The resource exposes several exports that can be called from other resources on both server and client sides.
Server-side exports
GetGardenerStats(source)
Returns the full stats object for a player.
local stats = exports['koja-lawnmower']:GetGardenerStats(playerSource)
Returns:
{
level = { currentLevel, currentXP, maxXP },
skillpoints = 0,
skills = {},
history = {
logs = {},
totalEarnings = 0,
totalMissions = 0
}
}
Returns nil if the player is not found.
IsOnGardenerMission(source)
Checks whether a player is currently participating in any active gardener mission (as owner or party member).
local busy = exports['koja-lawnmower']:IsOnGardenerMission(playerSource)
-- returns: true | false
GetGardenerParty(source)
Returns the party data for the player's current party, or nil if they are not in one.
local party = exports['koja-lawnmower']:GetGardenerParty(playerSource)
StartGardenerMission(source, missionId)
Programmatically starts a mission for a player.
local success = exports['koja-lawnmower']:StartGardenerMission(playerSource, 'mirrorpark_1')
-- returns: true | false
Client-side exports
All client exports internally call the server via callbacks and return the result synchronously (using Citizen.Await).
GetGardenerStats()
local stats = exports['koja-lawnmower']:GetGardenerStats()
Same return format as the server version, but no source parameter needed.
IsOnGardenerMission()
local busy = exports['koja-lawnmower']:IsOnGardenerMission()
-- returns: true | false
GetGardenerParty()
local party = exports['koja-lawnmower']:GetGardenerParty()
StartGardenerMission(missionId)
local success = exports['koja-lawnmower']:StartGardenerMission('mirrorpark_1')
-- returns: true | false
Usage example
-- From another server script:
RegisterCommand('checkgardener', function(source)
local stats = exports['koja-lawnmower']:GetGardenerStats(source)
if stats then
print(('Player level: %d, XP: %d/%d'):format(
stats.level[1], stats.level[2], stats.level[3]
))
end
end, false)
Related pages
- Installation — Welcome to Koja-Lawnmower, a fluent job system designed to enhance gameplay for your players.
- Configuration — Poniżej znajdują się opisane oddzielnie poszczególne tabele z shared/config.lua.
- Commands — All commands are server-side only and require RCON / admin permissions (true as the third argument to RegisterCommand).
- Lawnmower — back to the section overview