Ir para conteúdo

Featured Replies

Postado

Esse script funciona da seguinte maneira: o Player fala !vip e ve qnts de points ele tem, ele fala !vip lunar staff ele compra a luna rstaff por 10000 points, eu queria que alguem que saiba mexe com isso fize que qnd o player fala !vip ele pudesse ver os itens que tem no script e seus preço um exemplo seria igual o do skydangerous...\/

semttulocvi.png logo abaixo esta o script..

local tab = {

["asgard key"] = {id = 134, count = 1, points = 1000},

["nightmare doll"] = {id = 117, count = 1, points = 5000},

["addon doll"] = {id = 116, count = 1, points = 3000},

["sd"] = {id = 2268, count = 100, points = 100},

["mp"] = {id = 7620, count = 100, points = 10},

["hp"] = {id = 7618, count = 100, points = 10},

["gsp"] = {id = 8472, count = 100, points = 110},

["uhp"] = {id = 8473, count = 100, points = 130},

["smp"] = {id = 7589, count = 100, points = 30},

["shp"] = {id = 7588, count = 100, points = 30},

["gmp"] = {id = 7590, count = 100, points = 60},

["ghp"] = {id = 7591, count = 100, points = 60},

["suprem vocation"] = {id = 142, count = 1, points = 25000},

["medal of honour"] = {id = 5785, count = 1, points = 5000},

["lunar staff"] = {id = 7424, count = 1, points = 10000},

["golden bow"] = {id = 7438, count = 1, points = 10000},

}

-- ["nome do item"] = {id = id do item, count = quantidade que vai comprar, points = preço.}

local config = {

pz = true,

battle = true,

premium = false

}

function onSay(cid, words, param)

if not param or param == "" then

return doPlayerSendTextMessage(cid, 27, "Voce possui "..getPoints(cid).." creditos.")

end

if param == 'lista' then

local str = ""

for name,points in pairs(tab) do

str = ("Item: " ..name.. ",\n Preço: " ..points.points.. "")

end

str = str .. ""

doShowTextDialog(cid, 6579, str)

return TRUE

end

if config.pz == true and getTilePzInfo(getCreaturePosition(cid)) == FALSE then

doPlayerSendTextMessage(cid, 21,"Voce so pode comprar um item em protect zone.")

return TRUE

end

if config.premium == true and not isPremium(cid) then

doPlayerSendTextMessage(cid, 21, "Voce so pode comprar um item se for premium.")

return TRUE

end

if config.battle == true and getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then

doPlayerSendTextMessage(cid, 21, "Voce so pode comprar um item sem battle.")

return TRUE

end

local tab = tab[param]

if tab then

if getPoints(cid) >= tab.points then

doItemSetAttribute(doPlayerAddItem(cid, tab.id, tab.count),"description","Esse item foi comprado por "..getPlayerName(cid)..".")

doPlayerSendTextMessage(cid, 27, "Voce comprou "..tab.count.." "..getItemNameById(tab.id).." por "..tab.points.." creditos, agora voce tem "..getPoints(cid).." creditos.")

doPlayerSendTextMessage(cid, 27, "Voce sera kickado.")

addEvent(addPoints, 100, cid, -tab.points)

end

end

return true

end

function getPoints(cid)

return tonumber(db.getResult("SELECT `premium_points` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. ";"):getDataString("premium_points"))

end

function addPoints(cid, points)

local acc = getPlayerAccountId(cid)

local pp = getPoints(cid)

if isCreature(cid) then

doRemoveCreature(cid)

end

db.executeQuery("UPDATE `accounts` SET `premium_points` = ".. pp + points .." WHERE `id` = " .. acc .. ";")

end

Skydangerous eu mexi no script e agora esta aparecendo a tabela mais so aparece um dos itens que tem ae, o UHP

Editado por Fabiano Alberto (veja o histórico de edições)

SE AJUDEI REP+ ;D, NÃO CUSTA NADA.

uRti.png

<a href="http://central.evenhost.net/aff.php?aff=020"><img src="http://i.imm.io/uRti.png" width="500" height="82" border="0"></a>

Postado

Tenta assim:

local tab = {

["asgard key"] = {id = 134, count = 1, points = 1000},

["nightmare doll"] = {id = 117, count = 1, points = 5000},

["addon doll"] = {id = 116, count = 1, points = 3000},

["sd"] = {id = 2268, count = 100, points = 100},

["mp"] = {id = 7620, count = 100, points = 10},

["hp"] = {id = 7618, count = 100, points = 10},

["gsp"] = {id = 8472, count = 100, points = 110},

["uhp"] = {id = 8473, count = 100, points = 130},

["smp"] = {id = 7589, count = 100, points = 30},

["shp"] = {id = 7588, count = 100, points = 30},

["gmp"] = {id = 7590, count = 100, points = 60},

["ghp"] = {id = 7591, count = 100, points = 60},

["suprem vocation"] = {id = 142, count = 1, points = 25000},

["medal of honour"] = {id = 5785, count = 1, points = 5000},

["lunar staff"] = {id = 7424, count = 1, points = 10000},

["golden bow"] = {id = 7438, count = 1, points = 10000},

}

-- ["nome do item"] = {id = id do item, count = quantidade que vai comprar, points = preço.}

local config = {

pz = true,

battle = true,

premium = false

}

function onSay(cid, words, param)

if not param or param == "" then

return doPlayerSendTextMessage(cid, 27, "Voce possui "..getPoints(cid).." creditos.")

end

if param == 'lista' then

local str = ""

for name,points in pairs(tab) do

str = ("Item: " ..name.. ",\n Preço: " ..points.points.. "")

end

str = str .. ""

return doPlayerPopupFYI(cid, str)

return TRUE

end

if config.pz == true and getTilePzInfo(getCreaturePosition(cid)) == FALSE then

doPlayerSendTextMessage(cid, 21,"Voce so pode comprar um item em protect zone.")

return TRUE

end

if config.premium == true and not isPremium(cid) then

doPlayerSendTextMessage(cid, 21, "Voce so pode comprar um item se for premium.")

return TRUE

end

if config.battle == true and getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then

doPlayerSendTextMessage(cid, 21, "Voce so pode comprar um item sem battle.")

return TRUE

end

local tab = tab[param]

if tab then

if getPoints(cid) >= tab.points then

doItemSetAttribute(doPlayerAddItem(cid, tab.id, tab.count),"description","Esse item foi comprado por "..getPlayerName(cid)..".")

doPlayerSendTextMessage(cid, 27, "Voce comprou "..tab.count.." "..getItemNameById(tab.id).." por "..tab.points.." creditos, agora voce tem "..getPoints(cid).." creditos.")

doPlayerSendTextMessage(cid, 27, "Voce sera kickado.")

addEvent(addPoints, 100, cid, -tab.points)

end

end

return true

end

function getPoints(cid)

return tonumber(db.getResult("SELECT `premium_points` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. ";"):getDataString("premium_points"))

end

function addPoints(cid, points)

local acc = getPlayerAccountId(cid)

local pp = getPoints(cid)

if isCreature(cid) then

doRemoveCreature(cid)

end

db.executeQuery("UPDATE `accounts` SET `premium_points` = ".. pp + points .." WHERE `id` = " .. acc .. ";")

end

Editado por comedinhasss (veja o histórico de edições)

Bruno Carvalho / Ex-Administrador TibiaKing

[email protected]

 

Em 26/12/2016 em 03:47, Spraypaint disse:

A força da alienação vem dessa fragilidade dos indivíduos, quando apenas conseguem identificar o que os separa e não o que os une.

-miltinho

 

wMwSJFE.png?1

 

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo