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

Wysłany: 2018-07-05, 23:32


Ognisty_12877







Wiek: 24
Na forum: 3033 dni
Posty: 52
Nick w MP: Delti

Piwa: 1

Respekt: 60

pisze ze 0 i jakis blad wywala

[ Dodano: 2018-07-05, 23:39 ]
a nil value

[ Dodano: 2018-07-05, 23:40 ]
a nie sory nie ma b??du to co innego by?o pisze tlko ?e 0 na chacie i nic wi?cej

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-07-06, 00:23


amited







Wiek: 26
Na forum: 3855 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466

No 0 czyli data jest. Zabij kilka typ?w i sprawd? znowu no i zr?b to o co prosi?em w poprzednim po?cie

Podpis
"amited" napisał/a:
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 2 piw(a):
HeviK*, Ognisty_12877
Wysłany: 2018-07-06, 00:31


Ognisty_12877







Wiek: 24
Na forum: 3033 dni
Posty: 52
Nick w MP: Delti

Piwa: 1

Respekt: 60

Zabilem z 20 razy typa pokaza?o ze zabilem go 20 ale nie wszystkich zabojstwach tylko w tych na jdnym zyciu, a tak to dalej pokazuje 0

[ Dodano: 2018-07-06, 00:39 ]
Zrobilem tak ze zamiast totalkillsdeaths.Kills dalem samo kills poczym sprawdzilem komenda pokazalo ze a jednak nie ma zreconnectowa?em i pokazuje 0, zabijam gracza i mam dalej 0

[ Dodano: 2018-07-06, 00:41 ]
Teraz tak mam

addEventHandler ( "onPlayerWasted", root,
function( totalAmmo, killer, killerWeapon, bodypart, stealth )
    if killer then
        local account = getPlayerAccount (killer)
        if killer ~= source then
            local data = getAccountData(account,"Kills")
            if data then
                setAccountData(account,"Kills",data+1)
            else
                setAccountData(account,"Kills",1)
            end
        end 
    end
end)

addEventHandler( "onPlayerLogin",root,
function( thePreviousAccount, theCurrentAccount, autoLogin )
    local account = getPlayerAccount ( source )
    local data = getAccountData( account,"Kills" )
    if not data then
        setAccountData( account,"Kills",0 )
        else
        setAccountData( account,"Kills",data)
    end
end)

function Sprawdzenie(plr,cmd)
    local account = getPlayerAccount(plr)
    local data = getAccountData(account, "Kills") or "a jednak nie ma..."
    for i, v in ipairs(getElementsByType("player")) do
        outputChatBox(data,v)
    end    
end
addCommandHandler("sprawdz",Sprawdzenie)


[ Dodano: 2018-07-06, 13:06 ]
want now ?

[ Dodano: 2018-07-06, 14:05 ]
Zrobi?em tak? funkcj? w kt?rej moge zmienic np wszystkie dedy i zabojstwa ale jak zabije gracza to sie nie zapisuje jakby sie nie dodawa?o do daty pomocy! :(




function SetKills(player,cmd,playername,kills)
if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(player)), aclGetGroup("Admin")) then  
    if playername and kills then
      local player2 = findPlayerByName(playername)
      if player2 then
       if tonumber(kills) and tonumber(kills) >= 1 then
       setElementData( player2, "Kills",tonumber(kills))
           setAccountData ( getPlayerAccount (player2), "totalkillsdeaths.Kills", tonumber(kills))
       end
      end
    end
end
end
addCommandHandler("setk",SetKills)

function SetDeaths(player,cmd,playername,deaths)
if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(player)), aclGetGroup("Admin")) then  
    if playername and deaths then
      local player2 = findPlayerByName(playername)
      if player2 then
       if tonumber(deaths) and tonumber(deaths) >= 1 then
       setElementData( player2, "Deaths",tonumber(deaths))
           setAccountData ( getPlayerAccount (player2), "totalkillsdeaths.Deaths", tonumber(deaths))

       end
      end
    end
end
end
addCommandHandler("setd",SetDeaths)



function findPlayerByName (name)
    local player = getPlayerFromName(name)
    if player then return player end
    for i, player in ipairs(getElementsByType("player")) do
        if string.find(string.gsub(getPlayerName(player):lower(),"#%x%x%x%x%x%x", ""), name:lower(), 1, true) then
            return player
        end
    end
return false
end



addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),
    function()
        call(getResourceFromName("scoreboard"),"addScoreboardColumn","Kills", getRootElement(), 3, 43)
        call(getResourceFromName("scoreboard"),"addScoreboardColumn","Deaths", getRootElement(), 4, 45)
        call(getResourceFromName("scoreboard"),"addScoreboardColumn","Ratio", getRootElement(), 5, 30)
    end
)


[ Dodano: 2018-07-06, 17:37 ]
??

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-07-06, 19:09


HeviK*







Wiek: 29
Na forum: 3157 dni
Posty: 34

Piwa: 2

Respekt: 40,5

Ma ktos jakis pomysl ??
Pisze za pro?b? ognistego.

[ Dodano: 2018-07-08, 17:24 ]
Naprawde nikt nic ? :(

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-07-11, 21:09


Ognisty_12877







Wiek: 24
Na forum: 3033 dni
Posty: 52
Nick w MP: Delti

Piwa: 1

Respekt: 60

Ref.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-07-14, 12:25


HeviK*







Wiek: 29
Na forum: 3157 dni
Posty: 34

Piwa: 2

Respekt: 40,5

Ref. nadal nie zrobili?my tego ;/ prosz? tylko to i tyle

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-07-14, 14:50


_jvneczek







Wiek: 22
Na forum: 4467 dni
Posty: 1509
Nick w MP: _jvneczek

Piwa: 3960

Respekt: 337,5
Respekt: 337,5Respekt: 337,5Respekt: 337,5

Zr?bcie to pod baze danych mysql albo sql, ale lepsze mysql, tylko logowanie tez musi by? pod mysql i do tabeli z logowania, dodajecie kille i przy logowaniu po prostu b?dzie je wczytywac.

Podpis

Support Team: 04.10.2020 - 01.09.2020
Test Moderator: 03.05.2021 - 01.09.2021
Moderator: 01.09.2021 - 23.10.2021

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-07-15, 08:15


HeviK*







Wiek: 29
Na forum: 3157 dni
Posty: 34

Piwa: 2

Respekt: 40,5

Mamy zapis na serial w logowaniu ale on zapisuje sie do bazy nie Mysql tylko pliku .db i probowalismy nawet tak zrobic to i nie wyszlo.

Postaw piwo autorowi tego posta
 

 
Tagi: zapis :: wszystkich :: killi :: ref.
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Zapis wszystkich killi ref. 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