-
-
Notifications
You must be signed in to change notification settings - Fork 747
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
Conversation
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
Please take a min to read this #343 |
thanks i edit 💖 |
There was a problem hiding this 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!
if VehicleData[playerId] then | ||
TriggerClientEvent('esx_lscustom:resetCustom', playerId, VehicleData[playerId].props) | ||
for index, value in ipairs(VehicleData) do |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
local vehicle = GetVehiclePedIsIn(playerPed, false) | ||
FreezeEntityPosition(vehicle, true) | ||
myCar = ESX.Game.GetVehicleProperties(vehicle) | ||
TriggerServerEvent('esx_lscustom:changeVehicleData', "add", {plate = GetVehicleNumberPlateText(vehicle), props = myCar}) |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
Hi,
I fix #289 bug
I add one table and some events for save first props of vehicle
if player disconnect reset that vehicle