isa_Khamdan Posted August 14, 2013 Share Posted August 14, 2013 Hello , is it possible to check if the vehicle is DamageProof or not? Link to comment
tosfera Posted August 14, 2013 Share Posted August 14, 2013 Yes it is. https://wiki.multitheftauto.com/wiki/Is ... amageProof Link to comment
isa_Khamdan Posted August 14, 2013 Author Share Posted August 14, 2013 Yes it is.https://wiki.multitheftauto.com/wiki/Is ... amageProof Thanks a lot , else is it possible to destroy attached element from another resource? for example I have a resource that attach element to the player vehicle , and I have another resource and I want it to check if the element is attached and if yes then destroy it so is that possible? Link to comment
tosfera Posted August 14, 2013 Share Posted August 14, 2013 Thats also possible, using the isElementAttached function you can see if an element is attached. Link to comment
isa_Khamdan Posted August 14, 2013 Author Share Posted August 14, 2013 Thats also possible, using the isElementAttached function you can see if an element is attached. That's the code ( it's in another resource ) so how can I check if this element is attached and if yes destroy it? ( check from another resource ) local x, y, z = getElementPosition ( Vehicle ) marker = createObject ( 1318, x, y, z + 2, 0, 0, 0 ) attachElements ( marker, Vehicle, 0, 0, 2 ) Link to comment
tosfera Posted August 14, 2013 Share Posted August 14, 2013 Ehmm... I think you should add data to the marker and get all the elements in a radius of 10. Then detach it. Link to comment
isa_Khamdan Posted August 14, 2013 Author Share Posted August 14, 2013 Ehmm... I think you should add data to the marker and get all the elements in a radius of 10. Then detach it. so if I set elementdata to the marker I can access it from another resource? Link to comment
tosfera Posted August 14, 2013 Share Posted August 14, 2013 Well if you set data to it, you can retrieve different elements in an area and see if it has the data you're looking for. There might be another way but I'm not sure what way. Link to comment
isa_Khamdan Posted August 14, 2013 Author Share Posted August 14, 2013 Well if you set data to it, you can retrieve different elements in an area and see if it has the data you're looking for. There might be another way but I'm not sure what way. Okay thanks , can you help me to make this function work when you type a command " start " and when you type it again it will stop. addEventHandler("onVehicleEnter", Nexus1, function(thePlayer, seat) if seat == 0 then timers[thePlayer] = setTimer(D5, 1000, 0, source, thePlayer) end end ) and if the command is used these two functions will start be enabled addEventHandler("onVehicleExit", Nexus1, function(thePlayer, seat) if seat == 0 then if isTimer(timers[source]) then killTimer(timers[source]) timers[source] = nil if isElement(objects[source]) then destroyElement(objects[source]) objects[source] = nil end end end end ) addEventHandler("onPlayerQuit", root, function() if isTimer(timers[source]) then killTimer(timers[source]) timers[source] = nil if isElement(objects[source]) then destroyElement(objects[source]) objects[source] = nil end end end ) Link to comment
tosfera Posted August 14, 2013 Share Posted August 14, 2013 try this; addCommandHandler("start", function(thePlayer, command) local v = getPedOccupiedVehicle( thePlayer ) if ( v ) then seat = getPedOccupiedVehicleSeat( thePlayer ) if ( seat == 0 ) then if isTimer(timers[source]) then killTimer(timers[source]) timers[source] = nil if isElement(objects[source]) then destroyElement(objects[source]) objects[source] = nil end else timers[thePlayer] = setTimer( D5, 1000, 0, source, thePlayer ) end end else outputChatBox("You've to be in a vehicle to do this!", thePlayer ); end end ); 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