Jump to content

Make gui only visible to one person. (Solved)


Captain Cody

Recommended Posts

I cannot find anything on the wiki about it but, I'm trying to get the gui for a job I'm working on to apear on marker hit "Got that after some help" but it apears to everyone on the server.

  
  
 --Get the Job Marker-- 
 myMarker = createMarker( -241.9082, -227.8291, 1.2086515, "cylinder", 1.1, 0, 255, 0) 
      
    function MarkerHit(hitElement) 
        if getElementType(hitElement) == "player" then 
        showCursor(true) 
        --Create Stuff-- 
        acceptBtn = guiCreateButton(0.39, 0.38, 0.22, 0.05, "Accept Legal Load", true) 
                   --Event handler-- 
             addEventHandler("onClientGUIClick", acceptBtn, startMissionA ) 
                
        acceptBtn2 = guiCreateButton(0.39, 0.44, 0.22, 0.05, "Accept Illegal Load -WIP-", true) 
  
        cancelBtn = guiCreateButton(0.40, 0.50, 0.21, 0.07, "Cancel", true) 
                   --Event handler-- 
        guiSetProperty(cancelBtn, "NormalTextColour", "FFC30000") 
            addEventHandler("onClientGUIClick", cancelBtn, closeMain) 
      
        memo = guiCreateMemo(0.39, 0.58, 0.23, 0.07, "Trucking Job is new, it may have bugs. If you find any please report, Illegal load is non-functional right now..", true) 
        guiMemoSetReadOnly(memo, true) 
        end 
    end 
    addEventHandler ( "onClientMarkerHit", myMarker , MarkerHit ) 
     --Functions-- 
    function closeMain() 
        guiSetVisible (acceptBtn, not guiGetVisible ( acceptBtn ) ) 
                guiSetVisible (acceptBtn2, not guiGetVisible ( acceptBtn2 ) ) 
                        guiSetVisible (cancelBtn, not guiGetVisible ( cancelBtn ) ) 
                                guiSetVisible (memo, not guiGetVisible ( memo ) ) 
        showCursor(false) 
    end 
     
        function startMissionA() 
        guiSetVisible (acceptBtn, not guiGetVisible ( acceptBtn ) ) 
                guiSetVisible (acceptBtn2, not guiGetVisible ( acceptBtn2 ) ) 
                        guiSetVisible (cancelBtn, not guiGetVisible ( cancelBtn ) ) 
                                guiSetVisible (memo, not guiGetVisible ( memo ) ) 
                                     triggerServerEvent ( "startTheMission", resourceRoot) 
        showCursor(false) 
    end 

How would I fix?

Edited by Guest
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...