Information

3. Information

This page explains the overall operation of the script, its usage scenarios, and in-SHOP interactions.


Operation and Interaction

Shop Interaction

  • Shop Markers: When players approach the shop markers defined in Config.Shops (within a 20-meter radius), a marker and a help notification appear on the screen.

  • NUI Interface: When a player gets within 2 meters, pressing the "E" key opens the NUI interface, displaying the product list.

Market Interaction

  • Market Points: As you approach the market locations defined in Config.Markets (within 2.5 meters), an interaction prompt is displayed.

  • Heading Adjustment: When the interaction key (e.g., "E") is pressed, if the market coordinates include a heading (w value), the player's direction is adjusted accordingly.

  • Market Interface: The market interface is then opened via the OpenMarket function.


Marker, NUI, and Blip Operations

Marker Drawing

  • In-game interaction points are highlighted using the DrawMarker and DrawText3D functions.

NUI Interface

  • The toggleField function is used to enable or disable NUI focus.

  • The product list is sent to the NUI using the addItem function.

Blip Settings

  • Blips are created on the map for both shop and market locations.

  • Blip sprite, color, and scale are configured in the config file.


Additional Information

Framework Integration

  • The script automatically retrieves the corresponding framework object (ESX or QBCore) based on the selected framework in the configuration.

Interaction Keys

  • The "E" key is used for general interactions.

  • The interaction key can be dynamically configured via Config.MarketKey.

Troubleshooting

  • Ensure that the tables in your configuration (i.e., Config.Shops, Config.Markets, Config.Items) are correctly defined.

  • Restarting the server (with a cleared cache) can help reduce potential errors.

Last updated