Jump to content

Recommended Posts

hi guys i want call marker from another function like this code

 

 

local hidemark = createMarker(10,50,5,"cylinder",1,0,255,0)

function mark(theplayer)

markerveh =createMarker(0,0,5,"cylinder",1,0,255,0)

end

addEventHandler("onMarkerHit",marker1,mark)


function job1(theplayer)

setElementVisibleTo(markerveh,root,false)-- for here

end

addCommandHandler("hidemark",job1)

Link to comment
10 minutes ago, mehdi koocholo said:

hi guys i want call marker from another function like this code

 

 

local hidemark = createMarker(10,50,5,"cylinder",1,0,255,0)

function mark(theplayer)

markerveh =createMarker(0,0,5,"cylinder",1,0,255,0)

end

addEventHandler("onMarkerHit",marker1,mark)


function job1(theplayer)

setElementVisibleTo(markerveh,root,false)-- for here

end

addCommandHandler("hidemark",job1)

local hidemark -- define hidemark as a global variable

function createMarkers()
    hidemark = createMarker(10, 50, 5, "cylinder", 1, 0, 255, 0)
end
addEventHandler("onResourceStart", resourceRoot, createMarkers)

function mark(thePlayer, matchingDimension)
    if matchingDimension and isElement(thePlayer) and getElementType(thePlayer) == "player" then
        local markerveh = createMarker(0, 0, 5, "cylinder", 1, 0, 255, 0)
        -- Do something with markerveh
    end
end
addEventHandler("onMarkerHit", hidemark, mark)

function job1(thePlayer)
    setElementVisibleTo(hidemark, root, false)
end
addCommandHandler("hidemark", job1)

this test code, i hope helps to you

Link to comment
5 minutes ago, Shady1 said:
local hidemark -- define hidemark as a global variable

function createMarkers()
    hidemark = createMarker(10, 50, 5, "cylinder", 1, 0, 255, 0)
end
addEventHandler("onResourceStart", resourceRoot, createMarkers)

function mark(thePlayer, matchingDimension)
    if matchingDimension and isElement(thePlayer) and getElementType(thePlayer) == "player" then
        local markerveh = createMarker(0, 0, 5, "cylinder", 1, 0, 255, 0)
        -- Do something with markerveh
    end
end
addEventHandler("onMarkerHit", hidemark, mark)

function job1(thePlayer)
    setElementVisibleTo(hidemark, root, false)
end
addCommandHandler("hidemark", job1)

this test code, i hope helps to you

i want call markerveh not hidemark

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