Oldschool'er
Tibia since 1998'
Hello and im looking for a script for Premium Scroll so it gives premium points instead of premium days.
function onUse(cid, item, fromPosition, itemEx, toPosition)
local addpoints = 10 -- amount of points to add
db.executeQuery("UPDATE `accounts` SET `points` = `points` + "..addpoints.." WHERE `id` = '" ..getPlayerAccountId(cid).. "';")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, ""..addpoints.." premium points have been added to your account.")
doRemoveItem(item.uid, 1)
return true
end
LUA:function onUse(cid, item, fromPosition, itemEx, toPosition) local addpoints = 10 -- amount of points to add db.executeQuery("UPDATE `accounts` SET `points` = `points` + "..addpoints.." WHERE `id` = '" ..getPlayerAccountId(cid).. "';") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, ""..addpoints.." premium points have been added to your account.") doRemoveItem(item.uid, 1) return true end
Script is tested and working for 1.0/0.2, to get it working on 0.3 you need to change the points column to premium_points.
This is an extremely basic script. So in the future, maybe you shouldn't criticize other people's work until you can at least do your own (Thread starter should know what I'm talking about).
function onUse(cid, item, fromPosition, itemEx, toPosition)
local addpoints = 10 -- amount of points to add
db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` + "..addpoints.." WHERE `id` = '" ..getPlayerAccountId(cid).. "';")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, ""..addpoints.." premium points have been added to your account.")
doRemoveItem(item.uid, 1)
return true
end
This is for actions right?