Skip to Content
ReferenceStock Resource Setup

Start the provider that owns the behavior

Stock resources provide useful defaults, but a framework may replace them. A familiar event name does not guarantee that the provider is running or that a replacement implements the same contract. The official stock-resource directory  distinguishes platform resources from community resources and the marketplace.

Assign responsibility once

ProviderResponsibility and dependency boundary
spawnmanagerClient spawn points, explicit spawning and automatic respawn. Do not enable its autospawn alongside a framework’s competing character/spawn owner.
mapmanagerGametype/map selection and compatibility, with lifecycle events and map directives. It does not compile an MLO or replace asset authoring.
chatStock chat events, suggestions, templates and server hooks/modes. A custom chat can change that surface.
baseeventsReports events from its own client monitoring. Several vehicle reports arrive on the server and remain untrusted client reports.
sessionmanagerLegacy session lifecycle integration. Its events are not universal account-authentication hooks.
Loading screen resourceBrowser loading UI and its shutdown lifecycle, not an admission/allowlist authority.
txAdminAdministration and monitoring outside the role of an ordinary client gametype resource.

Declare actual dependencies in fxmanifest.lua. Start providers before their consumers and observe both client and server startup errors. Do not install two resources simply because both advertise the same feature. Use stock event contracts, spawnmanager exports, loading messages and chat exports for the separate APIs.

Mapmanager exports are server-side

The official mapmanager page  lists these seven exports. The correct resource spelling is mapmanager; the source’s mapmanger example is a typo. Use exports['mapmanager']:getCurrentMap() from a server script, after that provider has started.

ExportDocumented input and effect
getCurrentGameType()Return the currently selected gametype. Do not assume a nonempty selection before initialization.
getCurrentMap()Return the currently selected map.
changeGameType(gameType)Change gametype; the documented implementation stops an incompatible current map, stops the old gametype and starts the requested resource.
changeMap(map)Stop the current map if present, then start the requested map resource.
doesMapSupportGameType(gameType, map)Check registered gametype/map compatibility. Unknown entries fail; a map with no declared gametype restrictions is compatible in the documented implementation. Treat a false/nil result as not allowed.
getMaps()Return the provider’s registered map table. Its internal records are not an invitation for another resource to mutate provider state.
roundEnded()Schedule the provider’s round-end handling. The source implementation uses a 50 ms timeout; this is not a promise that an arbitrary game round immediately ends.

Selection-changing exports can stop and start resources. Never expose them through an unrestricted client network event. Validate the requested name against a server-owned set and require a deliberately scoped administrative permission. Check the resulting provider state and startup logs instead of assuming that an export call proves the requested resource started successfully.

Gametype and map metadata

A gametype is a resource that declares the appropriate resource_type metadata for mapmanager. A map declares its map role and any supported gametypes. Preserve the actual provider’s metadata format rather than inventing a new gameType manifest field or confusing game 'gta5' with a gametype selection.

The getMapDirectives event lets a provider register map directives with paired creation and deletion callbacks. Spawnmanager uses this mechanism to load declared spawn points and remove them when the map is torn down. Its independent loadSpawns export instead accepts a JSON string containing a spawns array; those are different input paths. See map-directive registration.

Client gametype/map start events are the appropriate points for consumer initialization. Stop events can run after the corresponding resource is gone, so avoid calling an export on the stopped provider. Always filter events to the resource or map your feature owns and clean up registered callbacks/state. See resource lifecycle.

Empty indexes and the resource template

The official resource-template page is explicitly a draft with placeholder headings for client/server exports and events. Several stock-resource functions or events index files contain no contracts beyond navigation. This guide supplies navigation to the documented providers; it does not manufacture exports from those empty headings.

For a new independent resource reference, document the provider/version, execution side, arguments, return values, prerequisites, teardown and one observable example. A method copied from another framework is not a stock API merely because its name looks plausible.

Acceptance checklist

Test a missing dependency, a stopped provider, an unsupported gametype/map pair, a normal map change, a provider restart and a consumer stopping independently. Confirm that a single system owns spawning, chat and world state after each transition. Host-side documentation tests can inventory exports and routes, but actual resource lifecycle dispatch must be exercised in the intended FXServer/client environment.