Ir para conteúdo
  • Cadastre-se

ERROR [Action] Error script addon


Posts Recomendados

Olá galera do TK :D
 
Pois bem, eu estava desenvolvendo um script próprio para o meu servidor, recebi ajuda de alguns do TK porém não consegui deixá-lo 100%
 

SCRIPT :

function onUse(cid, item, frompos, item2, topos)
local itens = {2160}     ----dinheiro necessário
local itens2 = {2189, 2191, 2187, 2190, 2181, 2188, 8921}        ---- items necessários

        if item.uid == 4112 then
        if getPlayerItemCount(cid, itens) == 25 then    -- quantidade dinheiro
      doPlayerRemoveItem(cid, itens, 25)
       end  
        if getPlayerItemCount(cid, itens2) == 1 then    -- quantidade de cada item
      doPlayerRemoveItem(cid, itens2, 1)
        queststatus = getPlayerStorageValue(cid,100003)   --- storage ao ganhar addon
        if queststatus == -1 then
        doPlayerSendTextMessage(cid,22,"You won a full mage addon!")  -- msg ao ganhar addon
                doSendAnimatedText(getPlayerPosition(cid), "", TEXTCOLOR_ORANGE)
                doPlayerAddOutfit(cid,138,3)
                doPlayerAddOutfit(cid,120,3)
        setPlayerStorageValue(cid,100003,1)
        else
        doPlayerSendTextMessage(cid,22,"You own this addon!")   -- não lembro pq coloquei isso
        end
        else
        doPlayerSendTextMessage(cid,22,"I need 1 wand of cosmic energy, 1 wand of draconia, 1 wand of dragonbreath, 1 wanf of inferno, 1 wand of vortex, 1 terra rod, 1 common akilles wand and more 250.000 cash for this addon!") -- msg dos items necessários pro addon
        end
        else
        return 0
        end

        return 1
        end

 

 

TAG :

<action uniqueid="4112" script="outfits/mage.lua" />

PRINT :

XWm2EkD.jpg

Qual o problema com o script ?

Pois bem, ele funciona, porém com um pequeno defeito!
Ao invés de remover os items  :
local itens = {2160}
local itens2 = {2189, 2191, 2187, 2190, 2181, 2188, 8921}
---
 
e dar o addon para pessoa, ele simplesmente me manda a frase que eu não tenho os items necessários, mesmo estando com todos na mochila!

Pra que este script serve ?

Ao puxar a alavanca com o Action ID : 4112  (  if item.uid == 4112 then  )
Ele removeria os items necessários e daria o addon FULL   ( nesse caso o de MAGE ) , substituindo um NPC :D

Ps : Deixei os NPCS no game por enquanto.. até arrumar este script !
 
Peço que me ajudem, por favor ! REP+ pra quem conseguir fazê-lo funcionar !
Agradeço desde já !

 

Programador/Scripter/Mapper nível NOOB ?

 

Untitltasadasded-1.png.e24703844a8ee56fadbf0cdcf82cd9c7.png

Link para o post
Compartilhar em outros sites

try this:

 

function onUse(cid, item, frompos, item2, topos)
local itens = {2160}     ----dinheiro necessário
local itens2 = {2189, 2191, 2187, 2190, 2181, 2188, 8921}        ---- items necessários
local storageaddon = 100003 -- change storage for diferent addons.
local cantidadcc = 25 --- candidad do cc


if getPlayerStorageValue(cid,storageaddon) >= 1 then --- check if you have the addon
doPlayerSendTextMessage(cid,22,"You own this addon!")
return 1
        end


        if getPlayerItemCount(cid, itens) >= cantidadcc and getPlayerItemCount(cid, itens2) >= 1 then
        doPlayerRemoveItem(cid, itens, cantidadcc)
doPlayerRemoveItem(cid, itens2, 1)
doPlayerSendTextMessage(cid,22,"You won a full mage addon!")  -- msg ao ganhar addon
        doSendAnimatedText(getPlayerPosition(cid), "", TEXTCOLOR_ORANGE)
        doPlayerAddOutfit(cid,138,3)
        doPlayerAddOutfit(cid,120,3)
        setPlayerStorageValue(cid,storageaddon,1)
        else
        doPlayerSendTextMessage(cid,22,"You need 1 wand of cosmic energy, 1 wand of draconia, 1 wand of dragonbreath, 1 wanf of inferno, 1 wand of vortex, 1 terra rod, 1 common akilles wand and more 250.000 cash for this addon!") -- msg dos items necessários pro addon
return 1
        end
end
Editado por BennyDz (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Obrigado pela sua ajuda, porém não funcionou, continuou na mesma de antes!
Sabe o problema ?

 

/////Translate

Thanks for your help, but it did not work, remained the same as before!
You know the problem?

 

Programador/Scripter/Mapper nível NOOB ?

 

Untitltasadasded-1.png.e24703844a8ee56fadbf0cdcf82cd9c7.png

Link para o post
Compartilhar em outros sites
local config = {
 
   [4001] = {
      name = "First Citizen Addon", -- name
      addon_type = 1, -- addon
      outfit = {136,128}, -- female / male
      cost = 0, -- cost
      items = {{5878,100}}, -- items
   },
   [4002] = {
      name = "Second Citizen Addon",
      addon_type = 2,
      outfit = {136,128},
      cost = 0,
      items = {{5890,100},{5902,50},{2480,1}},
   },
   [4003] = {
      name = "First Hunter Addon",
      addon_type = 1,
      outfit = {137,129},
      cost = 0,
      items = {{5947,1},{5876,100},{5948,100},{5889,1},{5887,1},{5888,1},{5891,5}},
   },
   [4004] = {
      name = "Second Hunter Addon",
      addon_type = 2,
      outfit = {137,129},
      cost = 0,
      items = {{5875,1}},
   },
   [4005] = {
      name = "First Mage Addon",
      addon_type = 1,
      outfit = {138,130},
      cost = 0,
      items = {{5958,1}},
   },
   [4006] = {
      name = "Second Mage Addon",
      addon_type = 2,
      outfit = {138,130},
      cost = 0,
      items = {{5903,1}},
   },
   [4007] = {
      name = "First Knight Addon",
      addon_type = 1,
      outfit = {139,131},
      cost = 0,
      items = {{5880,100}},
   },
   [4008] = {
      name = "Second Knight Addon",
      addon_type = 2,
      outfit = {139,131},
      cost = 0,
      items = {{5893,100},{5924,1},{5885,1},{5887,1}},
   },
   [4009] = {
      name = "First Nobleman Addon",
      addon_type = 1,
      outfit = {140,132},
      cost = 150000,
      items = {},
   },
   [4010] = {
      name = "Second Nobleman Addon",
      addon_type = 2,
      outfit = {140,132},
      cost = 150000,
      items = {},
   },
 
   [4011] = {
      name = "First Summoner Addon",
      addon_type = 1,
      outfit = {141,133},
      cost = 0,
      items = {{5958,1}},
   },
   [4012] = {
      name = "Second Summoner Addon",
      addon_type = 2,
      outfit = {141,133},
      cost = 0,
      items = {{5894,70},{5911,20},{5883,40},{5905,30},{5904,15},{5882,40},{5881,60},{5886,10},{5922,35}},
   },
   [4013] = {
      name = "First Warrior Addon",
      addon_type = 1,
      outfit = {142,134},
      cost = 0,
      items = {{5899,100},{5925,100},{5884,1},{5919,1}},
   },
   [4014] = {
      name = "Second Warrior Addon",
      addon_type = 2,
      outfit = {142,134},
      cost = 0,
      items = {{5887,1},{5880,100}},
   },
   [4015] = {
      name = "First Barbarian Addon",
      addon_type = 1,
      outfit = {147,143},
      cost = 0,
      items = {{5885,1},{5884,1},{5911,50},{5910,50},{5886,10}},
   },
   [4016] = {
      name = "Second Barbarian Addon",
      addon_type = 2,
      outfit = {147,143},
      cost = 0,
      items = {{5892,1},{5880,100},{5893,50},{5876,50}},
   },
   [4017] = {
      name = "First Druid Addon",
      addon_type = 1,
      outfit = {148,144},
      cost = 0,
      items = {{5897,50},{5896,50}},
   },
   [4018] = {
      name = "Second Druid Addon",
      addon_type = 2,
      outfit = {148,144},
      cost = 0,
      items = {{5940,1},{5938,1},{5937,1},{5942,1},{5906,100}},
   },
   [4019] = {
      name = "First Wizard Addon",
      addon_type = 1,
      outfit = {149,145},
      cost = 0,
      items = {{2488,1},{2123,1},{2492,1},{2536,1}},
   },
   [4020] = {
      name = "Second Wizard Addon",
      addon_type = 2,
      outfit = {149,145},
      cost = 0,
      items = {{5922,50},},
   },
   [4021] = {
      name = "First Oriental Addon",
      addon_type = 1,
      outfit = {150,146},
      cost = 0,
      items = {{5945,1}},
   },
   [4022] = {
      name = "Second Oriental Addon",
      addon_type = 2,
      outfit = {150,146},
      cost = 0,
      items = {{5883,100},{5895,100},{5891,2},{5912,100}},
   },
   [4023] = {
      name = "First Pirate Addon",
      addon_type = 1,
      outfit = {155,151},
      cost = 0,
      items = {{6126,100},{6097,100},{6098,100}},
   },
   [4024] = {
      name = "Second Pirate Addon",
      addon_type = 2,
      outfit = {155,151},
      cost = 0,
      items = {{2385,1},{6098,1},{6095,1},{6096,1}},
   },
   [4025] = {
      name = "First Assassin Addon",
      addon_type = 1,
      outfit = {156,152},
      cost = 0,
      items = {{5898,30},{5882,10},{5881,30},{5895,20},{5905,20},{5906,10},{5885,1}},
   },
   [4026] = {
      name = "Second Assassin Addon",
      addon_type = 2,
      outfit = {156,152},
      cost = 0,
      items = {{5909,50},{5910,50},{5911,50},{5912,50},{5913,50},{5914,50},{5886,10}},
   },
   [4027] = {
      name = "First Beggar Addon",
      addon_type = 1,
      outfit = {157,153},
      cost = 20000,
      items = {{5883,100}},
   },
   [4028] = {
      name = "Second Beggar Addon",
      addon_type = 2,
      outfit = {157,153},
      cost = 0,
      items = {{6107,1}},
   },
   [4029] = {
      name = "First Shaman Addon",
      addon_type = 1,
      outfit = {158,154},
      cost = 0,
      items = {{3955,5},{5015,1}},
   },
   [4030] = {
      name = "Second Shaman Addon",
      addon_type = 2,
      outfit = {158,154},
      cost = 0,
      items = {{3966,5},{3967,5}},
   },
   [4031] = {
      name = "First Norseman Addon",
      addon_type = 1,
      outfit = {252,251},
      cost = 0,
      items = {{7290,5}},
   },
   [4032] = {
      name = "Second Norseman Addon",
      addon_type = 2,
      outfit = {252,251},
      cost = 0,
      items = {{7290,10}},
   },
   [4033] = {
      name = "First Nightmare Addon",
      addon_type = 1,
      outfit = {269,268},
      cost = 0,
      items = {{6500,500}},
   },
   [4034] = {
      name = "Second Nightmare Addon",
      addon_type = 2,
      outfit = {269,268},
      cost = 0,
      items = {{6500,1500}},
   },
   [4035] = {
      name = "First Jester Addon",
      addon_type = 1,
      outfit = {270,273},
      cost = 0,
      items = {{5879,1},{5878,4}},
   },
   [4036] = {
      name = "Second Jester Addon",
      addon_type = 2,
      outfit = {270,273},
      cost = 0,
      items = {{5909,5}},
   },
   [4037] = {
      name = "First Brotherhood Addon",
      addon_type = 1,
      outfit = {279,278},
      cost = 0,
      items = {{6500,500}},
   },
   [4038] = {
      name = "Second Brotherhood Addon",
      addon_type = 2,
      outfit = {279,278},
      cost = 0,
      items = {{6500,1500}},
   },
   [4039] = {
      name = "First Demonhunter Addon",
      addon_type = 1,
      outfit = {288,289},
      cost = 150000,
      items = {},
   },
   [4040] = {
      name = "Second Demonhunter Addon",
      addon_type = 2,
      outfit = {288,289},
      cost = 150000,
      items = {},
   },
   [4041] = {
      name = "First Yalaharian Addon",
      addon_type = 1,
      outfit = {324,325},
      cost = 150000,
      items = {},
   },
   [4042] = {
      name = "Second Yalaharian Addon",
      addon_type = 2,
      outfit = {324,325},
      cost = 150000,
      items = {},
   },
 
} -------- config end -------
local storage = 14000
function onUse(cid, item, fromPosition, itemEx, toPosition)
        local addon, removeItems, removeMoney = config[item.actionid], 0, 0
         if getPlayerStorageValue(cid, storage + item.actionid) ~= 1 then
                if getPlayerMoney(cid) >= addon.cost then
                        removeMoney = 1
                end
                if #addon.items > 0 then
                        for i = 1, #addon.items do
                                if getPlayerItemCount(cid, addon.items[i][1]) >= addon.items[i][2] then
                                        removeItems = removeItems+1
                                end
                        end
                end
                if removeMoney == 1 and removeItems == #addon.items then
                        for i = 1, #addon.items do
                                doPlayerRemoveItem(cid, addon.items[i][1], addon.items[i][2])
                        end
                        doPlayerRemoveMoney(cid, addon.cost)
                        doPlayerAddOutfit(cid, addon.outfit[1], addon.addon_type)
                        doPlayerAddOutfit(cid, addon.outfit[2], addon.addon_type)
                        setPlayerStorageValue(cid, storage + item.actionid, 1)
                        doPlayerSendTextMessage(cid, 21, "Now you can use the "..addon.name..".")
                else
                        if addon.cost ~= 0 then
                                msg = "You need "..addon.cost.." gold coins and "
                        else
                                msg = "You need "
                        end
                        if #addon.items > 0 then
                                for i = 1, #addon.items do
                                        msg = msg..""..addon.items[i][2].."x "..getItemNameById(addon.items[i][1]).." "
                                end
                        end
                        doPlayerSendTextMessage(cid, 21, msg.."for the "..addon.name..".")
                end
        else
                doPlayerSendTextMessage(cid, 21, "You already have the "..addon.name..".")
        end
        return TRUE
end
<action actionid="4001-4042" event="script" value="addons.lua"/>

for yuur all addons. 

Link para o post
Compartilhar em outros sites

Oh meu amigo, não era bem isso que eu queria mas obrigado pela ajuda!
REP+
Créditos do script são todos seus ?

Já dei um jeitinho aqui, mas de todo modo obrigado!

 

 

//////translate

 

 
Oh my friend, was not quite what I wanted but thanks for the help!
REP +
Credits the script are all yours?

Already took a knack here, but thank you all so!

 

Programador/Scripter/Mapper nível NOOB ?

 

Untitltasadasded-1.png.e24703844a8ee56fadbf0cdcf82cd9c7.png

Link para o post
Compartilhar em outros sites

amigo se você quizer tentar testa esse vê ai:

 

function onUse(cid, item, frompos, item2, topos)
local itens = {2160}     ----dinheiro necessário
local itens2 = {2189, 2191, 2187, 2190, 2181, 2188, 8921}        ---- items necessários


        if isPlayer(cid) then
        if getPlayerItemCount(cid, itens) == 25 then    -- quantidade dinheiro
      doPlayerRemoveItem(cid, itens, 25)
       end  
        if getPlayerItemCount(cid, itens2) == 1 then    -- quantidade de cada item
      doPlayerRemoveItem(cid, itens2, 1)
        queststatus = getPlayerStorageValue(cid, 100003)   --- storage ao ganhar addon
        if queststatus == -1 then
        doPlayerSendTextMessage(cid,22,"You won a full mage addon!")  -- msg ao ganhar addon
                doSendAnimatedText(getPlayerPosition(cid), "", TEXTCOLOR_ORANGE)
                doPlayerAddOutfit(cid,138,3)
                doPlayerAddOutfit(cid,120,3)
        setPlayerStorageValue(cid, 100003, 1)
        else
        doPlayerSendTextMessage(cid,22,"You own this addon!")   -- não lembro pq coloquei isso
        end
        else
        doPlayerSendTextMessage(cid,22,"I need 1 wand of cosmic energy, 1 wand of draconia, 1 wand of dragonbreath, 1 wanf of inferno, 1 wand of vortex, 1 terra rod, 1 common akilles wand and more 250.000 cash for this addon!") -- msg dos items necessários pro addon
        end
        else
        return false
        end


        return 1true
        end

tag:

<action uniqueid="4112" script="outfits/mage.lua" />
Editado por alanmtd1 (veja o histórico de edições)

Conteúdos Tragos Por Mim ao Fórum:

Venda de Vocações [Modern Aac] •

• Comando !Saga 

• [Modern Aac] DragonBall 

• Esconder •

• Naruto 2018

• • •

• •

'NtoProject - Breve'

[Show OFF] Disponível

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Conteúdo Similar

    • Por elitehox
      boa tarde a todos,
      Estou tentando instalar o plugin gesior shop for Myaac. quando tento acessar gifts.php retorno erro 500 http.
      Alguém pode me ajudar? este é o log de erros do Apache ...
       
       
      [php7:error] [pid 24148] [client 177.130.9.96:56512] PHP Fatal error: Uncaught PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'ordering' in 'order clause' in /var/www/html/system/libs/pot/OTS_Base_DB.php:86\nStack trace:\n#0 /var/www/html/system/libs/pot/OTS_Base_DB.php(86): PDO->query()\n#1 /var/www/html/system/libs/pot/OTS_DB_PDOQuery.php(13): OTS_Base_DB->doQuery()\n#2 /var/www/html/plugins/gesior-shop-system/libs/shop-system.php(137): OTS_Base_DB->query()\n#3 /var/www/html/system/pages/gifts.php(199): GesiorShop::getOffers()\n#4 /var/www/html/index.php(362): require('/var/www/html/s...')\n#5 {main}\n thrown in /var/www/html/system/libs/pot/OTS_Base_DB.php on line 86  
       
       

    • Por ILex WilL
      Olá, Alguém poderia me ajudar com uns Scripts? nem que seja cobrando, dependendo eu pago para me ajudar...
    • Por zLockey9
      Estou com alguns erros em umas SPR que adicionei recentemente , como o titulo já diz ...
      elas estão saindo do lado do char em vez de em cima. (Obs:Não é spell e sim só o effect do comando /z)
       
      Se alguém puder ajudar dou REP+
       
      ALGUMAS PRINT'S
       
       
    • Por llucas75
      Oi tudo bem pessoal?
       
      Meu problema é o seguinte eu tenho um otserver 8.60, mas quero rodá-lo em linux ai precisando compilar... Compilei um Rev3777(0.4), mas quando ligo o servidor aparecem uma imensidão de erros no console, além de mau funcionamento do server...
      Tentei pegar as libs da pasta data do rev3777 e colocalos no lugar das libs do meu server... Mas dai o server nem abre...
       
       
      Queria muito executar esse server em linux, por causa da proteção adicional que ele oferece, alguem sabe como eu faço para ele rodar de maneira adequada com o meu executavel da rev3777?
    • Por lucasmacaca
      e o seguinte meu server ta em mysql mais pra testa as coisas prefiro usar ele em sqlite mais fica aparecendo esses erro ...
        
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo