• 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!

TFS 1.X+ Premium scroll no add coins

janes123

New Member
Joined
Jun 21, 2012
Messages
100
Reaction score
4
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
 
Solution
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
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
 
Solution
Code:
local function doPlayerAddPremiumPoints(cid, count)
        db.query('UPDATE accounts SET coins = coins+'.. 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 coins to your account.")
    doSendMagicEffect(getCreaturePosition(cid), 28)
    doSendMagicEffect(getCreaturePosition(cid), 76)
    doSendMagicEffect(getCreaturePosition(cid), 75)
    doSendMagicEffect(getCreaturePosition(cid), 50)
    doRemoveItem(item.uid,1)
    return true
end

try this if u have coins row in your database/accounts
 
Back
Top