samandriel
Active Member
- Joined
- Oct 19, 2016
- Messages
- 242
- Solutions
- 1
- Reaction score
- 46
I need a help to use this system:
https://otland.net/threads/znote-aac-tfs-1-1-referral-system.227199/#post-2405828
Converted to 0.4
But i don't want to it add donate points
I want it add premium days
But i don't know this mysql thing and i need a help..
Anyone know how to do?
https://otland.net/threads/znote-aac-tfs-1-1-referral-system.227199/#post-2405828
Converted to 0.4
Code:
local cfg = {
stor = 250888,
requiredLevel = 13,
bonusPoints = 5
}
function onAdvance(cid, skill, oldLevel, newLevel)
if (newLevel == cfg.requiredLevel and skill == SKILL__LEVEL) and getPlayerStorageValue(cid, cfg.stor) < 1 then
local accountId = getPlayerAccountId(cid)
local resultId = db.storeQuery("SELECT `ref_key` FROM `__cornex_referral_actions` WHERE `registered_by` = " .. accountId .. " AND `blocked` = 0")
if resultId then
print(resultId)
local resultId2 = db.storeQuery("SELECT `belongs_to` FROM `__cornex_referral` WHERE `referral_key` = '" .. result.getDataString(resultId, "ref_key") .. "'")
print(resultId2)
if resultId2 then
db.executeQuery("UPDATE `__cornex_referral_actions` SET `blocked` = 1 WHERE `registered_by` = " .. accountId)
db.executeQuery("UPDATE `znote_accounts` SET `points` = (points + " .. cfg.bonusPoints .. ") WHERE `account_id` = '" .. result.getDataInt(resultId2, "belongs_to") .. "'")
print('-> account id: ' .. result.getDataInt(resultId2, "belongs_to"))
print('-> added ' .. cfg.bonusPoints .. ' points.')
result.free(resultId2)
else
print("Missing ref_key in `__cornex_referral` where ref_key = " .. result.getDataString(resultId, "ref_key"))
end
result.free(resultId)
end
end
return true
end
But i don't want to it add donate points
I want it add premium days
But i don't know this mysql thing and i need a help..
Anyone know how to do?