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

Wysłany: 2018-08-07, 11:14


DylemaT929

Nikt






Wiek: 28
Na forum: 4041 dni
Posty: 333
Nick w MP: dylemat929

Piwa: 3195

Respekt: 165,8
Respekt: 165,8Respekt: 165,8

Tak jak w temacie mam znowu problem z zapisywaniem statystyk do bazy danych. Chodzi o to ?e wszystko si? zapisuje. Tylko jak by to uj?? jak kto? straci internet albo wyjdzie z serwera(przy ka?dym wyj?ciu zapisuje albo i nie zapisuje) to nie zapisuj? mu si? ale zeruj?. Teraz nagle pojawi? si? ten problem wcze?niej go naprawi?em.


Zas?b OGRPG.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-07, 11:20


turbonet

Kradnę kody uważaj :)






Wiek: 28
Na forum: 2903 dni
Posty: 30
Nick w MP: AJgorEx

Piwa: 464

Respekt: 50

Jakie? b??dy w db3?

Podpis
[lua]
Napisał bym tu coś ale nie umiem...
[/lua]
Postaw piwo autorowi tego posta
 

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


DylemaT929

Nikt






Wiek: 28
Na forum: 4041 dni
Posty: 333
Nick w MP: dylemat929

Piwa: 3195

Respekt: 165,8
Respekt: 165,8Respekt: 165,8

"turbonet" napisał/a:

Jakie? b??dy w db3?


Brak jakichkolwiek. Przy ka?dym wyj?ciu z serwera mam zapis do bazy danych. Jak staje si? taki problem to zamiast "zapis" pokazuje si? "error" albo nie pokazuje ?e mu zapisa?o w logach

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-07, 11:22


turbonet

Kradnę kody uważaj :)






Wiek: 28
Na forum: 2903 dni
Posty: 30
Nick w MP: AJgorEx

Piwa: 464

Respekt: 50

Masz modu??

Podpis
[lua]
Napisał bym tu coś ale nie umiem...
[/lua]
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-07, 11:23


eject

kurdebele






Wiek: 30
Na forum: 3659 dni
Posty: 182
Nick w MP: EjecT

Piwa: 2456

Respekt: 85,8

Ostrzeżeń: 60%
Usu? wykonywanie savePlayer przy wyjsciu i zastosuj m?j kod zapisu wykonany dla eastcity

function hook_givePlayerMoneysourceResourcefunctionNameisAllowedByACLluaFilenameluaLineNumber, ... )
    local args = { ... }
    local plr args[1]
    local money args[2]
    local monety exports['ogrpg-db']:dbGet("select * from ogrpg_users where id=?",getElementData(plr,"player:uid"))
    local ile monety[1]['money'] + money
    exports['ogrpg-db']:dbSet('update ogrpg_users set money=? where id=?',ile,getElementData(plr,"player:uid"))
end
addDebugHook"postFunction"hook_givePlayerMoney, {"givePlayerMoney"})
 
function hook_takePlayerMoneysourceResourcefunctionNameisAllowedByACLluaFilenameluaLineNumber, ... )
    local args = { ... }
    local plr args[1]
    local money args[2]
    local monety exports['ogrpg-db']:dbGet("select * from ogrpg_users where id=?",getElementData(plr,"player:uid"))
    local ile monety[1]['money'] - money
    exports['ogrpg-db']:dbSet('update ogrpg_users set money=? where id=?',ile,getElementData(plr,"player:uid"))
end
addDebugHook"postFunction"hook_takePlayerMoney, {"takePlayerMoney"})
 
function hook_setPlayerMoneysourceResourcefunctionNameisAllowedByACLluaFilenameluaLineNumber, ... )
    local args = { ... }
    local plr args[1]
    local money args[2]
    exports['ogrpg-db']:dbSet('update ogrpg_users set money=? where id=?',money,getElementData(plr,"player:uid"))
end
addDebugHook"postFunction"hook_setPlayerMoney, {"setPlayerMoney"})
 
function hook_setElementDatasourceResourcefunctionNameisAllowedByACLluaFilenameluaLineNumber, ... )
   local args = {...}
   if args[2] == "player:reputation" then
        local ile args[3]
        local plr args[1]
        exports['ogrpg-db']:dbSet('update ogrpg_users set reputation=? where id=?',ile,getElementData(plr,"player:uid"))
   end
    if args[2] == "player:workinjob" then
        local ile args[3]
        local plr args[1]
        exports['ogrpg-db']:dbSet('update ogrpg_users set worker=? where id=?',ile,getElementData(plr,"player:uid"))
   end
    if args[2] == "player:hours" then
        local ile args[3]
        local plr args[1]
        exports['ogrpg-db']:dbSet('update ogrpg_users set hours=hours+? where id=?',ile,getElementData(plr,"player:uid"))
   end
    if args[2] == "player:license:pjA" then
        local ile args[3]
        local plr args[1]
        exports['ogrpg-db']:dbSet('update ogrpg_users set hours=? where id=?',ile,getElementData(plr,"player:uid"))
   end
    if args[2] == "player:license:pjB" then
        local ile args[3]
        local plr args[1]
        exports['ogrpg-db']:dbSet('update ogrpg_users set hours=? where id=?',ile,getElementData(plr,"player:uid"))
   end
    if args[2] == "player:license:pjC" then
        local ile args[3]
        local plr args[1]
        exports['ogrpg-db']:dbSet('update ogrpg_users set hours=? where id=?',ile,getElementData(plr,"player:uid"))
   end
    if args[2] == "player:license:pjL" then
        local ile args[3]
        local plr args[1]
        exports['ogrpg-db']:dbSet('update ogrpg_users set hours=? where id=?',ile,getElementData(plr,"player:uid"))
   end
end
addDebugHook"postFunction"hook_setElementData, {"setElementData"})


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-07, 11:23


turbonet

Kradnę kody uważaj :)






Wiek: 28
Na forum: 2903 dni
Posty: 30
Nick w MP: AJgorEx

Piwa: 464

Respekt: 50

XD Chcia?em da? m?j kod

Podpis
[lua]
Napisał bym tu coś ale nie umiem...
[/lua]
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-07, 11:25


DylemaT929

Nikt






Wiek: 28
Na forum: 4041 dni
Posty: 333
Nick w MP: dylemat929

Piwa: 3195

Respekt: 165,8
Respekt: 165,8Respekt: 165,8

"turbonet" napisał/a:

XD Chcia?em da? m?j kod


wszystkie modu?y mam. nie uwa?aj mnie za zielonego bo mam sw?j serwer to wiem co i jak. Tylko ten zapis jest okropny ;d co jest w saveplayers

[ Dodano: 2018-08-07, 11:45 ]
"eject" napisał/a:

Usu? wykonywanie savePlayer przy wyjsciu i zastosuj m?j kod zapisu wykonany dla eastcity

function hook_givePlayerMoneysourceResourcefunctionNameisAllowedByACLluaFilenameluaLineNumber, ... )
    local args = { ... }
    local plr args[1]
    local money args[2]
    local monety exports['ogrpg-db']:dbGet("select * from ogrpg_users where id=?",getElementData(plr,"player:uid"))
    local ile monety[1]['money'] + money
    exports['ogrpg-db']:dbSet('update ogrpg_users set money=? where id=?',ile,getElementData(plr,"player:uid"))
end
addDebugHook"postFunction"hook_givePlayerMoney, {"givePlayerMoney"})
 
function hook_takePlayerMoneysourceResourcefunctionNameisAllowedByACLluaFilenameluaLineNumber, ... )
    local args = { ... }
    local plr args[1]
    local money args[2]
    local monety exports['ogrpg-db']:dbGet("select * from ogrpg_users where id=?",getElementData(plr,"player:uid"))
    local ile monety[1]['money'] - money
    exports['ogrpg-db']:dbSet('update ogrpg_users set money=? where id=?',ile,getElementData(plr,"player:uid"))
end
addDebugHook"postFunction"hook_takePlayerMoney, {"takePlayerMoney"})
 
function hook_setPlayerMoneysourceResourcefunctionNameisAllowedByACLluaFilenameluaLineNumber, ... )
    local args = { ... }
    local plr args[1]
    local money args[2]
    exports['ogrpg-db']:dbSet('update ogrpg_users set money=? where id=?',money,getElementData(plr,"player:uid"))
end
addDebugHook"postFunction"hook_setPlayerMoney, {"setPlayerMoney"})
 
function hook_setElementDatasourceResourcefunctionNameisAllowedByACLluaFilenameluaLineNumber, ... )
   local args = {...}
   if args[2] == "player:reputation" then
        local ile args[3]
        local plr args[1]
        exports['ogrpg-db']:dbSet('update ogrpg_users set reputation=? where id=?',ile,getElementData(plr,"player:uid"))
   end
    if args[2] == "player:workinjob" then
        local ile args[3]
        local plr args[1]
        exports['ogrpg-db']:dbSet('update ogrpg_users set worker=? where id=?',ile,getElementData(plr,"player:uid"))
   end
    if args[2] == "player:hours" then
        local ile args[3]
        local plr args[1]
        exports['ogrpg-db']:dbSet('update ogrpg_users set hours=hours+? where id=?',ile,getElementData(plr,"player:uid"))
   end
    if args[2] == "player:license:pjA" then
        local ile args[3]
        local plr args[1]
        exports['ogrpg-db']:dbSet('update ogrpg_users set hours=? where id=?',ile,getElementData(plr,"player:uid"))
   end
    if args[2] == "player:license:pjB" then
        local ile args[3]
        local plr args[1]
        exports['ogrpg-db']:dbSet('update ogrpg_users set hours=? where id=?',ile,getElementData(plr,"player:uid"))
   end
    if args[2] == "player:license:pjC" then
        local ile args[3]
        local plr args[1]
        exports['ogrpg-db']:dbSet('update ogrpg_users set hours=? where id=?',ile,getElementData(plr,"player:uid"))
   end
    if args[2] == "player:license:pjL" then
        local ile args[3]
        local plr args[1]
        exports['ogrpg-db']:dbSet('update ogrpg_users set hours=? where id=?',ile,getElementData(plr,"player:uid"))
   end
end
addDebugHook"postFunction"hook_setElementData, {"setElementData"})


zmieni?em zobaczymy jak teraz b?dzie

Postaw piwo autorowi tego posta
 

 
Tagi: zapisywanie :: statystyk
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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