🕵️‍♂️Usage

How players actually interact with the script in-game

  • Finding a Shop

    • Each shop can have an NPC and/or marker. Upon entering the marker’s range (often 2–3 meters), a help text (pressE) appears if the player has the correct job or if the shop is for everyone ("all").

    • Pressing E opens the shop UI (NUI).

  • Browsing & Previewing

    • The UI lists categories—some restricted by rank (gradeRange). Players click a category and a vehicle.

    • The script spawns a preview vehicle at previewCoords.

    • A camera at cameraCoords with adjustable zoom or rotation is used for an immersive preview experience.

  • Test Driving

    • Players can start a test drive, which spawns them in the chosen vehicle at testDriveCoords.

    • A countdown timer in the UI appears. If the timer runs out or they leave the vehicle, the script returns them to returnCoords.

    • The test drive vehicle is deleted afterward.

  • Purchasing

    • Once a player confirms purchase, the script checks if they have enough money (cash/bank) in ESX or QBCore.

    • If successful, a new record is inserted into the database (if SaveVehicleToDatabase=true).

    • The script optionally spawns the purchased vehicle at purchaseSpawnCoords, sets a plate, and puts the player inside it.

  • Job & Rank Restriction

    • If the player’s job is not in the jobs table or their job grade is below gradeRange[1] or above gradeRange[2], the script denies access.

    • They receive a “notAllowed” or “rankTooLow” message, according to your locale.

  • Vehicle Stats

    • The script calculates approximate top speed, weight, braking, seat count, and displays them in a progress bar format in the UI.

    • Electric vehicles (if isElectric = true or automatically detected by zero tank volume) display as “Electric.”

Last updated