Jump to content

Marker delete


Sasu

Recommended Posts

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) 

Link to comment

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) 

Link to comment
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 
) 

Link to comment

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.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...