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

Wysłany: 2019-07-24, 22:45


killercycDDS

Migacz






Wiek: 25
Na forum: 4512 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1659

Respekt: 22

Witam posiadam dwa problemy
[19-07-24 22:37] ERROR: busty/bust_s.lua:20: attempt to compare boolean with number
[19-07-24 22:37] WARNING: busty/bust_s.lua:20: Bad argument @ 'getElementData' [Expected element at argument 1, got string 'down']


function setbustrpday(plr,days)
    if getbustday(plrthen
    local queryA=exports['pystories-db']:dbSet(string.format("UPDATE pystories_users SET bust_rp = DATE(bust_rp) + INTERVAL %d DAY WHERE id=%d",days,getElementData(plr,"player:sid")))
    return end
    local queryA=exports['pystories-db']:dbSet(string.format("UPDATE pystories_users SET bust_rp = DATE(curdate()) + INTERVAL %d DAY WHERE id=%d",days,getElementData(plr,"player:sid")))      
end

function getbustday(plr)
    local queryA=exports['pystories-db']:dbGet("SELECT * FROM pystories_users WHERE id=? AND bust_rp>NOW() LIMIT 1"getElementData(plr,"player:sid"))
    if (queryA and #queryA > 0) then
        return queryA[1].bust_rp
    end
    return false    
end

addEvent("dajbusta"true)
addEventHandler("dajbusta"resourceRoot, function(dni,plr,value)
if getElementData(plr,"player:pktgry") == 10 then triggerClientEvent(plr'onClientAddNotification'plr"Kupi?e? busta RP na 1 dzie? "'succes')--linijka 18
else
if not getElementData(plr,"player:pktgry")<10 then triggerClientEvent(plr'onClientAddNotification'plr"Nie posiadasz odpowiedniej sumy punkt?w gry by to kupi? "'error')--linijka 20
return end
local value 10
setElementData(plr,"player:pktgry"getElementData(plr,"player:pktgry")-value)
setbustrpday(plr,1)
triggerEvent("save:player",root,plr)
triggerEvent("load:player",root,plr)
--setElementData(plr,"player:bustrp",true)
end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-07-24, 23:48


Eitho







Wiek: 24
Na forum: 3489 dni
Posty: 330
Nick w MP: Eitho

Piwa: 746

Respekt: 256,5
Respekt: 256,5Respekt: 256,5Respekt: 256,5

1.
Kod:

[19-07-24 22] WARNING: busty/bust_s.lua:20: Bad argument @ 'getElementData' [Expected element at argument 1, got string 'down']

?le uzupe?nione argumenty w funkcji triggerServerEvent po stronie klienta. Zamiast przesy?a? w drugim argumencie zmienn? gracza (jak po stronie klienta to i zapewne localPlayer wystarczy wpisa?), to przesy?a string "down".




2.
Kod:

[19-07-24 22] ERROR: busty/bust_s.lua:20: attempt to compare boolean with number

Ten b??d jest powi?zany z b??dem powy?ej.
if not getElementData(plr,"player:pktgry")<10 then
Je?li argumentem nie jest gracz, funkcja zwraca false i ostatecznie wygl?da tak:
if not false<10 then
Nie da si? por?wna? boolean (true/false) z liczb?, dlatego wyrzuca taki b??d.




Podsumowuj?c, popraw funkcj? triggerServerEvent po stronie klienta.

Postaw piwo autorowi tego posta
 

 
Tagi: attempt :: compare :: boolean :: with :: number :: expected :: element :: at]
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