God Mythera
Veteran OT User
data/items/items.xml
Code:
<item id="24137" article="a" name="premium coin">
<attribute key="description" value="Using this coin will add 10 shop points to your account." />
<attribute key="weight" value="0" />
</item>
data/actions/actions.xml
Code:
<action itemid="24137" script="other/premium_coin.lua"/>
data/actions/scripts/premium_coin.lua
Code:
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, 10)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have recived 10 shop points to your account.")
doSendMagicEffect(getCreaturePosition(cid), 28)
doRemoveItem(item.uid,1)
return true
end
Last edited: