Jusonex Posted February 1, 2011 Share Posted February 1, 2011 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
MTA Team ccw Posted February 2, 2011 MTA Team Share Posted February 2, 2011 Maybe HouseID = v.ID + 1 Link to comment
Jusonex Posted February 2, 2011 Author Share Posted February 2, 2011 Thank you It works fine. Link to comment
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