Jump to content

releasing vehicle parts


Fabioxps

Recommended Posts

Posted
Switch it off with /stop

what???

I want to know the reason of the problem

He mean, do /stop resourcename in the console

I want to know what causes this bug

  • Moderators
Posted

The reason behind losing the vehicle parts:

The server syncs the vehicle as blown. But for the owner/syncer of the vehicle it isn't blown.

The syncer is sending to the server that the vehicle is still operating, which is divided over the players.

But the server is also saying that it has been blown... so fixed > blow > fixed > blow etc.

This is a synchronization bug, I haven't found out why it is happening.

But it might have something to do with freezing a vehicle at serverside.

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted (edited)
The reason behind losing the vehicle parts:

The server syncs the vehicle as blown. But for the owner/syncer of the vehicle it isn't blown.

The syncer is sending to the server that the vehicle is still operating, which is divided over the players.

But the server is also saying that it has been blown... so fixed > blow > fixed > blow etc.

This is a synchronization bug, I haven't found out why it is happening.

But it might have something to do with freezing a vehicle at serverside.

I am destroying and creating other vehicles when the map carries.

It has some way to alleviate this problem?

my code

        local vehicle = getElementData(player,"vehicle") 
        if isElement(vehicle) then 
                    destroyElement(vehicle) 
                    setElementData(player,"vehicle",false) 
        end 
        if not vehicle or not isElement(vehicle) then 
        vehicle = createVehicle(411,0,0,0,0,0,0) 
end 
  

Edited by Guest
  • Moderators
Posted

If you really want to fix this by lua, you can use: https://wiki.multitheftauto.com/wiki/OnVehicleExplode

to check the daily between the explosions. When a vehicle is exploding more than 3 times per 300 ms, you recreate the vehicle. But make sure this is not a vehicle from the race resource.

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted

I recall there's a way to reproduce it. One of the communities I used to play with had a ghost car script for their DM server, and if you ran a command that blows up all cars during countdown(race gamemode) this would happen to the ghost car - but not the players.

If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...