mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-31 18:28:52 +00:00
Implemented plate generation from esx_migrate
This commit is contained in:
+13
-4
@@ -419,9 +419,13 @@ function OpenResellerMenu ()
|
||||
if closestPlayer == -1 or closestDistance > 3.0 then
|
||||
ESX.ShowNotification(_U('no_players'))
|
||||
else
|
||||
SetVehicleNumberPlateText(LastVehicles[#LastVehicles], string.upper(ESX.GetRandomString(8)))
|
||||
|
||||
local newPlate = GeneratePlate()
|
||||
local vehicleProps = ESX.Game.GetVehicleProperties(LastVehicles[#LastVehicles])
|
||||
local model = CurrentVehicleData.model
|
||||
vehicleProps.plate = newPlate
|
||||
SetVehicleNumberPlateText(LastVehicles[#LastVehicles], newPlate)
|
||||
|
||||
|
||||
TriggerServerEvent('esx_vehicleshop:sellVehicle', model)
|
||||
|
||||
@@ -441,10 +445,12 @@ function OpenResellerMenu ()
|
||||
ESX.ShowNotification(_U('no_players'))
|
||||
else
|
||||
ESX.TriggerServerCallback('esx:getOtherPlayerData', function (xPlayer)
|
||||
SetVehicleNumberPlateText(LastVehicles[#LastVehicles], string.upper(ESX.GetRandomString(8)))
|
||||
local newPlate = GeneratePlate()
|
||||
local vehicleProps = ESX.Game.GetVehicleProperties(LastVehicles[#LastVehicles])
|
||||
local model = CurrentVehicleData.model
|
||||
|
||||
vehicleProps.plate = newPlate
|
||||
SetVehicleNumberPlateText(LastVehicles[#LastVehicles], newPlate)
|
||||
|
||||
TriggerServerEvent('esx_vehicleshop:sellVehicle', model)
|
||||
|
||||
if Config.EnableSocietyOwnedVehicles then
|
||||
@@ -476,9 +482,12 @@ function OpenResellerMenu ()
|
||||
if closestPlayer == -1 or closestDistance > 5.0 then
|
||||
ESX.ShowNotification(_U('no_players'))
|
||||
else
|
||||
SetVehicleNumberPlateText(LastVehicles[#LastVehicles], 'RENT' .. string.upper(ESX.GetRandomString(4)))
|
||||
|
||||
local newPlate = 'RENT' .. string.upper(ESX.GetRandomString(4))
|
||||
local vehicleProps = ESX.Game.GetVehicleProperties(LastVehicles[#LastVehicles])
|
||||
local model = CurrentVehicleData.model
|
||||
vehicleProps.plate = newPlate
|
||||
SetVehicleNumberPlateText(LastVehicles[#LastVehicles], newPlate)
|
||||
|
||||
TriggerServerEvent('esx_vehicleshop:rentVehicle', model, vehicleProps.plate, GetPlayerName(closestPlayer), CurrentVehicleData.price, amount, GetPlayerServerId(closestPlayer))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user