Jump to content

HELP| onPlayerQuit not Work


scolen

Recommended Posts

Why doesn't the vehicle destroy when the player disconnects ? 

marker = createMarker(2169.62500, -1983.23706, 13.55469, "cylinder", 1)
vehicles = {}

addEventHandler("onMarkerHit", marker, function(player)
    vehicles[player] = createVehicle(408, 2169.62500 + 3, -1983.23706, 13.55469)
end)

addEventHandler("onPlayerQuit", root, function(type)
   if (type == "Quit") then 
    destroyElement(vehicles[player])
   end
end)

 

Link to comment
marker = createMarker(2169.62500, -1983.23706, 13.55469, "cylinder", 1)
vehicles = {}

addEventHandler("onMarkerHit", marker, function(player)
    vehicles[player] = createVehicle(408, 2169.62500 + 3, -1983.23706, 13.55469)
end)

addEventHandler("onPlayerQuit", root, function(type)
   if (type == "Quit") then 
    destroyElement(vehicles[source]) --change player to source
   end
end)

 

  • Thanks 1
Link to comment
1 hour ago, Burak5312 said:
marker = createMarker(2169.62500, -1983.23706, 13.55469, "cylinder", 1)
vehicles = {}

addEventHandler("onMarkerHit", marker, function(player)
    vehicles[player] = createVehicle(408, 2169.62500 + 3, -1983.23706, 13.55469)
end)

addEventHandler("onPlayerQuit", root, function(type)
   if (type == "Quit") then 
    destroyElement(vehicles[source]) --change player to source
   end
end)

 

thanks bro ❤️

 

Link to comment

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...