Jump to content

Boolean error [This script]


Tibix99

Recommended Posts

addCommandHandler("makeinterior", 
    function(playerSource, cmd, intid, type, price,...)
        if (getElementData(playerSource,"acc:admin") >= 6) then
            if intid and price and type and (...) then
                x,y,z = getElementPosition(playerSource)
                intbel = interiors[tonumber(intid)]
                if intbel then
                    if tonumber(type) >= 1 and tonumber(type) <= 4 then
                    
                        local interiorid = intbel[1]
                        local ix = intbel[2]
                        local iy = intbel[3]
                        local iz = intbel[4]
                        local name = table.concat({...}," ")
                        local outint, outdim = getElementInterior(playerSource), getElementDimension(playerSource)
                        local query = dbQuery(con, "INSERT INTO interiors SET x = ?, y = ?, z = ?, interiorx = ?, interiory = ?, interiorz = ?, name = ?, type = ?, cost = ?, interior = ?,intid = ?,outint = ?, outdim = ?",x, y, z, ix, iy, iz, name, type, price, interiorid,intid, outint, outdim)
                        local insertered, _, insertid = dbPoll(query, -1)
                        if insertered then
                            loadOneInteriorWhereID(insertid)
                            if tonumber(type) == 1 then
                                types = "Ház"
                            elseif tonumber(type) == 2 then
                                types = "Biznisz"
                            elseif tonumber(type) == 3 then
                                types = "Önkormányzat"        
                            elseif tonumber(type) == 4 then
                                types = "Garázs"
                            end
                            outputChatBox(rovid .." Sikeresen létrehoztad az interior-t (ID: #7cc576".. insertid.." #FFFFFF| Név: #7cc576".. name .."#FFFFFF | TÍPUS: #7cc576".. types .. "#FFFFFF)",playerSource,255,255,255,true)
                        end
                    else
                        outputChatBox(rovid .." Nincs ilyen típus!",playerSource,255,255,255,true)
                    end
                end
            else
                outputChatBox(rovid.." #ffffff/"..cmd.." [INTERIORID] [TIPUS] [ÁR] [NÉV]", playerSource,169,139,101,true)    
                outputChatBox(rovid.." #ffffffTípus: 1: Ház 2: Biznisz 3: Önkormányzat 4: Garázs", playerSource,169,139,101,true)    
            end
        end
    end

 

Where is the error? This  script is going be a house system script. (garages,houses...)

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...