Skip to content

Exports/Events

Client exports, server callbacks, and net events for integrations.

Client exports#

toggleGPS#

Open, close or toggle the handheld GPS UI.

lua
-- Toggle current state
exports['0r-gps']:toggleGPS()

-- Force open
exports['0r-gps']:toggleGPS(true)

-- Force close
exports['0r-gps']:toggleGPS(false)

Parameters#

NameTypeDescription
stateboolean?Optional forced state. true = open, false = close

Returns#

TypeDescription
booleanCurrent visibility state after toggle

isOpen#

Returns whether the GPS UI is currently open.

lua
local isOpen = exports['0r-gps']:isOpen()

Returns#

TypeDescription
booleanGPS visibility state

getChannelId#

Returns the current connected channel ID.

lua
local channelId = exports['0r-gps']:getChannelId()

Returns#

TypeDescription
numberCurrent frequency ID, or 0 if not connected

getChannelMembers#

Returns all members currently synced in the active channel.

lua
local members = exports['0r-gps']:getChannelMembers()

for _, serverId in pairs(members) do
    print(serverId)
end

Returns#

TypeDescription
tableArray of member server IDs

joinChannel#

Join a GPS channel.

lua
local success = exports['0r-gps']:joinChannel(1)

local success = exports['0r-gps']:joinChannel(1, 'mypassword')

Parameters#

NameTypeDescription
channelIdnumberTarget channel/frequency ID
passwordstring?Optional channel password

Returns#

TypeDescription
booleanWhether the join request succeeded

leaveChannel#

Leave the current GPS channel.

lua
local success = exports['0r-gps']:leaveChannel()

Returns#

TypeDescription
booleanWhether leaving succeeded

Useable Events#

Client

EventPurpose
0r-gps:client:toggleGPSOpen GPS UI (from usable item)

State bags#

Useful for other scripts that read player state:

BagValues
gpsStatusfoot, vehicle, boat, plane, motorcycle, bike, helicopter, dead
gpsSirentrue / false — emergency lights
gpsPunishmenttrue when water punishment (coord punishment) is active