You must check if the element that hit the marker is the local player.
addEventHandler("onClientMarkerHit", resourceRoot,
function ( hitElement )
if ( hitElement == localPlayer ) then -- Here.
panel = guiCreateWindow(363, 122, 640, 424, "Drug Dealers", false)
guiWindowSetSizable(panel, false)
informacion = guiCreateMemo(19, 26, 602, 329, "It is a criminal Job that Gives you Some rights like Sell Drugs, Rob Stores and More things If you want to accept this job you must Press Accept If you don't Want to accept this job Press Cancel.", false, panel)
aceptar = guiCreateButton(19, 363, 220, 51, "Accept", false, panel)
guiSetFont(aceptar, "default-bold-small")
cerrar = guiCreateButton(401, 363, 220, 51, "Cancel", false, panel)
guiSetFont(cerrar, "default-bold-small")
showCursor(true)
addEventHandler ("onClientGUIClick", aceptar, aceptarr, false )
addEventHandler ("onClientGUIClick", cerrar, cerrarr, false )
end
end
)
function aceptarr()
showCursor (false)
guiSetVisible ( panel, not guiGetVisible ( panel ) )
end
addEventHandler( "onClientGUIClick",aceptarr, true )
function cerrarr()
showCursor (false)
guiSetVisible (panel, not guiGetVisible ( panel ) )
end
addEventHandler ("onClientGUIClick", cerrarr, true)