Jump to content

fromJSON


Recommended Posts

This system fractions and is 85 lines, not the entire required. Paste the most important passage:

  
local f = exports.DB2:pobierzWyniki("SELECT * FROM `prs_frakcje` WHERE `id` = "..getElementData(source, "fid")) 
                local u = exports.DB2:pobierzWyniki("SELECT * FROM `prs_frakcje_players` WHERE `uid` = "..getElementData(plr, "auth:id")) 
  
                setElementData(plr, "f.name", f.nazwa) 
                setElementData(plr, "f.id", f.id) 
local rank = fromJSON(f.ranks) 
outputChatBox(#rank) -- !!!! prints 0 
  
  

Link to comment

try sth like this

    local check = exports.DB2:pobierzWyniki("SELECT * FROM `prs_frakcje` WHERE `id` = "..getElementData(source, "fid")) 
    if type(check) ~= "table" or #check ~= 0 or check then 
    local rank = fromJSON(check[1]["ranks"]) 
    -- Your code 
end  

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...