Special_Forces 0 Postado Março 20, 2008 Share Postado Março 20, 2008 Eu configurei pra comprar só algumas coisas, se quiser adicionar mais eu vou explicar no final do tópico: Em data\talkactions\scripts\buy.lua: -----------------------By Nahruto---------------------------------------------http://otfans.net/---------------------- function getPlayerMoney(cid) gold = getPlayerItemCount(cid,2148) plat = getPlayerItemCount(cid,2152)*100 crys = getPlayerItemCount(cid,2160)*10000 money = gold + plat + crys return money end local items = { ["aol"] = {cash=10000, id=2173, amount=1}, ["food"] = {cash=1000, id=2671, amount=100}, ["uh"] = {cash=1000, id=2273, amount=100}, ["sd"] = {cash=1000, id=2268, amount=100}, ["mr"] = {cash=1000, id=2280, amount=100}, ["ice rapier"] = {cash=50000, id=2396, amount=1}, ["dragon ham"] = {cash=10000, id=2672, amount=100}, ["backpack"] = {cash=100, id=1988, amount=1}, ["great mana potion"] = {cash=150, id=7590, amount=1}, ["strong mana potion"] = {cash=100, id=7589, amount=1}, ["great health potion"] = {cash=150, id=7591, amount=1}, ["strong health potion"] = {cash=100, id=7588, amount=1} } ---------End Config --------- function onSay(cid, words, param) bitem = items[param] if (bitem ~= nil) then if getPlayerMoney(cid) >= bitem.cash then doPlayerAddItem(cid,bitem.id,bitem.amount) doPlayerRemoveMoney(cid,bitem.cash) else doPlayerSendCancel(cid,"Desculpe, Dinheiro Insuficiente") end else doPlayerSendCancel(cid, "Esse Item não é vendido.") end return 1 end Para Adicionar outros itens, copie 1 desses, o Cash é o preço, ID é o id do item, e AMOUNT é a quantidade, ex da backpack, ela custará 100gp e só vira uma. PS: NÃO SE ESQUEÇA DE COLOCAR VIRGULAS DEPOIS DOS ITENS, APENAS O ULTIMO NÃO TEM VIRGULA. Em data\actions\talkactions.xml: -- Comprar com !buy <talkaction words="!buy" script="buy.lua" /> Créditos do OTFans e meu por repassar Link para o comentário https://xtibia.com/forum/topic/79973-comprar-itens-com-buy/ Compartilhar em outros sites More sharing options...
Matheus gallo 0 Postado Abril 4, 2008 Share Postado Abril 4, 2008 bem legal Link para o comentário https://xtibia.com/forum/topic/79973-comprar-itens-com-buy/#findComment-510891 Compartilhar em outros sites More sharing options...
Twopac 1 Postado Abril 4, 2008 Share Postado Abril 4, 2008 Mt Bom... vlw kra... Link para o comentário https://xtibia.com/forum/topic/79973-comprar-itens-com-buy/#findComment-510913 Compartilhar em outros sites More sharing options...
XKronusX 0 Postado Abril 4, 2008 Share Postado Abril 4, 2008 Olha, é bastante interessante, mas não sei se vai ser impregado. Acho melhor quando se usa npcs, fica um pouco mais RPG. Bom, de qualquer forma, to bão. Abraço //Kronus Link para o comentário https://xtibia.com/forum/topic/79973-comprar-itens-com-buy/#findComment-510916 Compartilhar em outros sites More sharing options...
Kuller 0 Postado Abril 7, 2008 Share Postado Abril 7, 2008 NÃO CONSIGO COMPRAR QUAL É OO COMANDO PRA COMPRA AOL POR EXEMPLO?? Link para o comentário https://xtibia.com/forum/topic/79973-comprar-itens-com-buy/#findComment-512683 Compartilhar em outros sites More sharing options...
Schiavinato 7 Postado Abril 14, 2008 Share Postado Abril 14, 2008 Axo q eh tpw assim... vc ker aol.. vc fala: !buy aol ou !buyaol nao sei.. soh testando x) Link para o comentário https://xtibia.com/forum/topic/79973-comprar-itens-com-buy/#findComment-516353 Compartilhar em outros sites More sharing options...
favelado 0 Postado Abril 15, 2008 Share Postado Abril 15, 2008 Kkkkkkkkkk. mais se colocar alguns itens bobo pra vende ficaria legal! ;P Vlw ae cara! Link para o comentário https://xtibia.com/forum/topic/79973-comprar-itens-com-buy/#findComment-517061 Compartilhar em outros sites More sharing options...
Posts Recomendados