Jump to content

Marker Error


Karuzo

Recommended Posts

I have a problem.

I want ,when i hit a marker, that then the marker destroy and a new marker is spawn.

It doesn't work.

  
function Flug1() 
    outputChatBox("Los geht es in #FF7F24 Los Santos",138,43,226,true) 
    guiSetVisible(Pilotpanel.window[1], false) 
    showCursor(false) 
    local pl1m1 = createMarker(2013.2075195313,-2593.7934570313,12.9565591812131, "cylinder", 5.0, 255, 0, 0)  
end 
addEventHandler("onClientGUIClick", Pilotpanel.button[1], Flug1, false) 
  
  
  
  
addEventHandler("onClientMarkerHit", pl1m1, 
function(hitPlayer) 
    if getElementType(hitPlayer) == "vehicle" and hitPlayer == localPlayer then 
        destroyElement ( pl1m1 ) 
        outputChatBox("Der nächste Stop erwartet dich in, San Fiero") 
    end 
end) 
  

Edited by Guest
Link to comment
  • Moderators
addEventHandler("onClientMarkerHit", pl1m1, 
function(hitPlayer) 
    if getPedOccupiedVehicle(hitPlayer) and hitPlayer == localPlayer then  
        destroyElement ( pl1m1 ) 
        outputChatBox("Der nächste Stop erwartet dich in, San Fiero") 
    end 
end) 

Link to comment
  • Moderators

    local pl1m1 = createMarker(2013.2075195313,-2593.7934570313,12.9565591812131, "cylinder", 5.0, 255, 0, 0) 

make it global

   pl1m1 = createMarker(2013.2075195313,-2593.7934570313,12.9565591812131, "cylinder", 5.0, 255, 0, 0) 

and:

  
    addEventHandler("onClientMarkerHit", root,--pl1m1 
    function(hitPlayer) 
        if source == pl1m1 and getPedOccupiedVehicle(hitPlayer) and hitPlayer == localPlayer then 
            destroyElement ( pl1m1 ) 
            outputChatBox("Der nächste Stop erwartet dich in, San Fiero") 
        end 
    end) 
  

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...