roriscrave
Advanced OT User
- Joined
- Dec 7, 2011
- Messages
- 1,210
- Solutions
- 35
- Reaction score
- 206
this code check if player have more than 5 items in shop auction (trade offline). its 0.x
i'm tring to pass it to 1.x, so i tested id:

must return 2, because the player has 2 items in the shop
but it always return 1, why?
Code:
local check = db.getResult("SELECT `id` FROM `auction_system` WHERE `player` = " .. getPlayerGUID(cid) .. ";")
if(check:getID() == -1) then
elseif(check:getRows(true) >= 5) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't add more offers (max. 5)")
return true
end
i'm tring to pass it to 1.x, so i tested id:
Code:
local check = db.storeQuery("SELECT `id` FROM `auction_system` WHERE `player` = " .. player:getGuid() .. ";")
if check ~= false then
local resultId = result.getDataInt(check, "id")
if resultId and resultId >= 5 then
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't add more offers (max. 5)")
return true
end
end

must return 2, because the player has 2 items in the shop
but it always return 1, why?