Client exports#
toggleGPS#
Open, close or toggle the handheld GPS UI.
lua Copy
exports['0r-gps' ]:toggleGPS()
exports['0r-gps' ]:toggleGPS(true )
exports['0r-gps' ]:toggleGPS(false )
Parameters#
Name Type Description state boolean? Optional forced state. true = open, false = close
Returns#
Type Description boolean Current visibility state after toggle
isOpen#
Returns whether the GPS UI is currently open.
lua Copy
local isOpen = exports['0r-gps' ]:isOpen()
Returns#
Type Description boolean GPS visibility state
getChannelId#
Returns the current connected channel ID.
lua Copy
local channelId = exports['0r-gps' ]:getChannelId()
Returns#
Type Description number Current frequency ID, or 0 if not connected
getChannelMembers#
Returns all members currently synced in the active channel.
lua Copy
local members = exports['0r-gps' ]:getChannelMembers()
for _, serverId in pairs (members) do
print (serverId)
end
Returns#
Type Description table Array of member server IDs
joinChannel#
Join a GPS channel.
lua Copy
local success = exports['0r-gps' ]:joinChannel(1 )
local success = exports['0r-gps' ]:joinChannel(1 , 'mypassword' )
Parameters#
Name Type Description channelId number Target channel/frequency ID password string? Optional channel password
Returns#
Type Description boolean Whether the join request succeeded
leaveChannel#
Leave the current GPS channel.
lua Copy
local success = exports['0r-gps' ]:leaveChannel()
Returns#
Type Description boolean Whether leaving succeeded
Useable Events#
Client
Event Purpose 0r-gps:client:toggleGPSOpen GPS UI (from usable item)
State bags#
Useful for other scripts that read player state:
Bag Values gpsStatusfoot, vehicle, boat, plane, motorcycle, bike, helicopter, deadgpsSirentrue / false — emergency lightsgpsPunishmenttrue when water punishment (coord punishment) is active