Captain Cody Posted November 24, 2015 Share Posted November 24, 2015 (edited) 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 November 24, 2015 by Guest Link to comment
Addlibs Posted November 24, 2015 Share Posted November 24, 2015 Line 7: if getElementType(hitElement) == "player" then could/should be if hitElement == localPlayer then -- checks if entered by the local player, i.e. the client ped, this also makes checking if it's a player redundant, cause localPlayer must be a player 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