Hello there fellas.

I grabbed the open supply of This ESX Release and rewrote it to match QBCore framework.

All prizes should be configured by hand and a few customized code should be added into the qb-vehicleshop (look beneath for this code).

The automobile spawned contained in the on line casino and outlined within the luckywheel-script is the automobile qb-vehicleshop provides out while you win a automobile.

Obtain: Github

Set up:

Add to: qb-vehicleshopclient.lua

RegisterNetEvent('qb-vehicleshop:shopper:winCar', operate (carname)
	native car = QBCore.Features.GetClosestVehicle(vector3(935.01, 42.80, 72.43))
	native showCar = carname
	TriggerServerEvent('qb-vehicleshop:server:luckywheelWin', car, showCar)
finish)

RegisterNetEvent('qb-vehicleshop:shopper:winLuckyWheelVehicle', operate(car, plate)
    QBCore.Features.SpawnVehicle(carmodel, operate(veh)
        TaskWarpPedIntoVehicle(PlayerPedId(), veh, -1)
        exports['LegacyFuel']:SetFuel(veh, 100)
        SetVehicleNumberPlateText(veh, plate)
        SetEntityHeading(veh, Config.LuckyWheel.w)
        SetEntityAsMissionEntity(veh, true, true)
        TriggerEvent("vehiclekeys:shopper:SetOwner", QBCore.Features.GetPlate(veh))
        TriggerServerEvent("qb-vehicletuning:server:SaveVehicleProps", QBCore.Features.GetVehicleProperties(veh))
    finish, Config.LuckyWheel, true)
finish)

Add to: qb-vehicleshopserver.lua

-- Win automobile at luckywheel
RegisterNetEvent('qb-vehicleshop:server:luckywheelWin', operate(information, carname)
    native src = supply
    native Participant = QBCore.Features.GetPlayer(src)
	native PlayerData = Participant.PlayerData
	native car = information
	native showCar = carname
	
	
    native plate = GeneratePlate()
    MySQL.Async.insert('INSERT INTO player_vehicles (license, citizenid, car, hash, mods, plate, state, storage) VALUES (?, ?, ?, ?, ?, ?, ?, ?)', {
        PlayerData.license,
        PlayerData.citizenid,
        carname,
        GetHashKey(car),
        '{}',
        plate,
        1,
		'casinovalet'
    })
    TriggerClientEvent('qb-vehicleshop:shopper:winLuckyWheelVehicle', src, car, plate)
    TriggerClientEvent('QBCore:Notify', src, 'Congratulations! Your car could be claimed on the valet close to the doorway.', 'success')
finish)

Add a brand new storage named ‘casinovalet’ or change ‘casinovalet’ to your storage of alternative.

Greatest regards, Revoxxi.



Looking for paid scripts? Click here