Jump to content

Marker OutputChatBox


Dice

Recommended Posts

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
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
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 by Guest
Link to comment

@ 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
@ 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 :lol:

Edited by Guest
Link to comment

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 :lol:

What so funny ?!

Link to comment

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

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