I am trying to compare the three skills (axe, sword and club) to see which skill is the highest. It prints out correctly the numbers from the mysql database but I keep getting the knight axe...
Code:
Code:
Code:
local skillAxeQuery = db.storeQuery("SELECT skill_axe FROM players WHERE id = " .. getPlayerGUID(player))
local skillSwordQuery = db.storeQuery("SELECT skill_sword FROM players WHERE id = " .. getPlayerGUID(player))
local skillClubQuery = db.storeQuery("SELECT skill_club FROM players WHERE id = " .. getPlayerGUID(player))
local skillAxeResult = result.getDataInt(skillAxeQuery, "skill_axe")
local skillSwordResult = result.getDataInt(skillSwordQuery, "skill_sword")
local skillClubResult = result.getDataInt(skillClubQuery, "skill_club")
print(skillAxeResult)
print(skillSwordResult)
print(skillClubResult)
if skillAxeResult > skillSwordResult or skillClubResult then
doPlayerAddItem(player, 2430, 1) -- Knight axe
return true
elseif skillSwordResult > skillAxeResult or skillClubResult then
doPlayerAddItem(player, 7408, 1) -- Wyvern fang
return true
elseif skillClubResult > skillAxeResult or skillSwordResult then
doPlayerAddItem(player, 2434, 1) -- Dragon hammer
return true
end