Jump to content

shows for all players.


Bean666

Recommended Posts

Hello. whenever a player hits the marker, it shows for all players, anyway to fix this? it's clientside.

function menuShow() 
    visibleornot = guiGetVisible (window) 
    if (visibleornot == true) then 
        guiSetVisible (window, false) 
        showCursor (false) 
    end 
    if (visibleornot == false) then 
        guiSetVisible (window, true) 
        showCursor (true) 
    end 
end 
  
for k,v in ipairs( spots ) do 
    marker = createMarker ( v[1],v[2],v[3], "Cylinder", 1.5, 255, 255, 255, 50 ) 
addEventHandler ("onClientMarkerHit", marker, menuShow) 
end 

Link to comment
for k,v in ipairs( spots ) do 
    marker = createMarker ( v[1],v[2],v[3], "Cylinder", 1, 255, 255, 255, 100 ) 
function MarkerHit ( hitPlayer, matchingDimension ) 
if (hitPlayer == localPlayer) then 
guiSetVisible(window, true) 
showCursor(true) 
end 
end 
addEventHandler ( "onClientMarkerHit", marker, MarkerHit ) 
end 

this seems simplier, it works but will it show for other players too? i think not.

Link to comment

That should work, but don't put your function definition inside loop.

Try it like this:

  
function MarkerHit ( hitPlayer, matchingDimension ) 
    if (hitPlayer == localPlayer) then 
        guiSetVisible(window, true) 
        showCursor(true) 
    end 
end 
  
for k,v in ipairs( spots ) do 
    marker = createMarker ( v[1],v[2],v[3], "Cylinder", 1, 255, 255, 255, 100 ) 
    addEventHandler ( "onClientMarkerHit", marker, MarkerHit ) 
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...