[ESX/QB] Plate Flipper

A script for enhancing criminal roleplay for people who race around in their cars. If you install a plate flipper, you can mask your plate by pressing a hotkey which is configurable. You can set jobs which can install the plate flipper using the item.

Note: This script replaces the North Yankton number plate with black texture.

Preview

Exports (if you would like to integrate the script with your radar script…)

isPlateHidden(vehicle) - Returns if the plate is hidden.

Requirements

  • ox_lib
  • oxmysql
  • onesync

Download

10 Likes

Nice one !!!

:fire::fire::fire: ayyy

As a car enthusiast i love it, and as it is open source it is :fire: Keep up the work :slight_smile:

Hello! I have a problem! But i dont understand what is it! I use OX_inventory
I use your awesom script and i get this problem.
Can you help me how can i fix it?! Thanks for advance

[script:no1-plateflip] SCRIPT ERROR: @no1-plateflipper/server.lua:9: no1-plateflipper was unable to execute a query!
[script:no1-plateflip] Query: SELECT flipper_installed FROM player_vehicles WHERE plate = ?
[script:no1-plateflip] [“N401288V”]
[script:no1-plateflip] Table ‘esxlegacy_070653.player_vehicles’ doesn’t exist
[script:no1-plateflip] > callbackResponse (@ox_lib/imports/callback/server.lua:60)
[script:no1-plateflip] > handler (@ox_lib/imports/callback/server.lua:76)
[script:no1-plateflip] > logError (@oxmysql/dist/build.js:26282)
[script:no1-plateflip] > rawQuery (@oxmysql/dist/build.js:26458)
[script:no1-plateflip] > runMicrotasks (:0)
[script:no1-plateflip] > processTicksAndRejections (node:internal/process/task_queues:96)
[script:no1-plateflip]

Had some typo’s in the script and the SQL. Redownload the script, import the SQL and try again and let me know. It should be fixed :+1:.

Hello its workin now but didnt change the plate!

Please make sure to properly license your work.

1 Like

What do you mean? I own this car in garage! I use Lunar_garage! If i didnt good undestood you please told me

Sorry, that was meant for the poster of this topic.

:fire: @playerno1 well done

1 Like

what this mean

SCRIPT ERROR: @no1-plateflipper/server.lua:69: attempt to call a nil value (global ‘RemoveItem’)

Once you install it, you have to get into the car and press “J” - default keybind to swtich the plate.

Check if you use qb-inventory or ox_inventory since they are the only inventory supported at this moment.

1 Like

Oh, I’m using ps-inventory. Is there a way I can edit the script to work with it? It’s basically a reskin of qb, but a bit outdated.

I’ve added the following code in the inventorys folder as a new file without replacing anything:

if GetResourceState("ps-inventory") ~= "started" then 
    return 
end

function RemoveItem(source, item, amount)
    return exports['ps-inventory']:RemoveItem(source, item, amount)
end

function AddItem(source, item, amount)
    return exports['ps-inventory']:AddItem(source, item, amount)
end

It doesn’t give any errors, but it doesn’t take the flipper from me or let me use ‘J’ to use it. Is there anything I need to edit or update in the main files?

UPDATE: nvm lol i got it working i also made it so in the config there is a true/false if you want it to use jobs or not

Just replace the Job Check Function in server.lua with

function HasWhitelistedJob(playerId)
    local jobName = GetPlayerJob(playerId)
    local hasJob = false
    
    if Config.UseJobs then
        for _, job in pairs(Config.JobsAllowed) do
            if job == jobName then
                hasJob = true
                break
            end
        end
    else
        -- If UseJobs is false, allow any job
        hasJob = true
    end
    
    return hasJob
end

and add Config.UseJobs = true to the config

Thanks to your idea. I implemented it and pushed a new update.

v1.0.2

  • Added ps-inventory, lj-inventory compatible for drag n drop since they both use qb-inventory exports.
  • Added Config.UseJobCheck (thanks to idea of 0x00sec1).
  • Added item added /removed box event for qb-inventory and others.

Great script, Only issue is trying to ad the WK Wars2x integration, i put the code that’s suppose to replace the standard and this error pops up into F8 console