Postado Agosto 20, 2018 7 anos Diga em poucas palavras a base utilizada (Nome do servidor ou nome do website). 0.36 Alguém consegue arrumar esse script invés dele cobrar item ele cobrar pontos mais os pontos do meu servido e só points não tem storage ou item nada, e so points alguem consegue ? o script q to querendo adptar e esse aki Spoiler function onSay(cid, words, param) local storage = 9999 local itemid = 2145 -- id do item que vai remover local count = 10 -- quantidade do item que vai remover local looktype = 2192 -- O Looktype da outift que vai ser vendida if getPlayerStorageValue(cid, storage) >= 1 then doPlayerSendTextMessage(cid, 22, "Desculpe voce ja comprou essa outift") return true end if not doPlayerRemoveItem(cid,itemid,count) then doPlayerSendTextMessage(cid, 22, "Você não tem dinheiro suficiente") return true end doPlayerAddOutfit(cid,looktype,3) setPlayerStorageValue(cid, storage, 1) doPlayerSendTextMessage(cid, 22, "Você comprou a outift") return true end
Postado Agosto 20, 2018 7 anos @iury alves potter Se eu entendi o que você quis dizer com " os pontos do meu servido e só points não tem storage ou item nada, e so points": Caso ainda não tenha essas funções, copie isso abaixo e cole em algum arquivo da pasta lib: function getPremiumPoints(cid) local query = db.getResult("SELECT `premium_points` FROM `accounts` WHERE `id` = "..getPlayerAccountId(cid)) local points = query:getDataInt("premium_points") <= 0 and 0 or query:getDataInt("premium_points") query:free() return tonumber(points) end function setPremiumPoints(cid, amount) return db.executeQuery("UPDATE `accounts` SET `premium_points` = "..amount.." WHERE `id` = "..getPlayerAccountId(cid)) end O script fica: local t = { storage = 9999, points = 10, -- quantos pontos vai custar looktype = 2192 } function onSay(cid, words, param) if getPlayerStorageValue(cid, t.storage) >= 1 then doPlayerSendTextMessage(cid, 22, "Desculpe voce ja comprou essa outift") return true end if getPremiumPoints(cid) < t.points then doPlayerSendTextMessage(cid, 22, "Você não tem "..t.points.." ponto"..(t.points > 1 and "s" or "")..".") return true end doPlayerAddOutfit(cid, t.looktype, 3) setPlayerStorageValue(cid, t.storage, 1) doPlayerSendTextMessage(cid, 22, "Você comprou a outift.") setPremiumPoints(cid, getPremiumPoints(cid) - t.points) return true end Contato: Email: [email protected] Discord: Dwarfer#2715
Postado Agosto 21, 2018 7 anos Autor 2 horas atrás, Dwarfer disse: @iury alves potter Se eu entendi o que você quis dizer com " os pontos do meu servido e só points não tem storage ou item nada, e so points": Caso ainda não tenha essas funções, copie isso abaixo e cole em algum arquivo da pasta lib: function getPremiumPoints(cid) local query = db.getResult("SELECT `premium_points` FROM `accounts` WHERE `id` = "..getPlayerAccountId(cid)) local points = query:getDataInt("premium_points") <= 0 and 0 or query:getDataInt("premium_points") query:free() return tonumber(points) end function setPremiumPoints(cid, amount) return db.executeQuery("UPDATE `accounts` SET `premium_points` = "..amount.." WHERE `id` = "..getPlayerAccountId(cid)) end O script fica: local t = { storage = 9999, points = 10, -- quantos pontos vai custar looktype = 2192 } function onSay(cid, words, param) if getPlayerStorageValue(cid, t.storage) >= 1 then doPlayerSendTextMessage(cid, 22, "Desculpe voce ja comprou essa outift") return true end if getPremiumPoints(cid) < t.points then doPlayerSendTextMessage(cid, 22, "Você não tem "..t.points.." ponto"..(t.points > 1 and "s" or "")..".") return true end doPlayerAddOutfit(cid, t.looktype, 3) setPlayerStorageValue(cid, t.storage, 1) doPlayerSendTextMessage(cid, 22, "Você comprou a outift.") setPremiumPoints(cid, getPremiumPoints(cid) - t.points) return true end Usei esse script ai so q ele gastava os pontos mais n recebia a outfit ai fiz uma mudança coloquei a sim Spoiler local t = { storage = 9999, points = 10, -- quantos pontos vai custar looktype = 40030 -- storage da outfit } function onSay(cid, words, param) if getPlayerStorageValue(cid, t.storage) >= 1 then doPlayerSendTextMessage(cid, 22, "Desculpe voce ja comprou essa outift") return true end if getPremiumPoints(cid) < t.points then doPlayerSendTextMessage(cid, 22, "Você não tem "..t.points.." ponto"..(t.points > 1 and "s" or "")..".") return true end if getPlayerStorageValue (cid, looktype) ~= 1 then setPlayerStorageValue (cid, looktype, 1) doPlayerSendTextMessage(cid, 22, "Você comprou a outift.") setPremiumPoints(cid, getPremiumPoints(cid) - t.points) return true end end Mais agora o player compra os pontos e gastado mais o player fica com outfit invisivel ,sendo que foi adcionado em xml\outfit ja a tag da outfit Spoiler <outfit id="119" quest="40030"> <list gender="1" lookType="2325" name="Rabiit"/> </outfit> Editado Agosto 21, 2018 7 anos por iury alves potter (veja o histórico de edições)
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.