[FREE] Custom License Plate | Clean UI

[FREE] Custom License Plate

Features

  • When the plate is changed, the data is instantly and automatically updated.
  • Does not accept plates with fewer than 5 characters (Max is 8).
  • Plates already used on other vehicles cannot be reused.
  • Simple UI system.

:arrow_forward: Showcase Video :arrow_forward:
:arrow_down: Free Github Download :arrow_down:

Code is accessible Yes
Support No
5 Likes

nice work bro

1 Like

Looks so clean. Beautiful

1 Like

Thanks mate :grinning:

You are great :relieved:

Great Work !
Nice and Clean
Love From MJ DEVELOPMENT :white_heart:

1 Like

thanks :grinning:

Esx bro you’ll be thanked indefinitely

1 Like

Can you add your car keys event? Because I don’t know what you are using

Replace server.lua with the following code;

RegisterServerEvent("customplates:buyPlate", function(newPlate, oldPlate)
    local src = source
    local cost = 1000

    if not newPlate or #newPlate < 5 or #newPlate > 8 or not newPlate:match("^[A-Z0-9]+$") then
        TriggerClientEvent('esx:showNotification', src, 'The plate is invalid.', 'error', 5000)
        return
    end

    local exists = MySQL.scalar.await("SELECT 1 FROM owned_vehicles WHERE plate = ?", { newPlate })
    if exists then
        TriggerClientEvent('esx:showNotification', src, 'This plate is already in use.', 'error', 5000)
        return
    end

    MySQL.update.await("UPDATE owned_vehicles SET plate = ? WHERE plate = ?", {
        newPlate, oldPlate
    })

    TriggerClientEvent('esx:showNotification', src, 'License plate replaced successfully!', 'success', 5000)
    TriggerClientEvent("customplates:updateVehiclePlate", src, newPlate)
    TriggerClientEvent("customplates:closeUI", src)
end)