Dice Posted March 19, 2013 Share Posted March 19, 2013 vatoMarker = createMarker ( 393.60001, -2059.69995, 9.736, "cylinder", 1, 255, 255, 0, 18 ) addEventHandler ( "onMarkerHit", vatoMarker, function ( hitElement ) outputChatBox ( "testest.", hitElement, 255, 215, 0, true ) end ) why isn't this working? no errors just out puts nothing! Link to comment
PaiN^ Posted March 19, 2013 Share Posted March 19, 2013 What do you want to output ? A player's name, Element type, etc ... Link to comment
Dice Posted March 19, 2013 Author Share Posted March 19, 2013 the content in the outputchatbox Link to comment
فاّرس Posted March 19, 2013 Share Posted March 19, 2013 vatoMarker = createMarker ( 393.60001, -2059.69995, 9.736, "cylinder", 1, 255, 255, 0, 18 ) addEventHandler ( "onMarkerHit", vatoMarker, function ( hitElement ) outputChatBox ( "testest.", hitElement, 255, 215, 0, true ) end ) why isn't this working? no errors just out puts nothing! Try this vatoMarker = createMarker ( 393.60001, -2059.69995, 9.736, "cylinder", 1, 255, 255, 0, 18 ) addEventHandler ( "onMarkerHit", vatoMarker, function ( hitElement ) outputChatBox("Test",source,0,255,0,true) end ) Link to comment
Dice Posted March 19, 2013 Author Share Posted March 19, 2013 That won't work because source is the marker Link to comment
Baseplate Posted March 19, 2013 Share Posted March 19, 2013 (edited) vatoMarker = createMarker ( 393.60001, -2059.69995, 9.736, "cylinder", 1, 255, 255, 0, 18 ) addEventHandler ( "onMarkerHit", root, function ( hitElement ) if (source == vatoMarker) then outputChatBox("testest.",hitElement,0,255,0,true) end end ) Edited March 19, 2013 by Guest Link to comment
PaiN^ Posted March 19, 2013 Share Posted March 19, 2013 @ The Best : The source of the event onMarkerHit is the marker that got hit, Read the wiki first ! @ Dice : if you want the message to appear to every one in the server : vatoMarker = createMarker ( 393.60001, -2059.69995, 9.736, "cylinder", 1, 255, 255, 0, 18 ) addEventHandler ( "onMarkerHit", vatoMarker, function ( ) outputChatBox("Test",root,0,255,0,true) end ) And If you want it to appear only for the player that hit the marker : vatoMarker = createMarker ( 393.60001, -2059.69995, 9.736, "cylinder", 1, 255, 255, 0, 18 ) addEventHandler ( "onMarkerHit", vatoMarker, function ( hitElement ) if getElementType ( hitElement ) == "player" then outputChatBox("Test",hitElement,0,255,0,true) end end ) Link to comment
Baseplate Posted March 19, 2013 Share Posted March 19, 2013 For the last code @PaiN, then if you hit the marker with a car it won't output anything. Link to comment
فاّرس Posted March 19, 2013 Share Posted March 19, 2013 (edited) @ The Best :The source of the event onMarkerHit is the marker that got hit, Read the wiki first ! @ Dice : if you want the message to appear to every one in the server : vatoMarker = createMarker ( 393.60001, -2059.69995, 9.736, "cylinder", 1, 255, 255, 0, 18 ) addEventHandler ( "onMarkerHit", vatoMarker, function ( ) outputChatBox("Test",root,0,255,0,true) end ) And If you want it to appear only for the player that hit the marker : vatoMarker = createMarker ( 393.60001, -2059.69995, 9.736, "cylinder", 1, 255, 255, 0, 18 ) addEventHandler ( "onMarkerHit", vatoMarker, function ( hitElement ) if getElementType ( hitElement ) == "player" then outputChatBox("Test",hitElement,0,255,0,true) end end ) Experience Edited March 19, 2013 by Guest Link to comment
Baseplate Posted March 19, 2013 Share Posted March 19, 2013 Speak English here, go speak your native language at the appropriate subforums. Link to comment
Dice Posted March 19, 2013 Author Share Posted March 19, 2013 #Pai_[N], it's not working =| what should I do? Link to comment
PaiN^ Posted March 19, 2013 Share Posted March 19, 2013 Any errors on debugscript ? * EDIT : For the last code @PaiN, then if you hit the marker with a car it won't output anything. I don't see where he mentioned a car ! @ The Best :The source of the event onMarkerHit is the marker that got hit, Read the wiki first ! @ Dice : if you want the message to appear to every one in the server : vatoMarker = createMarker ( 393.60001, -2059.69995, 9.736, "cylinder", 1, 255, 255, 0, 18 ) addEventHandler ( "onMarkerHit", vatoMarker, function ( ) outputChatBox("Test",root,0,255,0,true) end ) And If you want it to appear only for the player that hit the marker : vatoMarker = createMarker ( 393.60001, -2059.69995, 9.736, "cylinder", 1, 255, 255, 0, 18 ) addEventHandler ( "onMarkerHit", vatoMarker, function ( hitElement ) if getElementType ( hitElement ) == "player" then outputChatBox("Test",hitElement,0,255,0,true) end end ) Experience What so funny ?! Link to comment
iPrestege Posted March 19, 2013 Share Posted March 19, 2013 local vatoMarker = createMarker ( 393.60001, -2059.69995, 9.736, "cylinder", 1, 255, 255, 0, 18 ) addEventHandler ( "onMarkerHit", vatoMarker, function ( hitElement ) if (getElementType(hitElement) == "player") then outputChatBox ( "testest.", hitElement, 255, 215, 0, true ) end end ) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now