Jump to content

"skip to next" problem


Jusonex

Recommended Posts

Hello,

I have a big problem. I am making a housesystem with a cam, with which you can skip from house to house. It works fine, but if there's a house, what is bought, i must repeat skipping until a house isn't bought.

That's the important part of the code:

  
local HouseID = 0 
--local theID = 0 
function skipUp(player) 
    local bought = 0 
    local houses = executeSQLQuery("SELECT * FROM Housesystem WHERE bought = '"..bought.."'") 
    for i, v in pairs (houses) do 
        outputChatBox("Alle: v.ID: "..v.ID, player, 255, 255, 0) 
        outputChatBox("Alle: HouseID: "..HouseID, player, 255, 0, 0) 
        --theID = v.ID 
        if ( v.ID >= HouseID ) then 
            local x, y, z = v.cX, v.cY, v.cZ 
            triggerClientEvent(player, "onTriggerHouseCam", getRootElement(), x, y, z, v.pINx, v.pINy, v.pINz, v.prize) 
            outputChatBox("Aktuell: v.ID: "..v.ID, player, 255, 255, 0) 
            outputChatBox("Aktuell: HouseID: "..HouseID, player, 255, 0, 0)          
            HouseID = HouseID + 1 
            --theID = theID + 1 
            break 
        --else 
            --while ( v.bought == 1 ) do 
            --  HouseID = HouseID + 1 
            --end 
            --local x, y, z = v.cX, v.cY, v.cZ 
            --triggerClientEvent(player, "onTriggerHouseCam", getRootElement(), x, y, z, v.pINx, v.pINy, v.pINz, v.prize) 
        end 
    end 
end 
  

I tried different things, but the problem doesn't go away.

I hope you can help me ;)

Justus

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