icarus Posted August 7, 2012 Posted August 7, 2012 So what i wanna make is, create a marker at serverside, and when a player hits that marker it shows a gui that is at clientside. I made this but doesnt work, can someone help me. -----Serverside local door1marker = createMarker ( 2655, 2706, 411, "arrow", 1, 100, 20, 20 ) function door1markerhit( hitElement, matchingDimension ) if getElementType( hitElement ) == Player then triggerClientEvent ( Player, "ondoor1markerhit", Player ) end end addEventHandler( "onMarkerHit", door1marker, door1markerhit ) ----Clientside addEvent ( "ondoor1markerhit", true ) function showguidoor1 () guiSetVisible(keypadWindow,true) showCursor(true,true) setElementData(keypadWindow,"keypadID","GateKeypadCode") end addEventHandler( "ondoor1markerhit", getLocalPlayer ( ), showguidoor1 )
TAPL Posted August 7, 2012 Posted August 7, 2012 You don't need to make it server side. -- Client Side -- local door1marker = createMarker(2655, 2706, 411, "arrow", 1, 100, 20, 20) function door1markerhit(player) if getElementType(player) == "player" and player == localPlayer then guiSetVisible(keypadWindow,true) showCursor(true) setElementData(keypadWindow,"keypadID","GateKeypadCode") end end addEventHandler( "onClientMarkerHit", door1marker, door1markerhit)
icarus Posted August 7, 2012 Author Posted August 7, 2012 Actually, for what im doing its needed, cuz after it i wanna delete the Marker, for everyone after a player opens the gui.
Castillo Posted August 7, 2012 Posted August 7, 2012 local door1marker = createMarker ( 2655, 2706, 411, "arrow", 1, 100, 20, 20 ) function door1markerhit( hitElement, matchingDimension ) if ( getElementType( hitElement ) == "player" ) then triggerClientEvent ( hitElement, "ondoor1markerhit", hitElement ) end end addEventHandler( "onMarkerHit", door1marker, door1markerhit ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Castillo Posted August 7, 2012 Posted August 7, 2012 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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