tuduras
Well-Known Member
- Joined
- Jun 4, 2017
- Messages
- 351
- Solutions
- 2
- Reaction score
- 59
Hello, how to repair script, this mean add line with znote compatible premmium points.

I have got premium points in table znote_account but script don't see its
My script:
And
or
In Znote_acc premium points called points. in Gesior premium_points
Best Regards

I have got premium points in table znote_account but script don't see its
My script:
LUA:
local t = {
[1938] = {1,"crystal arrow",2352},
[1939] = {5,"Trufle manarune",2307},
[1940] = {5,"elethriels elemental bow",8858},
[1941] = {5,"bubu wand",7958},
[1942] = {5,"upgraded norse shield",8908},
[1943] = {5,"ranger legs",8923},
[1944] = {5,"bunny slippers",2644},
[1945] = {5,"protection legs",2504},
[1946] = {5,"mega mage armor",8882},
[1947] = {5,"mega paladin armor",8883},
[1948] = {5,"Upgraded Norse Helmet",2501},
[1949] = {5,"norse shield",7460},
[1950] = {5,"Pro Mage Armor",8884},
[1951] = {5,"Pro Paladin Armor",8888},
[1952] = {5,"Pro Knight Armor",2653},
[1953] = {5,"mega knight armor",8881},
[1954] = {5,"Premium Rune",12569},
[1955] = {5,"Honor Club",7423},
[1956] = {5,"KnightUH",2298},
[1957] = {5,"norse upgrader",2364},
}
function onUse(cid,item,fromPosition,itemEx,toPosition)
local v = t[item.uid]
if getPremiumPoints(cid,v[1]) > v[1] and getPlayerFreeCap(cid) >= (getItemWeightById(v[3])) then
doPlayerAddItem(cid,v[3])
db.executeQuery("UPDATE `znote_accounts` SET `points` = `points` + " .. rewardCount .. " WHERE `account_id` = '" .. getAccountNumberByPlayerName(getCreatureName(cid)) .. "' LIMIT 1;")
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have buy a " .. v[2] .. " for "..v[1].." points! Your current balance is "..getPremiumPoints(cid).." points!")
elseif getPremiumPoints(cid,v[1]) < v[1] then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You need atleast "..v[1].." points to buy "..getItemNameById(v[3]).."!")
elseif getPlayerFreeCap(cid) < (getItemWeightById(v[3])) then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You need " .. getItemWeightById(v[3]) .. ".00 oz in order to get the item")
end
return true
end
function getPremiumPoints(cid)
local res = db.getResult('select `premium_points` from accounts where name = \''..getPlayerAccount(cid)..'\'')
if(res:getID() == -1) then
return 0
end
local ret = res:getDataInt("premium_points")
res:free()
return tonumber(ret)
end
And
Code:
db.executeQuery("UPDATE `znote_accounts` SET `points` = `points` + " .. rewardCount .. " WHERE `account_id` = '" .. getAccountNumberByPlayerName(getCreatureName(cid)) .. "' LIMIT 1;")
or
LUA:
db.executeQuery("UPDATE `znote_accounts` SET `points` = `points` + " .. addPoints .. " WHERE `account_id` = " .. getPlayerAccountId(cid))
In Znote_acc premium points called points. in Gesior premium_points
Best Regards