justn Posted March 13, 2014 Share Posted March 13, 2014 (edited) So yeah, the problem is, when the player hits 'LosSantosMarker' and clicks the button 'LosSantos' , when he hits the marker the first time, it outputs it in the chat once, but when he goes into the marker again and clicks the button again, it outputs it twice, and so on, can I have a little help please? thanks addEventHandler("onClientMarkerHit",LosSantosMarker, function(p) if p == lp and not isPedInVehicle(lp) then guiSetVisible(AirportWindow, true) showCursor(true) end addEventHandler("onClientGUIClick",AirportWindow, function (b,thePlayer) if b == "left" then if source == LosSantos then cancelEvent() outputChatBox("You are already in Los Santos!", thePlayer, 255, 0, 0) end end end) end) Edited March 13, 2014 by Guest Link to comment
WASSIm. Posted March 13, 2014 Share Posted March 13, 2014 (edited) you can't cancel event onClientGUIClick addEventHandler("onClientMarkerHit", LosSantosMarker, function(p) if (p == lp) and not (isPedInVehicle(lp)) then guiSetVisible(AirportWindow, true) showCursor(true) end end) addEventHandler("onClientGUIClick", AirportWindow, function (b) if (b == "left") and (source == LosSantos) then outputChatBox("You are already in Los Santos!", 255, 0, 0) end end) Edited March 13, 2014 by Guest Link to comment
Castillo Posted March 13, 2014 Share Posted March 13, 2014 addEventHandler ( "onClientMarkerHit", LosSantosMarker, function ( p ) if ( p == lp and not isPedInVehicle ( lp ) ) then guiSetVisible ( AirportWindow, true ) showCursor ( true ) end end ) addEventHandler ( "onClientGUIClick", AirportWindow, function ( b ) if isElementWithinMarker ( localPlayer, LosSantosMarker ) then if ( b == "left" ) then if ( source == LosSantos ) then outputChatBox ( "You are already in Los Santos!", 255, 0, 0 ) end end end end ) onClientGUIClick can't be cancelled. Link to comment
justn Posted March 13, 2014 Author Share Posted March 13, 2014 Thanks @SolidSnake14 & @WASSIm. Guess I learn't something new today 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