You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently, when nitro in a vehicle is activated (by button or by setVehicleNitroActivated function), this information is synchronized to other players. However, the moment we call setVehicleNitroActivated(vehicle, false) in the driver (which is syncer) - nitro will be disabled only for the driver (as localPlayer which executed this function), for other players it will still be active and cause a lot of desynchronization (acceleration is greater than on syncer side).
Describe the solution you'd like
Synchronize the status of nitro according to the current status of syncer (driver).
Describe alternatives you've considered
Currently, you have to work around this with a script, e.g. manually synchronizing nitro state (mainly off, as on by key is synced correctly) - driver -> server -> players nearby
Additional context
The problem mainly relates to the implementation of nitro on the button - hold = on, release = off. Sample script code that turns off the nitro when you release the button:
function toggleNOS(btn, state)
local veh = getPedOccupiedVehicle(localPlayer)
if veh and getVehicleController(veh) == localPlayer then
if isVehicleNitroActivated(veh) then
setVehicleNitroActivated (veh, false) -- <- This should be synced with nearby players, as it is when we set it to true.
end
end
end
bindKey("vehicle_fire", "up", toggleNOS)
Security Policy
I have read and understood the Security Policy and this issue is not about a cheat or security vulnerability.
The text was updated successfully, but these errors were encountered:
@Proxy-99 Thank you for your contribution, but I don't think this is a good solution (#3706) to this issue. It is useful in some cases, but not necessarily in the one I reported.
Why? Your solution has 2 drawbacks:
It requires serverside, while the state of vehicles and nitro are synchronized from clientside
Such information is sent to all players on the server, which is a waste of cpu/bandwith (why player A on dim 1 need to know that vehicle on dim 900 has the nitro activated/deactivated?)
My suggestion was to improve the synchronization packets so that it works like turning on nitro on clientside.
Pressing LPM to turn on nitro -> sends packet to nearby players about active nitro in car
Depressing LPM to disable nitro (nitro is turned off clientside via setVehicleNitroActivated) -> sends an analogous packet to players nearby with disabled nitro status in the car.
Currently, the logic in the MTA only works halfway - a packet is sent about the activation of nitro, but not about its deactivation.
Is your feature request related to a problem? Please describe.
Currently, when nitro in a vehicle is activated (by button or by setVehicleNitroActivated function), this information is synchronized to other players. However, the moment we call setVehicleNitroActivated(vehicle, false) in the driver (which is syncer) - nitro will be disabled only for the driver (as localPlayer which executed this function), for other players it will still be active and cause a lot of desynchronization (acceleration is greater than on syncer side).
Describe the solution you'd like
Synchronize the status of nitro according to the current status of syncer (driver).
Describe alternatives you've considered
Currently, you have to work around this with a script, e.g. manually synchronizing nitro state (mainly off, as on by key is synced correctly) - driver -> server -> players nearby
Additional context
The problem mainly relates to the implementation of nitro on the button - hold = on, release = off. Sample script code that turns off the nitro when you release the button:
function toggleNOS(btn, state)
local veh = getPedOccupiedVehicle(localPlayer)
if veh and getVehicleController(veh) == localPlayer then
if isVehicleNitroActivated(veh) then
setVehicleNitroActivated (veh, false) -- <- This should be synced with nearby players, as it is when we set it to true.
end
end
end
bindKey("vehicle_fire", "up", toggleNOS)
Security Policy
The text was updated successfully, but these errors were encountered: