Hello, this talkaction script was made by "Doggynub" but it was so hided on the forum.
So all the credits go to him.
TESTED ON TFS 0.4
Data/talkactions/scripts and create a .lua named "item1"
CONFIG:
local itemID = ITEM TO GIVE
local vipDays = POINT COST
local COST = POINT COST
now on talkactions.xml
When player says "!buy-1" he will buy 1 crystal coin for 5 premium points.
You have to create has much scripts has items you had on your "web shop"
(i dunno edit this to make it all in one script, sorry)
Thanks for watchin.
So all the credits go to him.
TESTED ON TFS 0.4
Data/talkactions/scripts and create a .lua named "item1"
Code:
local itemID = 2160
local vipDays = 5
local COST = 5
function onSay(cid, words, param)
local query = db.getResult("SELECT `premium_points` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
local points = query:getDataInt("premium_points")
if points >= COST then
local update = db.executeQuery("UPDATE `accounts` SET `premium_points`= "..(points - COST).." WHERE `id`= " .. getPlayerAccountId(cid) .. "; ")
if (update == true) then
doPlayerAddItem(cid, itemID, 1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have bought kingdoms wand.")
end
else
doPlayerSendCancel(cid, "You need at least "..vipDays.." shop points to buy this item.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
return true
end
CONFIG:
local itemID = ITEM TO GIVE
local vipDays = POINT COST
local COST = POINT COST
now on talkactions.xml
Code:
<talkaction words="!buy-1" event="script" value="item1.lua"/>
When player says "!buy-1" he will buy 1 crystal coin for 5 premium points.
You have to create has much scripts has items you had on your "web shop"
(i dunno edit this to make it all in one script, sorry)
Thanks for watchin.