Comprar Items Do Shop Do Seu Ot Por Comando

Subwat
Por Subwat
em Actions e Talkactions

Subwat

GAUCHO MACHO
avatar
Infante
Infante

INFOS

Grupo: InfanteRegistrado: 27/07/09Posts: 1516Char no Tibia: Gean Riot

esse sistema funciona da seguinte maneira,vocÊ digita !buyitem ele compra o item do shopping do seu ot por POINTS do shopping!

 

talkaction

 

function onSay(cid,words,param)
	special sword if (param == 'special sword') then
	local config = {itemid = 8932,cost = 20,name = 'a special Sword'}
	if CurrentPoints(getPlayerAccount(cid)) < config.cost then
	doPlayerSendCancel(cid, "Sorry, You need " .. config.cost .. " points to buy " .. config.name .. ".")
	elseif doRemovePremiumPoints(getPlayerAccount(cid), config.cost) == true then
	doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_GREEN,"You have bought " .. config.name .. ".")
	doPlayerAddItem(cid, config.itemid, 1)
	doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
	else
	doPlayerSendCancel(cid, "Sorry, You need " .. config.cost .. " points to buy " .. config.name .. ".")
end
	return true
end
end special sword
else
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_RED,'parametro incorreto.')
end		
return true
end

 

 

TAG:

<talkaction words="!buyitem" event="script" value="buy.lua" />

 

vai em LIB no arquivo 050-function cole isto no final:

 

 

function doRemovePremiumPoints(accountName, points)
points = tostring(points)
       return db.executeQuery('UPDATE `accounts` SET `premium_points` = `premium_points` -' .. points .. ' WHERE `name` = ' .. db.escapeString(accountName) .. ' LIMIT 1;')
end

function CurrentPoints(accountName)
playerpoints = db.getResult('SELECT `premium_points` FROM `accounts` WHERE `name` = ' .. db.escapeString(accountName) .. ' LIMIT 1;')
return playerpoints:getDataInt("premium_points")
end

function doPlayerGiveItem(cid, itemid, amount, subType)
local item = 0 if(isItemStackable(itemid)) then
item = doCreateItemEx(itemid, amount)
if(doPlayerAddItemEx(cid, item, true) ~= RETURNVALUE_NOERROR) then
	return false
end
else
for i = 1, amount do
item = doCreateItemEx(itemid, subType)

 

 

 

 

PRONTO.

 

créditos:

Subwat

Daniel Devotti

Entrem Server online desde o dia 22/02/2013 Monster 24HORAS dedicado!

IP: monster24h.com

PROTOCOL:8.60

PORT:7171

 

RATES:

Exp: 9999x~10x

Skills:800x

Magic:200x

Loot:2x

Pvp-e Advanced: 1.1x Ao matar players de level semelhante.

 

Accounts Pelo Account Manager!

devotti2

Banido
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 10/11/10Posts: 44Char no Tibia: Hacked :S

Muito bom.

Ainda bem que colocou meus creditos né kkkkk

comentem ae galera e de REP +

BANIDO POR COMÉRCIO DE SERVIDORES

YondaimeBRG

YondaimeBRG
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 29/07/11Posts: 14Char no Tibia: '-'

Very Good!

Subwat

GAUCHO MACHO
avatar
Infante
Infante

INFOS

Grupo: InfanteRegistrado: 27/07/09Posts: 1516Char no Tibia: Gean Riot

é eu sei que é very good,sou o melhor scripter do brasil nao ti contaram?

kkkk

Entrem Server online desde o dia 22/02/2013 Monster 24HORAS dedicado!

IP: monster24h.com

PROTOCOL:8.60

PORT:7171

 

RATES:

Exp: 9999x~10x

Skills:800x

Magic:200x

Loot:2x

Pvp-e Advanced: 1.1x Ao matar players de level semelhante.

 

Accounts Pelo Account Manager!