Everything other scripts can use from Theme Park: the two chat commands, the server exports and the client export, and the events that tell your resources what happens in the park — rides boarded and finished, bumper car rounds, darts games, hoops rounds and purchases. They work the same on ESX, QBCore, Qbox and standalone servers.
Commands#
Players need no command to use the park: rides, games and stands open with the board key (see Usage). Theme Park registers two commands:
Command | Who can use it | What it does |
|---|---|---|
| Players with the ace | Opens the settings panel, where everything in the park is set and saved in the database. See Usage. |
| Everyone | Puts away the souvenir the player carries in their hands. Bound to J by default. |
Who can open the settings panel#
Anyone can type the command, but the panel only opens for a player whose ace allows command.themeparkconfig. Give it to your admin group in server.cfg:
add_ace group.admin command.themeparkconfig allowBeing an admin in ESX, QBCore or Qbox is not enough on its own: the panel only checks this ace. A player without it sees You do not have permission to change the theme park settings. and the server console names them. How to put your staff in group.admin is explained in Installation.
Renaming the settings command#
The name changes in Settings → Commands → Settings command, written without the slash. It is the only setting that needs a restart: save it, then restart qs-themepark (or the server) and the new name works for everyone. The chat suggestion follows the new name.
The put-away key#
/themeparkputaway is registered as a FiveM key mapping called Theme park: put the souvenir away, on J by default. Each player can bind it to another key in the GTA pause menu: Settings → Key Bindings → FiveM. The shop panel and the hint shown while carrying a souvenir show the key the player bound.
A put-away souvenir leaves the player's hands; it does not go to the inventory. It is also put away when the player dies or buys another one, and only hidden — not put away — while they drive, ride or eat.
Exports#
Call them from any resource with exports['qs-themepark']. In the server exports, src is a player's server id.
Ride ids#
Every export and event names a ride by one of these ids:
Id | Ride |
|---|---|
| Ferris wheel |
| Roller coaster |
| Drop tower |
| Sky drop |
| Flying swings |
| Bumper cars |
Server exports#
Export | Returns |
|---|---|
| The id of the ride the player is on or boarding ( |
| A table |
| What one ride costs now: the ride's own price, or the park price when the ride's is |
|
|
| Gives a day pass, or adds the minutes to the one running. Returns the Unix time it runs out, or |
| The ten best darts players, best first: a list of |
| The player's best darts score, or |
| The same as |
| The player's best hoops score, or |
| The menu id of the souvenir the player carries ( |
| Nothing. Takes the souvenir out of the player's hands, as |
-- server script of your own resource
local park = exports['qs-themepark']
local function parkInfo(src)
-- Is the player on a ride? ('coaster', 'sky'... or false)
local ride = park:IsOnRide(src)
if ride then print(('Player %d is on %s'):format(src, ride)) end
-- What the roller coaster is doing right now
local coaster = park:GetRideState('coaster')
if coaster and coaster.enabled and coaster.state == 'WAITING' then
print(('Coaster leaves in %d s, %d/%d seats taken'):format(coaster.timer, coaster.seatsTaken, coaster.seatsTotal))
end
-- Prices and the day pass
print(('The Ferris wheel costs $%d'):format(park:GetRidePrice('wheel')))
if not park:HasPass(src) then
local expires = park:GivePass(src, 60) -- one hour; nil if no character is loaded yet
if expires then print('Pass valid until ' .. os.date('%H:%M', expires)) end
end
-- Leaderboards
for i, row in ipairs(park:GetDartsLeaderboard('today')) do
print(i, row.name, row.score)
end
local best = park:GetHoopsBestScore(src) -- nil if the player never finished a round
-- Free the player's hands
if park:GetCarriedSouvenir(src) then
park:ClearCarriedSouvenir(src)
end
endA pass from
GivePassworks even when the day pass is not on sale, is saved like a bought one (it survives reconnects and restarts) and is posted to theeconomyDiscord log with the name of the resource that gave it. It does not firepassBought.The leaderboards hold one line per player — their best game — and only count games played to the end: every dart thrown, or a hoops round played to the buzzer.
'today'follows the server's clock.GetBestScoreandGetHoopsBestScorealso take the player's identifier as stored in the score tables instead of a server id.
Ride state#
GetRideState reports each ride's own phase in capitals. Every ride reports CLOSED while it does not run.
Ride | state | Notes |
|---|---|---|
|
| No |
|
|
|
|
|
|
|
|
|
enabled turns false as soon as the ride is turned off in the panel, even while the riders already on it finish their ride. seatsTaken and seatsTotal count cabins, seats or cars; queue is 0 on every ride but the wheel.
Client export#
IsOnRide() returns the id of the ride the local player is on or boarding, or false. Use it to keep your HUD hidden, or to block a menu or an emote while the player rides.
-- client script of your own resource
local ride = exports['qs-themepark']:IsOnRide()
if ride then
print('You are on the ' .. ride)
endEvents#
Settings applied#
qs-themepark:settingsApplied fires on the server and on every client when the saved settings are first loaded, and again after every save or reset in the panel. It carries no arguments: read what you need with the exports.
-- server side
AddEventHandler('qs-themepark:settingsApplied', function()
local price = exports['qs-themepark']:GetRidePrice('coaster')
print(('Theme Park settings applied: the roller coaster costs $%d'):format(price))
end)Server events#
Theme Park fires these on the server with TriggerEvent, so a server script of another resource listens with AddEventHandler. src is the player's server id.
Event | Arguments | When |
|---|---|---|
|
| A player took a seat (on the wheel: got into a cabin). |
|
| A rider left the ride for any reason: the ride ended, they got out, the ride closed or they left the server. |
|
| A bumper cars round with drivers ended. |
|
| A darts game ended, played to the end or not. |
|
| A hoops round ended, played to the buzzer or not. |
|
| A player bought a day pass at the ticket booth or in a ride panel. |
|
| A food or souvenir order was handed over. |
|
| The same order, for food stands only. It fires right after |
Darts and hoops results
Field | Meaning |
|---|---|
| The number of the dart target or the hoops lane (its row in |
| The points of the darts game, or of the hoops round. |
| Hoops only: the baskets made and the balls thrown. |
| The score reached a prize tier. |
| The prize handed over, as text ( |
|
|
Shop orders
Argument | Meaning |
|---|---|
| The id of the stand in the stand list ( |
|
|
| What was handed over: a list of |
| The money paid, after the refund of any line that could not be handed over. |
A reward on rides, games and purchases, from your own server script:
local park = exports['qs-themepark']
local rides = {}
AddEventHandler('qs-themepark:server:rideBoarded', function(src, rideId, method, price)
print(('%s boarded %s (%s, $%d)'):format(GetPlayerName(src), rideId, method, price))
end)
-- Every fifth ride: a free hour on every ride
AddEventHandler('qs-themepark:server:rideFinished', function(src, rideId)
if not GetPlayerName(src) then return end -- already left the server
rides[src] = (rides[src] or 0) + 1
if rides[src] % 5 == 0 then
park:GivePass(src, 60)
TriggerClientEvent('chat:addMessage', src, { args = { 'Theme Park', 'Five rides! The next hour is on us.' } })
end
end)
AddEventHandler('playerDropped', function()
rides[source] = nil
end)
AddEventHandler('qs-themepark:server:dartsFinished', function(src, result)
if result.reason == 'done' and result.won then
TriggerEvent('my-achievements:unlock', src, 'darts_winner')
end
end)
AddEventHandler('qs-themepark:server:hoopsFinished', function(src, result)
if result.reason == 'done' then
print(('%s scored %d (%d/%d baskets)'):format(GetPlayerName(src), result.score, result.makes, result.shots))
end
end)
AddEventHandler('qs-themepark:server:bumperRoundEnded', function(results, winnerSrc)
if winnerSrc then
print(('%s won the bumper cars with %d hits'):format(results[1].name, results[1].hits))
end
end)
AddEventHandler('qs-themepark:server:shopBought', function(src, vendorId, shopType, items, total)
for _, line in ipairs(items) do
if line.id == 'teddy' then
TriggerEvent('my-quests:progress', src, 'buy_giant_teddy')
end
end
end)Client events#
The server sends these to every client, for the ride animations and the game screens. Read them in a client script and compare src with your own server id to react only to the local player. For anything that pays or counts, use the server events above.
Boarding and leaving a ride
Event | Arguments |
|---|---|
|
|
|
|
|
|
|
|
|
|
-- client script: react when the local player gets on the roller coaster
local me = GetPlayerServerId(PlayerId())
RegisterNetEvent('qs-themepark:coaster:onBoard', function(src, car, place)
if src ~= me then return end
print(('You sit in car %d, seat %s'):format(car + 1, place))
end)A darts game or a hoops round ends
qs-themepark:darts:finish — (targetId, result) and qs-themepark:hoops:finish — (laneId, result). result holds the fields of the server events (total for darts; score, makes and shots for hoops; won, prize and reason for both), plus:
Field | Meaning |
|---|---|
| The player who played. |
| The points the lowest prize tier needs. |
| Whether a prize was handed over. |
|
|
| Darts only: which prize tier the score reached. |
Only listen to these events. Triggering them yourself changes nothing in the park: seats, scores, payments and prizes are decided on the server, never taken from a client. A
TriggerEventof your own would only mislead the other resources that listen to them.



