Jump to content

Gui Question


KillerNico

Recommended Posts

Acitano, that's not a valid example.

--server side

myMarker = createMarker (2308.87,-1.91,25.9,"cylinder",1,255,0,0,128) 
  
function showGui (hitPlayer, matchingDimension) 
triggerClientEvent(hitPlayer,"showGUI",getRootElement()) 
end 
addEventHandler("onMarkerHit",myMarker,showGui) 

--client side

addEvent("showGUI",true) 
addEventHandler("showGUI",getRootElement(), 
function () 
guiSetVisible(myGUIElement,true) 
end) 

Link to comment
Acitano, that's not a valid example.

--server side

myMarker = createMarker (2308.87,-1.91,25.9,"cylinder",1,255,0,0,128) 
  
function showGui (hitPlayer, matchingDimension) 
triggerClientEvent(hitPlayer,"showGUI",getRootElement()) 
end 
addEventHandler("onMarkerHit",myMarker,showGui) 

--client side

addEvent("showGUI",true) 
addEventHandler("showGUI",getRootElement(), 
function () 
guiSetVisible(myGUIElement,true) 
end) 

I know, i wanted to let he to make the CS part :D

Link to comment

Ehm, why not create the marker clientside when the resource starts, then use onClientMarkerHit to show the GUI? Saves bandwidth and works faster. Also, why is myMarker a global variable? No need for that.

  
local myMarker = createMarker (2308.87,-1.91,25.9,"cylinder",1,255,0,0,128) 
  
function showGui (hitPlayer, matchingDimension) 
--gui code here 
end 
addEventHandler("onClientMarkerHit",myMarker,showGui) 
  

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