dener189 Posted August 2, 2019 Share Posted August 2, 2019 This script aims to spawn the vehicle after you get what you want. But I was wondering why you are giving this error, and I was wondering if there was a way for the vehicle to disappear after a second out of it? Server markers = { { 1175.854, -1308.407, 13}, --Hospital LS { -2650.922, 585.387, 13.453}, --Hospital SF { 1624.4620361328, 1818.3846435547, 9.8203125}, --Hospital LV { 1539.487, -1656.687, 12.547}, --DP LS { -1581.739, 651.289, 6.188}, --DP SF { 2256.035, 2477.413, 9.82}, --DP LV } for i,v in ipairs (markers) do marker = createMarker(v[1], v[2], v[3], "cylinder", get("markerSize"), get("markerColorR"), get("markerColorG"), get("markerColorB"), get("markerAlpha")) end veh = {} addEvent ("getCar", true) addEventHandler ("getCar", getRootElement(), function(car) if veh[source] and isElement( veh[source] ) then destroyElement( veh[source] ) veh[source] = nil end local carID = getVehicleModelFromName (car) local x,y,z = getElementPosition(source) local carName = getVehicleNameFromModel (carID) veh[source] = createVehicle(carID, x,y,z) setVehicleColor(veh[source], 255, 255, 255) warpPedIntoVehicle(source, veh[source]) end ) addEventHandler ( "onPlayerQuit", getRootElement(), function () if veh[source] and isElement( veh[source] ) then destroyElement( veh[source] ) veh[source] = nil end end) function markerHit (hitPlayer, matchingDimension) if isPedInVehicle (hitPlayer) then return end if getElementType(hitPlayer) == "player" then triggerClientEvent ("openMean", hitPlayer) end end addEventHandler ("onMarkerHit", resourceRoot, markerHit) function markerLeave (hitPlayer, matchingDimension) if getElementType(hitPlayer) == "player" then triggerClientEvent ("closeOpenMean", hitPlayer) end end addEventHandler ("onMarkerLeave", resourceRoot, markerLeave) Link to comment
DNL291 Posted August 2, 2019 Share Posted August 2, 2019 onVehicleExit; setTimer; destroyElement (if I understood correctly what you meant). Type /debugscript 3 to see if it shows any erros. @dener189 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