zombienation Posted December 27, 2011 Share Posted December 27, 2011 hello, i have noticed in a script from mta community site, script name carmission, that when the mission is done, the marker locations stays on the map as map icons that showed up after you start the mission, i'll copy the script underneath, can anybody show me how to set it up so that when the player has bin in the marker at the map icon that the map icon go away again untill an other player choose to do the mission? marker1 = createMarker (60,-240,0.5,"cylinder",1.2,255,0,0,255) blip1 = createBlip ( 60,-240,0, 26 ) marker2 = createMarker (-215,-287,0.5,"cylinder",1.2,255,0,0,0) marker3 = createMarker (-493,-554,24.5,"cylinder",1.2,255,0,0,0) marker4 = createMarker (-578,-1056,22.5,"cylinder",1.2,255,0,0,0) car = createVehicle(480,53,-239,2) function part1 (player) outputChatBox("#ffffff|--------------------------------------------------------|",root,255,255,255,true) outputChatBox("#ffffff| #ff0000* You have accepted the Mission! #ffffff|",root,255,255,255,true) outputChatBox("#ffffff| #ff0000* Don't blow up the barrels! #ffffff|",root,255,255,255,true) outputChatBox("#ffffff| #ff0000* Script Made by Try-Maria! #ffffff|",root,255,255,255,true) outputChatBox("#ffffff|--------------------------------------------------------|",root,255,255,255,true) blip2 = createBlip ( -215,-287,0, 19 ) setMarkerColor ( marker2, 255, 0, 0, 255 ) end addEventHandler( "onMarkerHit", marker1, part1 ) function part2 (player) outputChatBox("#ffffff[bot]Duk: #ff0000Please don't blow up the barrels!",root,255,255,255,true) blip3 = createBlip ( -493,-554,0, 19 ) setMarkerColor ( marker3, 255, 0, 0, 255 ) setMarkerColor (marker2, 255,0,0,0) destroyElement(blip2) end addEventHandler( "onMarkerHit", marker2, part2 ) function part3 (player) outputChatBox("#ffffff[bot]Jeff: #ff0000Omg wrong way! Its not here continue and you will found!",root,255,255,255,true) blip4 = createBlip ( -578,-1056,0, 19 ) setMarkerColor ( marker4, 255, 0, 0, 255 ) setMarkerColor (marker3,255,0,0,0) destroyElement(blip3) end addEventHandler( "onMarkerHit", marker3, part3 ) function part4 (player) outputChatBox("#ffffff[bot]Not: #ff0000Ah! You are here! Thanks for help! Here is your paiment!",root,255,255,255,true) destroyElement ( car ) givePlayerMoney ( player, 1000 ) car = createVehicle(480,53,-239,2) setMarkerColor(marker4,255,0,0,0) destroyElement(blip4) end addEventHandler( "onMarkerHit", marker4, part4 ) Link to comment
Xeno Posted December 27, 2011 Share Posted December 27, 2011 Use destroyElement(markername) Link to comment
zombienation Posted December 27, 2011 Author Share Posted December 27, 2011 Use destroyElement(markername) Thank you, so just to be sure, it will be destroyelement(blip1) and so on.. ? Thx Link to comment
unknooooown Posted December 27, 2011 Share Posted December 27, 2011 Use destroyElement(markername) Thank you, so just to be sure, it will be destroyelement(blip1) and so on.. ? Thx You could store every blip you need destroyed in a table and do: blips = {} blips[1] = createBlip ( 60,-240,0, 26 ) blips[2] = createBlip ( 60,-240,0, 36 ) for i,blip in ipairs( blips ) do destroyElement( blip ) end ----------------------------------------------------------------- -- This can of course also be done with other elements ---------- ----------------------------------------------------------------- elements = {} elements[1] = createBlip ( 60,-240,0, 26 ) elements[2] = createVehicle ( 480, 0, 0, 3 ) for i,element in ipairs( elements ) do destroyElement( element ) end Or something similar.. Whatever fits your resource. 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