Jump to content

Recommended Posts

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ę.

Link to comment

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 
  

Link to comment
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 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...