TorNix~|nR Posted December 17, 2017 Share Posted December 17, 2017 (edited) Hello guys, I made this script, but when a player wasted or quit, it doesn't destroy ? help please? mark = createMarker( -2066.05, 1430.57, 6.10, "cylinder", 2, 120, 62, 62, 150 ) local vehicles99ui = {} function fun(hitPlayer) local x, y, z = getElementPosition(source) if hitPlayer and getElementType(hitPlayer) == "player" and not isPedInVehicle (hitPlayer) then if ( getPlayerTeam ( hitPlayer ) == getTeamFromName ( "L.K.S" ) ) then if isElement(vehicles99ui) then destroyElement(vehicles99ui) end vehicles99ui = createVehicle(461, -2088.01, 1369.97, 6.10) setVehicleColor (vehicles99ui, 120, 62, 62, 120, 62, 62) warpPedIntoVehicle(hitPlayer, vehicles99ui) else outputChatBox ("",hitPlayer, 120, 62, 62, true) end end end addEventHandler("onMarkerHit",mark,fun) addEventHandler("onPlayerQuit", root, function() if isElement(vehicles99ui) then destroyElement(vehicles99ui) vehicles99ui = nil end end) addEventHandler("onPlayerWasted", root, function() if isElement(vehicles99ui) then destroyElement(vehicles99ui) vehicles99ui = nil end end) Edited December 17, 2017 by TorNix~|nR Link to comment
Dimos7 Posted December 17, 2017 Share Posted December 17, 2017 Vehicles99ui is a table Asus you have made it try to remove where you defind it as table 1 Link to comment
TorNix~|nR Posted December 17, 2017 Author Share Posted December 17, 2017 Thanks, but can you help me more? Link to comment
Dimos7 Posted December 17, 2017 Share Posted December 17, 2017 Try remove 2 line and see if work if not /debugscipt 3 and post the errors or warnings 1 Link to comment
TorNix~|nR Posted December 17, 2017 Author Share Posted December 17, 2017 Oww, it's working, thank you so much 1 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now