Skip to main content

Nord Inventory + Nord CarPlay

Objective

This integration uses the Nord Inventory carplay item to start the Nord CarPlay vehicle-installation flow without consuming the item before the installation is actually accepted.

Correct architecture

CarPlay begins as a client-side action because the player must be checked in the current vehicle/driver context and shown the installation progress. The final install is then validated by the CarPlay server.

For this flow, do not configure the item to start from a server-side UseCarplay export.

Admin Studio configuration

Open the carplay item and use:

Usable: On
Handler: External export
Resource name: nord_carplay
Export name: carplay
Execution side: Client
Remove on use: Off

The item should not be consumed on the first click.

Item definition

['carplay'] = {
 label = 'CarPlay',
 weight = 750,
 stack = false,
 close = true,
 useable = true,
 image = 'carplay.png',

 client = {
 export = 'carplay',
 remove = 0
 }
}

Nord CarPlay client export

exports('carplay', function(item, slot)
 TriggerEvent('nord_carplay:startCarplayInstall')
 return true
end)

Returning true explicitly is recommended. Nord treats an explicit false as a rejection and cancels the item use.

Installation flow

  1. Player selects Use on carplay.
  2. Nord validates the current item/slot and creates a pending use token.
  3. Nord calls nord_carplay:carplay on the client.
  4. CarPlay starts nord_carplay:startCarplayInstall.
  5. Client validates vehicle/driver context and runs the progress action.
  6. CarPlay requests the server-side installation (nord_carplay:installVehicleCarplay in the documented flow).
  7. CarPlay server validates the installation and removes the item only when the install succeeds.

Because Nord uses remove = 0, there is no double-removal or early consumption.

Runtime handler registration

If carplay already exists as a database-authoritative Nord item, RegisterItem may correctly return database_authoritative. The CarPlay resource can still register the handler:

exports['nord_inventory']:RegisterUseExport(
 'carplay',
 'carplay',
 'client'
)

The bare export name is automatically bound to the calling resource (nord_carplay).

Explicit form:

exports['nord_inventory']:RegisterUseExport(
 'carplay',
 'nord_carplay',
 'carplay',
 'client'
)

Why the old server handler fails

Problem configuration:

server = {
 export = 'UseCarplay',
 remove = 0
}

or Admin Studio:

Resource name: nord_carplay
Export name: UseCarplay
Execution side: Server

This asks Nord to execute a server handler as the item-use action. That is the wrong entry point for a flow that needs current client vehicle/driver/progress behavior first.

If that export returns false, Nord shows:

External export nord_carplay:UseCarplay rejected the item use.

Invalid inventory request.

If this appears during CarPlay use:

  1. verify the item still uses carplay on Client;
  2. verify Nord Inventory is a complete current build, not a partial/mixed update;
  3. verify nord_carplay starts after nord_inventory;
  4. restart both resources after changing the item handler;
  5. inspect the first server/client console error.

Item image

The active Nord Inventory image must resolve as:

image = 'carplay.png'

and the installed file should exist in Nord Inventory's item image directory:

nord_inventory/web/images/items/carplay.png

If Nord CarPlay ships an installer payload such as:

nord_carplay/install/nord_inventory/carplay.png

that file must be copied/installed into the Nord Inventory image directory before runtime display.

Restart order

restart nord_inventory
restart nord_carplay

On full server startup:

ensure nord_inventory
ensure nord_carplay

Checklist

  • carplay item exists and is enabled.
  • Image name is exactly carplay.png.
  • Handler is External export.
  • Resource is nord_carplay.
  • Export is carplay.
  • Execution side is Client.
  • Nord removal is disabled (remove = 0).
  • Client export starts the installation event.
  • Client export does not explicitly return false on accepted use.
  • CarPlay server owns final validation and final item removal.
  • Nord Inventory starts before Nord CarPlay.