ST
dúvida

Auto Loot Somente Para Premium

Por Stigal, 17 de ago. de 2012 em Scripts

duvida
auto loot poketibia
poketibia
otserv
tibia
3
1.3k
StigalS
17 de agosto de 2012 às 03:18

Ola Usuarios,

Venho Pedir a Ajuda De Vocês Pois Presciso De Um "Talk" Soque Somente VIP'S(Premium) Podem Utilizar...

O Bom Da Noticia e Que Esse "talk" ja é Existente No Forum!

A Base é "Pokemon Cention V3" 8.54, Funcional!

Oque Eu Quero é o Seguinte, Quero Que o Sistema Funcione Como esta! Mas Somente Usuarios "VIP" Poderao Utilisa-lo.

Espero Que Poçao Me Ajudar!

 

Abraço

Editado Agosto 17 por Stigal

OneshotO
17 de agosto de 2012 às 08:37

Só usar essa talkaction, é a mesma coisa do tópico que você passou, mas verifica se o jogador tem premium.

 

local stor, limit = 7575, 5 --storage, limit to add.

local allow_container = false --empty! not looted with items, atleast for now.

function onSay(cid, words, param)
   if not isPremium(cid) then
       doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUNEEDPREMIUMACCOUNT)
       return true
   end

   local expl = param:explode(':')
   local action, rst = expl[1], expl[2]
   if (action:lower() == 'check') then
       local infos, list = getPlayerStorageValue(cid, stor), {}
       if (infos ~= -1) then
           list = tostring(infos):explode(',')
       end
       local txt = 'Autoloot List:\n'
       if (#list > 0) then
           for k, id in ipairs(list) do
               id = id:gsub('_', '')
               if tonumber(id) then
                   txt = txt .. getItemNameById(tonumber(id)) .. ((k < #list) and '\n' or '')
               end
           end
       else
           txt = 'Empty'
       end
       doPlayerPopupFYI(cid, txt)
   elseif (action:lower() == 'add') then
       local infos, list = getPlayerStorageValue(cid, stor), {}
       if (infos ~= -1) then
           list = tostring(infos):gsub('_', ''):explode(',')
       end
       if (#list >= limit) then
           return doPlayerSendCancel(cid, 'You already have ' .. limit .. ' autolooting items.')
       end
       local item = tonumber(rst)
       if not item then
           item = getItemIdByName(rst, false)
           if not item then
               return doPlayerSendCancel(cid, 'not valid item.')
           end
       end
       if not allow_container and isItemContainer(item) then
           return doPlayerSendCancel(cid, 'this item can not be autolooted.')
       end
       local attrs = getItemInfo(item)
       if not attrs then
           return doPlayerSendCancel(cid, 'not valid item.')
       elseif not attrs.movable or not attrs.pickupable then
           return doPlayerSendCancel(cid, 'this item can not be autolooted.')
       end
       if isInArray(list, item) then
           return doPlayerSendCancel(cid, 'already added.')
       end
       table.insert(list, tostring(item))
       local new = ''
       for v, id in ipairs(list) do
           new = new .. '_' .. id:gsub('_' ,'') .. ((v < #list) and ',' or '')
       end
       doPlayerSetStorageValue(cid, stor, tostring(new))
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Item >>' .. getItemNameById(item) .. '<< has been added to the autoloot list.')
   elseif (action:lower() == 'remove') then
       local infos, list = getPlayerStorageValue(cid, stor), {}
       if (infos ~= -1) then
           list = tostring(infos):gsub('_', ''):explode(',')
       end
       if (#list == 0) then
           return doPlayerSendCancel(cid, 'You dont have any item added.')
       end
       if (#list >= limit) then
           return doPlayerSendCancel(cid, 'You already have ' .. limit .. ' autolooting items.')
       end
       local item = tonumber(rst)
       if not item then
           item = getItemIdByName(rst, false)
           if not item then
               return doPlayerSendCancel(cid, 'not valid item.')
           end
       end
       if not isInArray(list, item) then
           return doPlayerSendCancel(cid, 'This item is not in the list.')
       end
       local new = ''
       for v, id in ipairs(list) do
           if (tonumber(id) ~= item) then
               new = new .. '_' .. id:gsub('_' ,'') .. ((v < #list) and ',' or '')
           end
       end
       doPlayerSetStorageValue(cid, stor, tostring(new))
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Item >>' .. getItemNameById(item) .. '<< removed from the autoloot list.')
   end        
   return true
end

StigalS
17 de agosto de 2012 às 15:05

OneShot, Muito Obrigado Pela Atenção e Pelo Script!

Reputado, Obrigado Por Ser Tão Breve

 

Funcionando Perfeitamente!!!