Whizz Posted September 10, 2023 Share Posted September 10, 2023 This script that I created is shown to all players GUi. But I want it to be shown for the player who entered the marker. pls Helpme. Marker = createMarker( 1508.814453125 , -1144.19921875 , 140.93536376953, "cylinder", 1, 255, 0, 0) function openwindow(thePlayer) triggerClientEvent("opengui1window", thePlayer, thePlayer) end addEventHandler("onMarkerHit", Marker, openwindow) Link to comment
alex17" Posted September 11, 2023 Share Posted September 11, 2023 Marker = createMarker( 1508.814453125 , -1144.19921875 , 140.93536376953, "cylinder", 1, 255, 0, 0) function openwindow(thePlayer) triggerClientEvent(thePlayer,"opengui1window", thePlayer, thePlayer) end addEventHandler("onMarkerHit", Marker, openwindow) Link to comment
Whizz Posted September 11, 2023 Author Share Posted September 11, 2023 16 hours ago, alex17" said: Marker = createMarker( 1508.814453125 , -1144.19921875 , 140.93536376953, "cylinder", 1, 255, 0, 0) function openwindow(thePlayer) triggerClientEvent(thePlayer,"opengui1window", thePlayer, thePlayer) end addEventHandler("onMarkerHit", Marker, openwindow) I did it. But it didn't work out right. Link to comment
FlorinSzasz Posted September 11, 2023 Share Posted September 11, 2023 40 minutes ago, Commonist said: I did it. But it didn't work out right. Marker = createMarker( 1508.814453125 , -1144.19921875 , 140.93536376953, "cylinder", 1, 255, 0, 0) function openwindow(thePlayer) local elementType = getElementType(thePlayer) if elementType == "player" then triggerClientEvent(thePlayer,"opengui1window", thePlayer) end end addEventHandler("onMarkerHit", Marker, openwindow) Link to comment
Whizz Posted September 12, 2023 Author Share Posted September 12, 2023 On 11/09/2023 at 22:02, FlorinSzasz said: Marker = createMarker( 1508.814453125 , -1144.19921875 , 140.93536376953, "cylinder", 1, 255, 0, 0) function openwindow(thePlayer) local elementType = getElementType(thePlayer) if elementType == "player" then triggerClientEvent(thePlayer,"opengui1window", thePlayer) end end addEventHandler("onMarkerHit", Marker, openwindow) Hello friends. Could this be the problem؟ addEventHandler("onClientMarkerHit",resourceRoot, function(thePlayer) dm_window = guiCreateWindow(0.1556,0.1597,0.6375,0.6944,"Team-Panel",true) grove_button = guiCreateButton(10,108,162,165,"Team-1",false,dm_window) police_button = guiCreateButton(285,108,162,165,"Team-2",false,dm_window) teams_label = guiCreateLabel(159,44,145,47,"",false,dm_window) showCursor(true) end ) Link to comment
alex17" Posted September 12, 2023 Share Posted September 12, 2023 It is not necessary to create the marker on the server and then do a trigger, it can work perfectly if you do everything on the client Marker = createMarker( 1508.814453125 , -1144.19921875 , 140.93536376953, "cylinder", 1, 255, 0, 0) addEventHandler("onClientMarkerHit", Marker, function(element, dim) if element == localPlayer and dim then if not dm_window then dm_window = guiCreateWindow(0.1556,0.1597,0.6375,0.6944,"Team-Panel",true) grove_button = guiCreateButton(10,108,162,165,"Team-1",false,dm_window) police_button = guiCreateButton(285,108,162,165,"Team-2",false,dm_window) teams_label = guiCreateLabel(159,44,145,47,"",false,dm_window) else guiSetVisible(dm_window, true) end showCursor(true) end end ) But if you still want to continue doing it with a server to client trigger, I'll leave you how to do it server Marker = createMarker( 1508.814453125 , -1144.19921875 , 140.93536376953, "cylinder", 1, 255, 0, 0) function openwindow(thePlayer, dim) local elementType = getElementType(thePlayer) if elementType == "player" and dim then triggerClientEvent(thePlayer,"opengui1window", thePlayer) end end addEventHandler("onMarkerHit", Marker, openwindow) client addEvent("opengui1window", true) addEventHandler("opengui1window", root, function() if not dm_window then dm_window = guiCreateWindow(0.1556,0.1597,0.6375,0.6944,"Team-Panel",true) grove_button = guiCreateButton(10,108,162,165,"Team-1",false,dm_window) police_button = guiCreateButton(285,108,162,165,"Team-2",false,dm_window) teams_label = guiCreateLabel(159,44,145,47,"",false,dm_window) else guiSetVisible(dm_window, true) end showCursor(true) end ) 1 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