Hi, could someone convert me this part of script to add points in znote acc datebase?
i have tried this but doesnt work..
Could someone look at this please?
Thanks in advance
Regards
Bart
Lua:
rewards = rewards .. rewardCount .. 'x ' .. (rewardType == 'item' and getItemNameById(rewardCount) or rewardType == 'exp' and 'experience' or rewardType == 'cash' and 'money' or rewardType == 'smsPoints' and 'sms points') .. ', '
if rewardType == 'item' then
doPlayerAddItem(cid, rewardCount, 1, true)
elseif rewardType == 'exp' then
doAddExp(cid, rewardCount)
elseif rewardType == 'cash' then
doPlayerAddMoney(cid, rewardCount)
elseif rewardType == 'smsPoints' then
db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` + " .. rewardCount .. " WHERE `name` = '" .. getAccountByName(getCreatureName(cid)) .. "' LIMIT 1;")
end
end
i have tried this but doesnt work..
Code:
db.executeQuery('UPDATE znote_accounts SET points=points+'.. v[2] ..' WHERE account_id=' .. getPlayerAccountId(cid))
Could someone look at this please?
Thanks in advance
Regards
Bart