Server API
Every export below is server-side. Call them onexports.road_minigolf.
Courses
GetCourses
All courses with their full data, props included.GetCourse
One course with its full data.GetCourseList
A light list of every course, without props, sorted by ID.Players and sessions
IsPlayerInGame
GetPlayerSession
The game or lobby the player is in.GetActiveSessions
Every running game and open lobby.IsAdmin
Whether a player has minigolf admin rights.Leaderboards and statistics
GetLeaderboard
The all-time leaderboard of a course.GetLeaderboards
All three leaderboards of a course.GetHoleRecords
The record of every hole.GetPlayerStats
Statistics of an online player.GetPlayerStatsByIdentifier
The same asGetPlayerStats, for offline players.
The identifier the events on this page carry: the framework’s player
identifier, or the FiveM license without a framework
Events
All server events are local events: listen withAddEventHandler. Clients
cannot trigger them. New arguments are always added at the end, so existing
handlers keep working after updates.
Games
Identifiers are only in the
players argument. The payload is the same
table the clients get, so it never carries identifiers.Records
Money
Anti-cheat
OpenHooks.OnSuspicious hook in
server/open.lua gets the same call.
Admin actions
src is 0 when the action came from the server console.
Player building
Saves and deletes by players fire these instead of
courseSaved and
courseDeleted. Rounds on player courses fire no holeInOne, recordSet or
holeRecordSet.
identifier is the admin’s identifier. name is the course name.