Knowledge from the fieldRedM

GetResourceState returns one of {missing, stopped, starting, started} — bare == 'started' races boot order

learning:75

GetResourceState returns one of {missing, stopped, starting, started} — bare == 'started' races boot order

Context

GET_RESOURCE_STATE (0x4039B485) returns a fixed set of state strings. Detecting whether another resource (e.g. a framework) is present with only == "started" misfires during the boot window.

The vocabulary (from jo_libs framework auto-detection)

  • "missing" / "stopped" → treat as absent.
  • "starting" / "started" → treat as present (a resource mid-boot is "starting", not yet "started").
-- present-when-forbidden check:
if GetResourceState(r) == "starting" or GetResourceState(r) == "started" then ... end
-- absent check:
if GetResourceState(r) == "missing" or GetResourceState(r) == "stopped" then ... end
-- gate until fully up:
while GetResourceState(r) ~= "started" do Wait(1000) end

Trap

A resource that exists but hasn't finished starting returns "starting". Code that only checks == "started" at load time will wrongly conclude it's absent because of boot-order races.

Verified

framework-bridge/shared.lua:119,124,193.


Tags: cfx, getresourcestate, resource, framework-detection, boot-order, return-values
Category: natives
Source: jo_libs-fleet
Created: 2026-05-31T09:43:48.167Z

Back to documentation