☠ RaZeR ☠ Posted February 17, 2016 Share Posted February 17, 2016 (edited) when i hit the marker i want to check if the windows is closed but the if and else ddint work ! the window is open = true but nothing and when the window is close = false but nothing come client ! addEvent("reward4",true) addEventHandler("reward4",root, function () if ( guiGetVisible ( mis4 ) == true ) then guiSetVisible (claim4, true) guiSetVisible (change4, false) fadeCamera(false,0,0,0,0) sound = playSound("song.mp3") else guiSetVisible (claim4, false) guiSetVisible (change4, true) end end ) Edited February 21, 2016 by Guest Link to comment
tosfera Posted February 17, 2016 Share Posted February 17, 2016 How are you triggering the "reward4" event? You said something about a marker, can you show us that piece? Link to comment
☠ RaZeR ☠ Posted February 18, 2016 Author Share Posted February 18, 2016 How are you triggering the "reward4" event? You said something about a marker, can you show us that piece? function Finsh_Missoin(plr) if plr then dropMarker = createMarker(858.14453,-587.89142,18.01809,"cylinder",7,255,255,0,100,plr) dropBlip = createBlip(858.14453,-587.89142,18.01809,24,5,255,255,0,255,1,900000,plr) function onDrop( hitter ) if ( hitter == plr ) then triggerClientEvent ( plr,"show4", plr ) triggerClientEvent( plr,"reward4", plr ) missionDone(hitter,true) end end addEventHandler("onMarkerHit",dropMarker,onDrop) end end Link to comment
tosfera Posted February 18, 2016 Share Posted February 18, 2016 First of all, what a mess. Sorry to say, try to use tabs at every new line to see what's inside a block. Try something like this; addEvent ( "reward4", true ); addEventHandler ( "reward4", root, function ( thePlayer ) if ( thePlayer == getLocalPlayer() ) then if ( guiGetVisible ( mis4 ) ) then guiSetVisible ( claim4, true ); guiSetVisible ( change4, false ); fadeCamera ( false, 0, 0, 0, 0 ); sound = playSound ( "song.mp3" ); else guiSetVisible ( claim4, false ); guiSetVisible ( change4, true ); end end end ); function Finsh_Missoin ( thePlayer ) if ( thePlayer ) then dropMarker = createMarker ( 858.14453, -587.89142, 18.01809, "cylinder", 7, 255, 255, 0, 100, thePlayer ); dropBlip = createBlip ( 858.14453, -587.89142, 18.01809, 24, 5, 255, 255, 0, 255, 1, 900000, thePlayer ); addEventHandler ( "onMarkerHit", dropMarker, function ( hitElement ) if ( hitElement == thePlayer ) then triggerClientEvent ( "show4", thePlayer, thePlayer ); triggerClientEvent ( "reward4", thePlayer, thePlayer ); end end ); end end Link to comment
☠ RaZeR ☠ Posted February 19, 2016 Author Share Posted February 19, 2016 the button | claim4 didint visble |not working if ( guiGetVisible ( mis4 ) ) then 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