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

Solved Useitem get x points problem

gremlee

Qumora.com
Joined
Jul 15, 2008
Messages
511
Reaction score
16
Hello i use 0.4 rev 8.6 i also use znote aac,

i want to use item id 10141 then i get 1 donate point to my account on website i tryend alot of script but seems that nothing is working for me.

Thx for you help

bump
 
Last edited by a moderator:
Most scripts are for Gesior/Modern AAC, did you change the fields so it matches Znote AAC?

e.g
Code:
local player = Player(cid)
local accountId, points = player:getAccountId(), 5
db.query("UPDATE znote_accounts SET points = points + " .. points .. " WHERE account_id = " .. accountId)
 
Most scripts are for Gesior/Modern AAC, did you change the fields so it matches Znote AAC?

e.g
Code:
local player = Player(cid)
local accountId, points = player:getAccountId(), 5
db.query("UPDATE znote_accounts SET points = points + " .. points .. " WHERE account_id = " .. accountId)


function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 11260 then
doPlayerAddPremiumDays(cid, 1)
doSendMagicEffect(getThingPos(cid), CONST_ME_FIREWORK_BLUE)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have been granted 1 days of premium access.")
doRemoveItem(item.uid)
elseif item.itemid == 10141 then
db.query("UPDATE znote_accounts SET points = points + " .. points .. " WHERE account_id = " .. accountId)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have been granted 1 shop point to your account.")
doSendMagicEffect(getThingPos(cid), CONST_ME_FIREWORK_BLUE)
doRemoveItem(item.uid)

i tryied and i change it but getting errors now something stack traceback.
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.itemid == 11260 then
        doPlayerAddPremiumDays(cid, 1)
        doSendMagicEffect(getThingPos(cid), CONST_ME_FIREWORK_BLUE)
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have been granted 1 days of premium access.")
        doRemoveItem(item.uid)
    elseif item.itemid == 10141 then
        local accountId, points = getPlayerAccountId(cid), 1
        db.query("UPDATE znote_accounts SET points = points + " .. points .. " WHERE account_id = " .. accountId)
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have been granted 1 shop point to your account.")
        doSendMagicEffect(getThingPos(cid), CONST_ME_FIREWORK_BLUE)
        doRemoveItem(item.uid)
    end
    return true
end
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.itemid == 11260 then
        doPlayerAddPremiumDays(cid, 1)
        doSendMagicEffect(getThingPos(cid), CONST_ME_FIREWORK_BLUE)
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have been granted 1 days of premium access.")
        doRemoveItem(item.uid)
    elseif item.itemid == 10141 then
        local accountId, points = getPlayerAccountId(cid), 1
        db.query("UPDATE znote_accounts SET points = points + " .. points .. " WHERE account_id = " .. accountId)
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have been granted 1 shop point to your account.")
        doSendMagicEffect(getThingPos(cid), CONST_ME_FIREWORK_BLUE)
        doRemoveItem(item.uid)
    end
    return true
end

Thanks alot ninja!!! :)
 
what? is just a query, change
Code:
UPDATE znote_accounts SET points = points WHERE account_id
to
Code:
UPDATE accounts SET premium_points = premium_points WHERE id
or bigmoma_points idk
how do i add it to this?
Code:
elseif item.itemid == 10141 then
        local accountId, points = getPlayerAccountId(cid), 1
        db.query("UPDATE znote_accounts SET points = points + " .. points .. " WHERE account_id = " .. accountId)
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have been granted 1 shop point to your account.")
        doSendMagicEffect(getThingPos(cid), CONST_ME_FIREWORK_BLUE)
        doRemoveItem(item.uid)

i added it but got this error

EzkPGkT.png
 
another error = s

QkiOsS8.png


script
Code:
elseif item.itemid == 10141 then
        local accountId, points = getPlayerAccountId(cid), 1
        db.query("UPDATE accounts SET premium_points = premium_points WHERE id" .. accountId)
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have been granted 1 shop point to your account.")
        doSendMagicEffect(getThingPos(cid), CONST_ME_FIREWORK_BLUE)
        doRemoveItem(item.uid)
 
db.query("UPDATE accounts SET premium_points = premium_points + " .. points .. " WHERE id = " .. accountId)
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.itemid == 11260 then
        doPlayerAddPremiumDays(cid, 1)
        doSendMagicEffect(getThingPos(cid), CONST_ME_FIREWORK_BLUE)
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have been granted 1 days of premium access.")
        doRemoveItem(item.uid)
    elseif item.itemid == 10141 then
        local accountId, points = getPlayerAccountId(cid), 1
        db.query("UPDATE znote_accounts SET points = points + " .. points .. " WHERE account_id = " .. accountId)
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have been granted 1 shop point to your account.")
        doSendMagicEffect(getThingPos(cid), CONST_ME_FIREWORK_BLUE)
        doRemoveItem(item.uid)
    end
    return true
end
excuse me is it for 0.3.6 and please tell me where can i put this
 
Back
Top