Jump to content

error with marker


Recommended Posts

function createcooking (x, y, z) 
    marker = createMarker(x, y+1, z, "cylinder", 1) 
end 
addEvent ( "createCook", true ) 
addEventHandler ( "createCook", root, createcooking ) 
  
  
function onmarker(source, matchingDimension) 
triggerClientEvent ( "onCook", getRootElement(), source ) 
end 
addEventHandler( "onMarkerHit", marker, onmarker )  

Explain why does not work, must use marker created during the game.

sorry for my English

Link to comment
function createcooking(x, y, z) 
    marker = createMarker(x, y+1, z, "cylinder", 1) 
    addEventHandler("onMarkerHit", marker, onmarker)  
end 
addEvent("createCook", true) 
addEventHandler("createCook", root, createcooking) 
  
  
function onmarker(player) 
    if getElementType(player) == "player" then 
        triggerClientEvent("onCook", root, player) 
    end 
end 

Link to comment
function createcooking(x, y, z) 
    marker = createMarker(x, y+1, z, "cylinder", 1) 
    addEventHandler("onMarkerHit", marker, onmarker)  
end 
addEvent("createCook", true) 
addEventHandler("createCook", root, createcooking) 
  
  
function onmarker(player) 
    if getElementType(player) == "player" then 
        triggerClientEvent("onCook", root, player) 
    end 
end 

thank you verry much!

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