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

Wysłany: 2018-08-22, 14:43


Norbert1234

Nie umiem w LUA






Wiek: 22
Na forum: 3987 dni
Posty: 319
Nick w MP: Gusterowskyy

Piwa: 242

Respekt: 60

addEventHandler("onPlayerLogin",getRootElement(),function()
    local query exports["dbConnect"]:GdbQuery("SELECT * FROM  `players` WHERE Login LIKE '"..tostring(getAccountName(getPlayerAccount(source))).."'")
    local results exports["dbConnect"]:GdbPoll(query,-1)
    if results then
        for i,v in ipairs(results) do
            if getAccountName(getPlayerAccount(source))==v["Login"then
                local cid v["CID"]
                local money v["Money"]
                local peanuts v["Peanuts"]
                local LP v["LP"]
                local clothes v["Clothes"]
                local fraction v["fraction"]
                local lifecoints v["LifeCoints"]
                local bankmoney v["Bankmoney"]
                local premium_hours v["Premium_hours"]
                if fraction == "" then fraction false end
                
                --- PREMIUM
                
                -- INNE
                
                
                
                if money 0 then money 0 end
                if peanuts 0 then peanuts 0 end
                if LP 0 then LP 0 end
                if clothes 400 then clothes 0 end
                
                setElementData(source,"CID",tonumber(cid))
                setElementData(source,"onlinePlayer",true)
                setElementData(source,"login",getAccountName(getPlayerAccount(source)))
                
                setPlayerMoney(source,tonumber(money))
                setElementData(source"Bankmoney"bankmoney)
                setElementData(source,"pln",tonumber(money))
                setElementData(source,"gr",tonumber(peanuts))
                setElementData(source,"clothes",tonumber(clothes))
                
                setElementModel(source,tonumber(clothes))
                
                setElementData(source,"LC",tonumber(lifecoints))


Co? ?le jest ? Bo nie zapisuje. A wszystko jest w sql

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-22, 17:18


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

bledy db3

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-22, 18:32


Norbert1234

Nie umiem w LUA






Wiek: 22
Na forum: 3987 dni
Posty: 319
Nick w MP: Gusterowskyy

Piwa: 242

Respekt: 60

W?a?nie nie ma ?adnych, gdzie? musi by? malutki b??d :P

[ Dodano: 2018-08-22, 19:19 ]
No faktem jest, ?e nie zapisuje skina, z reszt? sobie jak na razie poradzi?em a nad skinem g??wkuje :o

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-22, 20:31


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

poka? zrzut ekranu tej tabeli, z tej bazy danych

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-22, 21:01


Norbert1234

Nie umiem w LUA






Wiek: 22
Na forum: 3987 dni
Posty: 319
Nick w MP: Gusterowskyy

Piwa: 242

Respekt: 60

https://imgur.com/ZQvxAZc Wiem s? inne nazwy tylko tam usun??em, ?eby by?o niewiadomo z jakiej paczki sorki, normalnie jest to co w bazie tutaj.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-22, 21:05


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Jest taki warunek jak:
if clothes 400 then clothes 0 end
Czyli, je?eli skin w MySQL mia?e? mniejszy ni? 400 to ustawia?o Ci skin o ID 0.

Wystarczy usun?? ten warunek i wszystko powinno dzia?a?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-22, 21:09


Norbert1234

Nie umiem w LUA






Wiek: 22
Na forum: 3987 dni
Posty: 319
Nick w MP: Gusterowskyy

Piwa: 242

Respekt: 60

Ale zrobi? tak :

if clothes 400 then clothes 0 end


czy usuna? ca?? linijke?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-22, 21:09


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Norbert1234, mo?esz i tak zrobi? lub usun?? t? linijk? - to tw?j wyb?r

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Norbert1234
Tagi: nie :: zapisuje :: sql
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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