Page cover

DRIVING SCHOOL

Fivem Driving School Script

Vehicle License Check Example

This command is used to check the vehicle license.

RegisterCommand('checklicense', function(src)
    TriggerEvent('checkLicense', src, 'driver', function(cb) end)
end)

The active license types are:

  • car

  • motor

  • drive_truck

  • air

  • boat

removelicense Command

This command is used to remove a license from a specific source.

RegisterCommand('removelicense', function(src)
    TriggerEvent('es:removeLicense', src, 'driver', function(cb) end)
end)
  • Description: The removelicense command takes the src source identifier and triggers the es:removeLicense event.

  • Usage: Use the /removelicense command to remove the driver license from a specific source.

addlicense Command

This command is used to add a license to a specific source.

  • Description: The addlicense command takes the src source identifier and triggers the es:addLicense event.

  • Usage: Use the /addlicense command to add the driver license to a specific source.

These lines of code represent the markers the car needs to go to and collect.

If you uncomment the lines, it indicates that the car needs to go to the markers listed in the table.

1. General Configuration

The general configuration section includes the framework settings, MySQL settings, and Discord token for integration.

2. Framework Integration Function

A function to integrate the script with different frameworks like ESX, NewESX, and QBCore.

3. Driving School Locations

Define the locations for your driving school, including coordinates, NPC details, markers, and blips.

4. License Position and Path

Define the positions and paths for each type of vehicle license, including vehicle model and time required for the test.

5. Blip Creation Function

A function to create blips on the map for each driving school location.

6. Discord Integration Functions

Functions for making HTTP requests to the Discord API to retrieve user avatars and other data.

Summary

This guide helps you configure a driving school in your FiveM server by providing detailed examples for general configuration, location setup, vehicle licenses, and Discord integration. Customize each section to fit your server's needs and integrate these configurations into your GitBook documentation for clear and comprehensive instructions for your users.

Last updated