Jump to content

Dont working marker


Zcraks

Recommended Posts

marker = createMarker ( 2371.64, -1126.66, 1050.88 - 1, "cylinder", 0.7)
marker:setInterior(8)
marker:setDimension(1)

addEventHandler("onMarkerHit", marker, function( player )
  if player:getType() == "player" and dim == 1 then
      outputDebugString("TEST")
  end	
end)

Server side

Link to comment

The event onMarkerHit also has an argument for matching dimension (true or false) which you could use. I don't know where you set the variable "dim" so maybe the problem is from there.

addEventHandler("onMarkerHit", marker, function( player, matchDim )
  if player:getType() == "player" and matchDim then
      outputDebugString("TEST")
  end	
end)

*matchDim - true if the player and the marker are in the same dimension

Link to comment
marker = createMarker ( 2371.64, -1126.66, 1050.88 - 1, "cylinder", 0.7)
marker:setInterior(8)
marker:setDimension(1)

addEventHandler("onMarkerHit", marker, function(hitElement, matchingDimension)
  -- parameter matchingDimension is a boolean value and not a int
  if hitElement:getType() == "player" and matchingdimension then
      outputDebugString("Player Hit The Marker!")
  end	
end)

 

Edited by ERAGON007
Forgot to put arguments of function :)
Link to comment
20 minutes ago, ERAGON007 said:


marker = createMarker ( 2371.64, -1126.66, 1050.88 - 1, "cylinder", 0.7)
marker:setInterior(8)
marker:setDimension(1)

addEventHandler("onMarkerHit", marker, function()
  -- parameter matchingDimension is a boolean value and not a int
  if :getType() == "player" and matchingdimension then
      outputDebugString("Player Hit The Marker!")
  end	
end)

 

Yeah and how will it get that "matchingdimension" variable when it's not declared in the function arguments ?
Also this ":getType()" will throw an error because no element was specified.
I already suggested a solution which I guess is working as the post author didn't write anymore.

Edited by SpecT
Link to comment
1 minute ago, SpecT said:

Yeah and how will it get that "matchingdimension" variable when it's not declared in the function arguments ?
Also this ":getType()" will throw an error as no element was specified.
I already suggested a solution which I guess is working as the post author didn't write anymore.

edited :)

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