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

Wysłany: 2014-06-19, 23:44


Maximerr

Programmer PHP, LUA






Wiek: 25
Na forum: 4427 dni
Posty: 548

Piwa: 1051

Respekt: 365,3
Respekt: 365,3Respekt: 365,3Respekt: 365,3Respekt: 365,3

Cze?? GTAonline'owcy. Mam pewien problem. Chcia?bym zamieni? kolumn? Score na napszyk?ad Punkty. Je?li zamieniam z
(getResourceFromName("scoreboard"), "addScoreboardColumn""Score")
na
(getResourceFromName("scoreboard"), "addScoreboardColumn""Punkty")
To nie dzia?a ;/
Za pomoc :piwo:

KOD Skryptu:

addEventHandler('onResourceStart',getResourceRootElement(),
function()
   call(getResourceFromName("scoreboard"), "addScoreboardColumn""Punkty")
    for theKey,thePlayer in ipairs(getElementsByType "player" )) do
        setElementData(thePlayer,"Score",0)
    setElementData(thePlayer,"Kasa",0)
    end
end)

addEventHandler('onPlayerJoin',getRootElement(),
function()

    setElementData(source,"Score",0)
    setElementData(source,"Kasa",0)
end)

function addScore(points)
    setElementData(source"points"getElementData(source"points") + points)
    setElementData(source"money"getPlayerMoney(getLocalPlayer()))
end

addEvent("addScore"true)
addEventHandler("addScore"getRootElement(), addScore)
---------dawanie score

addCommandHandler "dajscoreg",
function ( playercmdnickkwota )


        if nick and kwota then
            local aplayer getPlayerFromName nick )
            if aplayer then
                kwota tonumber(kwota)
           
                    setElementData(aplayer,"Score",kwota)
                    --givePlayerMoney aplayerkwota )
        outputDebugString "[POINTS]Points dodane." )

else
      outputChatBox"[POINTS]Nie jeste? adminem."getRootElement())   
    outputDebugString "[POINTS]Nieudana pr?ba dodania points." )

end 
end
end )


Kod odpowiadaj?cy za zapis score(Tutaj daj?, na wszelki wypadek):

function onPlayerLogin ()
        local playeraccount getPlayerAccount source )
        if ( playeraccount then
                if not isGuestAccount playeraccount then
                        local playerpkt getAccountData playeraccount"points" )
                        --local playermoney getAccountData playeraccount"s.HandMoney" )
            --setPlayerMoneygetRootElement(), playermoney )
                        if ( playerpkt then
                                setElementData(source"Score"tonumber(playerpkt))
                                --setElementData(source"Kasa"tonumber(playermoney))
                --setPlayerMoneygetRootElement(), playermoney )

                        end
                end
        end
end

function onPlayerQuit ()
        local playeraccount getPlayerAccount source )
        if ( playeraccount then
                if not isGuestAccount playeraccount then
                        local playerpkt getElementData source"Score" )
                       -- local playermoney getPlayerMoney(source)
            --setAccountData playeraccount"s.HandMoney"playermoney )
                        if ( playerpkt then
                                setAccountData playeraccount"points"playerpkt )
                               -- setAccountData playeraccount"s.HandMoney"playermoney )
                        end
                end
        end
end

addEventHandler "onPlayerLogin"getRootElement (), onPlayerLogin )
addEventHandler "onPlayerQuit"getRootElement (), onPlayerQuit )
addEventHandler ("onResourceRestart"getRootElement (), onPlayerQuit )
addEventHandler ("onResourceStop"getRootElement (), onPlayerQuit )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-06-19, 23:48


KukiX







Wiek: 34
Na forum: 6718 dni
Posty: 567

Piwa: 17560

Respekt: 160
Respekt: 160Respekt: 160

Tam gdzie masz np.
setElementData(thePlayer,"Score",0)

Zmie? na:
setElementData(thePlayer,"Punkty",0)


Podpis
Moje skrypty MTA:
¤PlayDM
¤Mini-Games v0.2
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-06-19, 23:48


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4394 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

[...]"addScoreboardColumn""Score")



Co to jest ?

[ Dodano: 2014-06-19, 23:50 ]
Aha dobra ju? wiem nie wczyta?em si? w kod.

[ Dodano: 2014-06-19, 23:51 ]
Zamie? w ca?ym kodzie "Score" na "Punkty".

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Tagi: tabelka :: 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 » Tabelka w ScoreBoard 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