• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

ZnoteAcc add points.

shacey

New Member
Joined
Jan 23, 2021
Messages
17
Reaction score
2
Hi, could someone convert me this part of script to add points in znote acc datebase?


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
 
Hello
You mean Shop Points ?
If you use last Znote version all is working dont need change anything
And for sql, inside of znote is a sql file to execute after you uploaded the sql database file.
 
Znote holds shop points in different table than gesior/myacc can someone change this query to send points to znoteacc sms points table?

Please
 
Ye i know it works at myacc gesior but id like use this function for znoteacc I dont want to change acc maker just add function from znoteacc to this script ;) but thanks anyway
I know it is possible and should be easy for someone who knows more than me about lua;x|



EDIT : EDIT : EDIT :
OK i did it myself so for someone in the future ;)

use this :

Lua:
db.executeQuery("UPDATE `znote_accounts` SET `points` = `points` + " .. rewardCount .. " WHERE `account_id` = '" .. getAccountNumberByPlayerName(getCreatureName(cid)) .. "' LIMIT 1;")
 
Last edited:
Back
Top