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

Wysłany: 2019-09-15, 18:52


Szyszka947

ASP NET Core / Lua






Wiek: 19
Na forum: 2579 dni
Posty: 288

Piwa: 16

Respekt: 90

Elko, wie ktos moze jak mam dodac element date do scoreboard? W sensie chce zrobic kolumne o nazwie np "kasa", i w tej kolumnie ma sie pokazywac ilosc moich pienionszkow ktore sa zapisanie w dacie np. "kasa". Jak to zrobic? Ktos cos? (:

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-09-15, 18:57


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

https://wiki.multitheftauto.com/wiki/Resource:Dxscoreboard
Robisz export do funkcji scoreboardAddColumn.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-09-15, 19:09


Szyszka947

ASP NET Core / Lua






Wiek: 19
Na forum: 2579 dni
Posty: 288

Piwa: 16

Respekt: 90

O tym to i ja wiem, jakis przyklad?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-09-15, 19:40


Pawel5321

Szkrypter






Wiek: 36
Na forum: 3809 dni
Posty: 237
Nick w MP: Pawell

Piwa: 2315

Respekt: 240
Respekt: 240Respekt: 240

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-09-15, 20:19


Szyszka947

ASP NET Core / Lua






Wiek: 19
Na forum: 2579 dni
Posty: 288

Piwa: 16

Respekt: 90

A jakis taki dokladniejszy, taki dla niziny spolecznej-czarnej masy? Taki jakis pode mnie? XD

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-09-15, 20:33


Pawel5321

Szkrypter






Wiek: 36
Na forum: 3809 dni
Posty: 237
Nick w MP: Pawell

Piwa: 2315

Respekt: 240
Respekt: 240Respekt: 240


call(getResourceFromName("scoreboard"), "addScoreboardColumn""kasa")


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-09-15, 20:59


Szyszka947

ASP NET Core / Lua






Wiek: 19
Na forum: 2579 dni
Posty: 288

Piwa: 16

Respekt: 90

Too wiem, ale dalej jeszcze, zeby sie pokazywala ta data

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-09-15, 21:12


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Tu jest ju? wszystko podane, masz tylko u?y? m?zgu i przeczyta? ca?e wiki, kt?re wys?a?em.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-09-16, 16:00


Szyszka947

ASP NET Core / Lua






Wiek: 19
Na forum: 2579 dni
Posty: 288

Piwa: 16

Respekt: 90

Zrobi?em co? takiego:

call(getResourceFromName("scoreboard"), "scoreboardAddColumn""Respekt")

addEventHandler("onClientRender"root,
    function ()
        aktualny_lvl = (getElementData(source"Level") or 0)
        setElementData(localPlayer"Level"tonumber(aktualny_lvl))
    end
)

Tworzy sie kolumna o nazwie Respekt, ale elementdata juz nie, co jest zzrobione zle?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-09-16, 16:26


Pawel5321

Szkrypter






Wiek: 36
Na forum: 3809 dni
Posty: 237
Nick w MP: Pawell

Piwa: 2315

Respekt: 240
Respekt: 240Respekt: 240


call(getResourceFromName("scoreboard"), "scoreboardAddColumn""Respekt")

addEventHandler("onClientRender"root,
    function ()
        aktualny_lvl = (getElementData(source"Respekt") or 0)
        setElementData(localPlayer"Respekt"tonumber(aktualny_lvl))
    end
)

tylko onClientRender to funkcja csie a call() to funkcja sside

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-09-16, 16:54


Szyszka947

ASP NET Core / Lua






Wiek: 19
Na forum: 2579 dni
Posty: 288

Piwa: 16

Respekt: 90

Wiec jak to inaczej zrobic?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-09-16, 17:05


Pawel5321

Szkrypter






Wiek: 36
Na forum: 3809 dni
Posty: 237
Nick w MP: Pawell

Piwa: 2315

Respekt: 240
Respekt: 240Respekt: 240


call(getResourceFromName("scoreboard"), "scoreboardAddColumn""Respekt")

setTimer(
    function ()
        aktualny_lvl = (getElementData(source"Respekt") or 0)
        setElementData(localPlayer"Respekt"tonumber(aktualny_lvl))
    end,1000,0)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-09-16, 17:19


Szyszka947

ASP NET Core / Lua






Wiek: 19
Na forum: 2579 dni
Posty: 288

Piwa: 16

Respekt: 90

Nie dzia?a :/ Linijka w ktorej jest blad: (w db3 sie pokaazuje ze cos w argumencie 1)

setElementData(localPlayer"Level"tonumber(aktualny_lvl))


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-09-16, 17:23


Pawel5321

Szkrypter






Wiek: 36
Na forum: 3809 dni
Posty: 237
Nick w MP: Pawell

Piwa: 2315

Respekt: 240
Respekt: 240Respekt: 240

call(getResourceFromName("scoreboard"), "scoreboardAddColumn", "Respekt")

setTimer(
function ()
local players = getElementsByType ( "player" )
for theKey,pl in ipairs(players) do
aktualny_lvl = (getElementData(pl, "Respekt") or 0)
setElementData(pl, "Respekt", tonumber(aktualny_lvl))
end
end,1000,0)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-09-16, 17:42


Szyszka947

ASP NET Core / Lua






Wiek: 19
Na forum: 2579 dni
Posty: 288

Piwa: 16

Respekt: 90

nope, nie dziala

Postaw piwo autorowi tego posta
 

 
Tagi: scoreboard
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » scoreboard Odpowiedz do tematu

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