FlyingSpoon Posted October 31, 2014 Share Posted October 31, 2014 For some reason when I enter marker, the GUI pops up. But somehow it appears for all players? I only want it to appear for me, or when other players enter only for them. Not for everyone? Can anyone help me thanks! nMarker = createMarker( 1925.51171875, -1786.77734375, 12.5, "cylinder", 1, 255, 255, 255 ) local gHanger = createPed(292, 1925.51171875, -1786.77734375, 13.546875) setPedRotation(gHanger, 177.45660400391) setElementDimension(gHanger, 0) setElementInterior(gHanger, 0) setPedAnimation ( gHanger, "SMOKING", "M_smklean_loop") setElementFrozen(gHanger, true) local scr = {guiGetScreenSize() } local w, h = 358,239 local x, y = (scr[1]/2)-(w/2), (scr[2]/2)-(h/2) mainWin = guiCreateWindow(x,y,w,h,"Ardent Roleplay 0.2",false) gAny = guiCreateButton(16,27,324,47,"Got anything for meh' homie?",false,mainWin) gHurry = guiCreateButton(16,98,324,47,"Sorry, I am in a hurry!",false,mainWin) gSoon = guiCreateButton(16,165,324,47,"Coming Soon...",false,mainWin) exWin = guiCreateWindow(x,y,170,151,"",false) gMoney = guiCreateButton(13,23,143,44,"Gimme' some money",false,exWin) gJob = guiCreateButton(13,86,143,44,"Got any jobs for meh?",false,exWin) guiSetVisible(mainWin, false) guiSetVisible(exWin, false) function btnClicks() if source == gAny then guiSetVisible(mainWin, false) guiSetVisible(exWin, true) showCursor(true) else if source == gHurry then outputChatBox("[English] Cesar Vialpando says: Alright kid! Jus' watch where your walking.", 255, 255, 255 ) guiSetVisible(mainWin, false) showCursor(false) else if source == gSoon then guiSetVisible(mainWin, false) showCursor(false) end end end end addEventHandler("onClientGUIClick", root, btnClicks) function exBtn( thePlayer ) if source == gMoney then outputChatBox("[English] Cesar Vialpando says: Sorry mate, I am broke!", 255, 255, 255 ) guiSetVisible( exWin, false ) showCursor ( false ) else if source == gJob then outputChatBox("[English] Cesar Vialpando says: Might do, come back later.", 255, 255, 255 ) guiSetVisible( exWin, false ) showCursor ( false ) end end end addEventHandler("onClientGUIClick", root, exBtn) function markerHit() if source == nMarker then guiSetVisible(mainWin, true) showCursor(true) end end addEventHandler("onClientMarkerHit", root, markerHit) Link to comment
Enargy, Posted October 31, 2014 Share Posted October 31, 2014 change the argument of the line #60 to #66 for this: addEventHandler("onClientMarkerHit", root, function() if isElementWithinMarker(getLocalPlayer(), nMarker) then guiSetVisible(mainWin, true) showCursor(true) end end) Link to comment
TAPL Posted October 31, 2014 Share Posted October 31, 2014 function markerHit(hitElement) if hitElement == localPlayer then if source == nMarker then guiSetVisible(mainWin, true) showCursor(true) end end end addEventHandler("onClientMarkerHit", root, markerHit) 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