MACIEKW89 Posted August 27, 2013 Posted August 27, 2013 Witam! Mam ciekawy pomysł na mój serwer play/rpg. Jak zrobić aby po akceptowaniu pracy (kliknięciu w przycisk) pokazywały się pozostałe markery? 2 rzecz - Jak zrobić aby po wejściu w jeden marker, z opóźnieniem on znikał? Potrzebuję dokładnego opisu i najlepiej przykładu. Z góry dziękuję.
XFawkes Posted August 28, 2013 Posted August 28, 2013 1. function onStart( ) AcceptJobButton = guiCreateButton( 300, 300, 100, 100, "Accept Job!", false ) addEventHandler ( "onClientGUIClick", AcceptJobButton, showMarkers ) end addEventHandler( "onClientResourceStart", resourceRoot, onStart ) function showMarkers ( ) -- ... end 2. function onStart( ) myMarker = createMarker(0,0,20,"corona",5) addEventHandler ( "onClientMarkerHit", myMarker, hideThisMarker ) end addEventHandler( "onClientResourceStart", resourceRoot, onStart ) function hideThisMarker ( ) local marker = source setTimer(function(marker) setElementAlpha(marker,0) -- or destroyElement(marker) end,5000,1,marker) end
MACIEKW89 Posted August 28, 2013 Author Posted August 28, 2013 (edited) Dziękuje, że tak dokładnie to opisałeś... 1 rozumiem ale 2 wogóle nie kumam. Możesz objaśnić? EDIT. Już zkumałem dzięki za pomoc. Edited August 28, 2013 by Guest
Mefisto_PL Posted August 28, 2013 Posted August 28, 2013 function onStart( ) myMarker = createMarker(0,0,20,"corona",5) -- Stworzony marker addEventHandler ( "onClientMarkerHit", myMarker, hideThisMarker ) -- Ukrycie danego markera/markeru (?) end addEventHandler( "onClientResourceStart", resourceRoot, onStart ) -- Marker tworzony jest po włączeniu skryptu function hideThisMarker ( ) local marker = source -- Marker setTimer(function(marker) -- Ustawianie timeru setElementAlpha(marker,0) -- Ukrycie markera poprzez jego niewidoczność ( ale i tak czasem widać poświatę ) -- or [ z ang. albo ] dał Ci opcję do wyboru, albo usuwasz linijkę z setElementAlpha, albo linijkę z destroyElement destroyElement(marker) -- usuwa marker end,5000,1,marker) -- Po 5 sekundach następuje jedna z wybranych opcji end
MACIEKW89 Posted August 28, 2013 Author Posted August 28, 2013 Nie zdążyłem zedytować Dzięki za chęci. EDIT. Można by to jakoś ze sobą powiązać ? (1 z 2)
Mefisto_PL Posted August 28, 2013 Posted August 28, 2013 Można, kombinuj, kod masz praktycznie pod ręką ; p
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