TFS 1.X+ Premium scroll no add coins

janes123

Well-Known Member
Joined
Jun 21, 2012
Messages
70
Reaction score
1
Lua:
local function doPlayerAddPremiumPoints(cid, count)
        db.query('UPDATE accounts SET premium_points = premium_points+'.. count ..' WHERE id = ' .. getAccountNumberByPlayerName(getCreatureName(cid)))
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
    doPlayerAddPremiumPoints(cid, 30)
    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have recived 30 Tibia Coins to your account.")
    doSendMagicEffect(getCreaturePosition(cid), 28)
    doRemoveItem(item.uid,1)
    return true
end
use this script but no add coins to item shop on www no error in console
 

Mister Budex

BudexOT.com
Premium User
Joined
Jun 22, 2016
Messages
1,036
Reaction score
155
Try something like this
Lua:
local addpoints = 100 -- amount of points to add
 
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if isPlayer(player) and doRemoveItem(item.uid, 1) then
        db.query("UPDATE znote_accounts SET points = points + "..addpoints.." WHERE account_id = '" ..player:getAccountId().. "';")
        doPlayerSendTextMessage(player, MESSAGE_STATUS_CONSOLE_ORANGE, ""..addpoints.." premium points has been added to your account.")
        return true
    else
        return false
    end
end
 
Top