Mamikey Posted December 1, 2020 Posted December 1, 2020 addCommandHandler("vipsurem",function(plr) if plr:getData("loggedin") == 1 then if plr:getData("vip") <= 0 then plr:outputChat("[!]#ffffff Vip değilsiniz.",255,0,0,true) return end local dbid = getElementData(plr, "dbid") local remainingSeconds = secondsToTimeDesc(math.ceil(plr:getData("vip_zaman")/10000000000)) plr:outputChat("[!]#ffffff "..remainingSeconds.." sonra sona erecek.", 100,100,255,true) end end) please help me fix it..
Moderators Patrick Posted December 1, 2020 Moderators Posted December 1, 2020 (edited) plr:getData("vip_zaman") returns nil/false/true and you can't divide a boolean by a number. Edited December 1, 2020 by Patrick
Mamikey Posted December 1, 2020 Author Posted December 1, 2020 @Patrick I understand, Brother, Can you throw me the corrected version of the line?
Moderators Patrick Posted December 1, 2020 Moderators Posted December 1, 2020 20 minutes ago, Mamikey said: @Patrick I understand, Brother, Can you throw me the corrected version of the line? The problem is somewhere else where you set this element data, here you can do only a value check. addCommandHandler("vipsurem",function(plr) if plr:getData("loggedin") == 1 then if plr:getData("vip") <= 0 then plr:outputChat("[!]#ffffff Vip değilsiniz.",255,0,0,true) return end local dbid = getElementData(plr, "dbid") local zaman = plr:getData("vip_zaman") if zaman and tonumber(zaman) then -- is it a number? local remainingSeconds = secondsToTimeDesc(math.ceil(tonumber(zaman)/10000000000)) plr:outputChat("[!]#ffffff "..remainingSeconds.." sonra sona erecek.", 100,100,255,true) end end end)
Mamikey Posted December 1, 2020 Author Posted December 1, 2020 @Patrick sorry, man, I threw you the wrong codes.. the codes below were original. Can you fix me this line? addCommandHandler("vipsurem",function(plr) if plr:getData("loggedin") == 1 then if plr:getData("vip") <= 0 then plr:outputChat("[!]#ffffff Vip değilsiniz.",255,0,0,true) return end local dbid = getElementData(plr, "dbid") local remainingSeconds = secondsToTimeDesc(math.ceil(getTimerDetails(tablo[dbid].sayac)/1000)) plr:outputChat("[!]#ffffff "..remainingSeconds.." sonra sona erecek.", 100,100,255,true) end end)
Mamikey Posted December 1, 2020 Author Posted December 1, 2020 @Patrick at the same time, it is not reflected in chat, although it does not give an error in the line that you corrected.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now