Sasu Posted February 26, 2013 Posted February 26, 2013 How can I delete the marker(markerProsti)? function ofrecerse(source) prosti = getElementData(source, "Occupation", true) if prosti == "Prostituta" then local x,y,z = getElementPosition(source) markerProsti = createMarker( x, y, z-1, "cylinder", 1.5, 175, 0, 255, 150 ) setElementFrozen ( source, true ) setElementData(source, "Occupation", "Prostituta on") else setElementFrozen ( source, false ) setElementData(source, "Occupation", "Prostituta") -- Delete my marker end end addCommandHandler("ofrecerme", ofrecerse) State: Inactive
NodZen Posted February 26, 2013 Posted February 26, 2013 destroyElement Or else delete the line 5. ------------------------------------------------------------------------------------------ My scripts http://community.multitheftauto.com/index.php?p=resources&s=details&id=6977 http://community.multitheftauto.com/index.php?p=resources&s=details&id=7740
xXMADEXx Posted February 27, 2013 Posted February 27, 2013 Try this function ofrecerse(plr) if (getElementData(plr,"Occupation")=="Prostituta") then local x,y,z = getElementPosition(plr) markerProsti = createMarker( x, y, z-1, "cylinder", 1.5, 175, 0, 255, 150 ) setElementFrozen ( plr, true ) setElementData(plr, "Occupation", "Prostituta on") else setElementFrozen ( plr, false ) setElementData(plr, "Occupation", "Prostituta") destroyElement(markerProsti) end end addCommandHandler("ofrecerme", ofrecerse) The Ultimate Lua Tutorial! | MTA PHP SDK
tosfera Posted February 27, 2013 Posted February 27, 2013 Try this function ofrecerse(plr) if (getElementData(plr,"Occupation")=="Prostituta") then local x,y,z = getElementPosition(plr) markerProsti = createMarker( x, y, z-1, "cylinder", 1.5, 175, 0, 255, 150 ) setElementFrozen ( plr, true ) setElementData(plr, "Occupation", "Prostituta on") else setElementFrozen ( plr, false ) setElementData(plr, "Occupation", "Prostituta") destroyElement(markerProsti) end end addCommandHandler("ofrecerme", ofrecerse) dude, this will totally not work for him cause he wont add the "occupation" to any character as data. You should give it first, but he didn't. (as far as we can see cause he didn't post that part of the script). @Sasuke, You could try to do it with a onMarkerHit. just easy like; addEventHandler("onMarkerHit", root, function ( hitElement ) if ( root == markerProsti and getElementType( hitElement ) == "player" ) then destroyElement(markerProsti) end end ) If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]
Sasu Posted February 27, 2013 Author Posted February 27, 2013 I only asked that How Can I delete the marker. @Castro thanks its work function ofrecerse(source) prosti = getElementData(source, "Occupation", true) if prosti == "Prostituta" then local x,y,z = getElementPosition(source) markerProsti = createMarker( x, y, z-1, "cylinder", 1.5, 175, 0, 255, 150 ) setElementFrozen ( source, true ) setElementData(source, "Occupation", "Prostituta on") setPedAnimation( source, "STRIP", "strip_A") else setElementFrozen ( source, false ) setElementData(source, "Occupation", "Prostituta") destroyElement( markerProsti ) setPedAnimation( source, false ) end end addCommandHandler("ofrecerme", ofrecerse) But others thanks too for responding. State: Inactive
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