Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(esx_lscustom/client/main.lua): fixed lscustom glitch #379

Closed
wants to merge 2 commits into from
Closed

fix(esx_lscustom/client/main.lua): fixed lscustom glitch #379

wants to merge 2 commits into from

Conversation

AmirrezaJaberi
Copy link

Hi,
I fix #289 bug
I add one table and some events for save first props of vehicle
if player disconnect reset that vehicle

Add This Events :
esx_lscustom:changeVehicleData
esx_lscustom:resetCustom
I Add :
VehicleData table for save vehicle data .
esx_lscustom:changeVehicleData for change status of vehicle data
&
I use esx:playerDropped for anti glitch
@Benzo00
Copy link
Contributor

Benzo00 commented Aug 7, 2022

Please take a min to read this #343

@AmirrezaJaberi AmirrezaJaberi changed the title Fix lscustom glitch fix(esx_lscustom/client/main.lua): fixed lscustom glitch Aug 7, 2022
@AmirrezaJaberi
Copy link
Author

Please take a min to read this #343

thanks i edit 💖

Copy link

@mahanmoulaei mahanmoulaei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't tested your pull request myself, but I showed you the changes you can make to avoid the unneeded loops on the server.

Also, I removed the plate check since I believe it's unnecessary to check!

[esx_addons]/esx_lscustom/server/main.lua Show resolved Hide resolved
if VehicleData[playerId] then
TriggerClientEvent('esx_lscustom:resetCustom', playerId, VehicleData[playerId].props)
for index, value in ipairs(VehicleData) do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can replace the loop with :

VehicleData[playerId] = nil

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again maybe use multi vehicles

[esx_addons]/esx_lscustom/server/main.lua Show resolved Hide resolved
local vehicle = GetVehiclePedIsIn(playerPed, false)
FreezeEntityPosition(vehicle, true)
myCar = ESX.Game.GetVehicleProperties(vehicle)
TriggerServerEvent('esx_lscustom:changeVehicleData', "add", {plate = GetVehicleNumberPlateText(vehicle), props = myCar})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can replace this line with :

TriggerServerEvent('esx_lscustom:changeVehicleData', "add", myCar)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some people use space plate in esx_vehicleshop, in code we need format that to send it to server side

Config.PlateLetters  = 3
Config.PlateNumbers  = 3
Config.PlateUseSpace = true

[esx_addons]/esx_lscustom/client/main.lua Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug (esx_lscustom): free tuning glitch
3 participants