Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2016-05-22, 14:53


mtm

</3






Wiek: 26
Na forum: 3715 dni
Posty: 181

Piwa: 252

Respekt: 70

problem taki, zaczerpn??em kod od XyzzyRP? tak to si? nazywa?o, mniejsza.
--[[
@author Lukasz Biegaj <wielebny@bestplay.pl>
@copyright 2011-2013 Lukasz Biegaj <wielebny@bestplay.pl>
@license Dual GPLv2/MIT
]]--

local T_OPIS="Trwa pobieranie zasobow serwera"

intro_watchers={}

addEventHandler "onPlayerJoin"getRootElement(), function()
    showPlayerHudComponent(source"all"false)
    showChat(sourcefalse)
    intro_watchers[source]={}

    intro_watchers[source].introTextDisplay textCreateDisplay()
    intro_watchers[source].serverText={}
    intro_watchers[source].serverText[1] = textCreateTextItem ""0.50.12255,255,2552553.0"center""center",127 )    -- create a text item for the display

    textDisplayAddText intro_watchers[source].introTextDisplayintro_watchers[source].serverText[1] )

    intro_watchers[source].serverText[2] = textCreateTextItem (  T_OPIS0.50.52255,255,2552551.2"center""center",127 )    -- create a text item for the display
    textDisplayAddText intro_watchers[source].introTextDisplayintro_watchers[source].serverText[2] )

    fadeCamera(sourcetrue)
    textDisplayAddObserver intro_watchers[source].introTextDisplaysource )
end)

function onResourcesDownloaded()
--    intro_watchers[client]=nil
    if (intro_watchers[source]) then
        textDisplayRemoveObserver intro_watchers[source].introTextDisplaysource )
        introRemoveWatcher(source)
        onPlayerDownloadFinished(source)
    end
end
addEvent("onResourcesDownloaded"true)
addEventHandler("onResourcesDownloaded"getRootElement(), onResourcesDownloaded)

function introRemoveWatcher(plr)
    textDestroyTextItem(intro_watchers[plr].serverText[1])
    textDestroyTextItem(intro_watchers[plr].serverText[2])
    textDestroyTextItem(intro_watchers[plr].serverText[3])
    textDestroyDisplay(intro_watchers[plr].introTextDisplay)
    intro_watchers[plr]=nil
    showPlayerHudComponent(plr,"all",true)
    fadeCamera(plr,true)
    showChat(plrtrue)
end

addEventHandler "onPlayerQuit"getRootElement(), function()
    if (intro_watchers[source] and intro_watchers[source].introTextDisplaythen
        textDestroyTextItem(intro_watchers[source].serverText[1])
        textDestroyTextItem(intro_watchers[source].serverText[2])
        textDestroyTextItem(intro_watchers[source].serverText[3])
        textDestroyDisplay(intro_watchers[source].introTextDisplay)
    end
    intro_watchers[source]=nil
end)

fakt jest taki ?e on nie znika, plik znajduje si? w folderze gamemodes gdzie trzymam praktycznie wszystkie zasoby serwera

[ Dodano: 2016-05-22, 14:53 ]
?adnych b??d?w ani nic, co nie.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-05-25, 01:05


Prezes.







Wiek: 27
Na forum: 4370 dni
Posty: 75
Nick w MP: Prezes.

Piwa: 17

Respekt: 60

Sprawd? czy masz zas?b lss-gui dodatkowo sprawd? czy wog?le posiadasz t? funkcj?.

https://github.com/lpiob/MTA-XyzzyRP/blob/db3a20296b90635ee557de8f2719e3fb4c3aa7b6/resources/%5BXyzzyRP%5D/lss-gui/gui_c_.lua#L341-352

Skrypt Ci nie triggeruje eventu 'onResourcesDownloaded'.

Postaw piwo autorowi tego posta
 

 
Tagi: pobieranie :: zasobów :: serwera
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » pobieranie zasobów serwera Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku