hi, it’s possible to add baseSQL to save customcar with my personalvehicle plz ?
it’s when someone disconnect or crash into LSC.
And is there any way to prevent this from happening? As with a lot of people using it, it happens quite often someone leaves or disconnects while in it.
If someone disconnects in there, does their car stay inside or does it get removed when they leave?
Can’t tell, im using Scammer’s Scorpion trainer which automaticly removes vehicles that are out of range.
Well assuming the car gets deleted by the script or the trainer, this should check if there is a car inside every time someone disconnects and unlock it if there is no car inside. Haven’t tested it though.
local insideSpots = { {-337.3863, -136.9247, 38.5737}, {-1155.536, -2007.183, 12.744}, {731.8163, -1088.822, 21.733}, {1175.04, 2640.216, 37.32177} }
AddEventHandler('playerDropped', function()
for i=1, 4, 1 do
if IsAnyVehicleNearPoint(insideSpots[i][1], insideSpots[i][2], insideSpots[i][3], 5.0) == false then
TriggerEvent('lockGarage', false, i)
end
end
end)
Just add this inside the lscustoms_server
Thanks for this, will give it a try and post soon if this solved the problem.
It caused errors, and the vehicle shop stopped working. /pv didn’t work anymore either
Okay I tested it and believe I have fixed it now. @Refuser
Add this to the server code
AddEventHandler('playerDropped', function()
TriggerClientEvent('checkGarages', -1)
end)
And add this to the client code
RegisterNetEvent('checkGarages')
AddEventHandler('checkGarages', function()
for i,pos in ipairs(lsc.locations) do
if IsAnyVehicleNearPoint(pos.inside.x, pos.inside.y, pos.inside.z, 5.0) == false then
TriggerServerEvent('lockGarage', false, i)
end
end
end)
In theory, when a player leaves, it should trigger the other clients playing to check if there is a car inside LSC, if there is not, then it will set the garage to be unlocked.
Hey guys!
First, thanks to you Cosmo for your little fix
But I have another problem with the script.
When I try to modify the costs of the ‘Black’ color for example in the lscustoms.lua and if I go to Los Santos Custom in game and I choose this color to my car, the menu disappear and I’m stuck in the LSCustom !
Moreover, I don’t see the change of price that i entered before!
I don’t know what to do, I tried everything.
Thanks to all of you!
Thanks a lot for this, it no longer gets locked when someone disconnects inside. But multiple people can enter it at once now, but I’m ok with that aslong as it keeps functioning.
Hi,
Can you help me, i want delete the repair menu, just allow custom
Thanks for script, and for any help
Hello i have a problem with this script, i change the price on cost example cost = 0 i change this cost by cost = 100 and i save my file, i restart my server and i go to the ls custom and nothing, please i need help , thanks.
To fix cost Bug in drawMenuCost function :
local text = tostring(button.costs)
AddTextComponentString(text)
Ok thanks, but you do not explain where to add it ^^
in drawMenuCost function
replace this
AddTextComponentString(button.costs)
by
local text = tostring(button.costs)
AddTextComponentString(text)
@Cosmo can you check how we can removeMoney from this script.
Because I try this and it doesn’t work
if button.name == "Repair vehicle" then
SetVehicleFixed(car)
OpenMenu('main')
-- Add Costs
SendNUIMessage({
removecash = true,
money = button.costs
})
local user = GetPlayerPed(-1)
user:removeMoney(button.costs)
end
i want delete the repair menu, can you help me ?
Hi this ls custom isvery well done but is there a way to save customizations?
This works, but it creates massive lag spikes when someone leaves for everyone else. Took me a while to figure out what was causing it. Guess there is no other way to fix the problem with it locking?