Jump to content

onMarkerHit


Wei

Recommended Posts

what's wrong here? I got no errors

ammumarker = createMarker (  1367.34094, -1279.96411, 12.54688, "cylinder", 1.5, 255, 255, 0, 170 ) 
function teleportMeToAmmunationInterior () 
    setElementInterior( source, 6 ) 
    setElementPosition( source, 317.2380, -168.0520, 999.5930 ) 
end 
addEventHandler("onMarkerHit", ammumarker, teleportMeToAmmunationInterior) 
  

When I hit marker it disaphere :?

Link to comment

"source" is not defined there.

ammumarker = createMarker (  1367.34094, -1279.96411, 12.54688, "cylinder", 1.5, 255, 255, 0, 170 ) 
  
function teleportMeToAmmunationInterior ( thePlayer ) 
    setElementInterior ( thePlayer, 6 ) 
    setElementPosition ( thePlayer, 317.2380, -168.0520, 999.5930 ) 
end 
addEventHandler ( "onMarkerHit", ammumarker, teleportMeToAmmunationInterior ) 

Link to comment

1 question more.

Why when I hit marker becomes to visible to all players ?

When I remove root then shows error.

CODE:

function showMeTheWindow( ) 
    guiSetVisible(mainWindow, true) 
    showCursor(true) 
end 
addEventHandler("showMainWindow", root, showMeTheWindow) 
  

Link to comment
  
addEvent("showMainWindow", true) -- just in case you haven't already added the event 
function showMeTheWindow( ) 
    guiSetVisible(mainWindow, true) 
    showCursor(true) 
end 
addEventHandler("showMainWindow", getLocalPlayer(), showMeTheWindow) 
  

Try that it might be the problem

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