Ir para conteúdo

Featured Replies

Postado

.Qual servidor ou website você utiliza como base? 

Styller Youruts 0.6.2

 

Estou com um erro no sistema de alavancas ja fi as actions mas da um erro na função :

 

 

[18/04/2020 23:27:53] Lua Script Error: [Action Interface] 
[18/04/2020 23:27:53] data/actions/scripts/potions/pote.lua:onUse

[18/04/2020 23:27:53] data/actions/scripts/potions/pote.lua:2: attempt to call global 'getItemInfo' (a nil value)
[18/04/2020 23:27:54] stack traceback:
[18/04/2020 23:27:54]     data/actions/scripts/potions/pote.lua:2: in function 'getItemCap'
[18/04/2020 23:27:54]     data/actions/scripts/potions/pote.lua:284: in function <data/actions/scripts/potions/pote.lua:5>

segue o script

 

 

Citar

function getItemCap(itemid, quant) -- function by Manelks
return getItemInfo(itemid).weight*(quant or 1)
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
local configs = {

[9001] = {itemid = 7618, quantperslot = 100, cost = 4000, backpackid = 2000}, 

[9002] = {itemid = 7620, quantperslot = 100, cost = 8000, backpackid = 2001},

[9003] = {itemid = 7588, quantperslot = 100, cost = 8000, backpackid = 2000},

[9004] = {itemid = 7589, quantperslot = 100, cost = 8000, backpackid = 2001}, 

[9005] = {itemid = 7591, quantperslot = 100, cost = 8000, backpackid = 2000}, 

[9006] = {itemid = 7590, quantperslot = 100, cost = 12000, backpackid = 2001}, 

[9007] = {itemid = 8473, quantperslot = 100, cost = 14000, backpackid = 9774}, 

[9008] = {itemid = 8472, quantperslot = 100, cost = 14000, backpackid = 1988}, 

[9009] = {itemid = 2262, quantperslot = 100, cost = 9000, backpackid = 10521}, 

[9010] = {itemid = 2305, quantperslot = 100, cost = 8000, backpackid = 10519}, 

[9011] = {itemid = 2274, quantperslot = 100, cost = 6500, backpackid = 2002}, 

[9012] = {itemid = 2269, quantperslot = 100, cost = 6000, backpackid = 2002}, 

[9013] = {itemid = 2273, quantperslot = 100, cost = 6000, backpackid = 2002}, 

[9014] = {itemid = 2278, quantperslot = 100, cost = 8000, backpackid = 5949}, 

[9015] = {itemid = 2268, quantperslot = 100, cost = 15000, backpackid = 5926}, 

[9016] = {itemid = 2261, quantperslot = 100, cost = 8000, backpackid = 2003}, 

[9017] = {itemid = 2293, quantperslot = 100, cost = 6000, backpackid = 2004},

[9018] = {itemid = 7618, quantperslot = 100, cost = 4000, backpackid = 2000}, 

[9019] = {itemid = 7620, quantperslot = 100, cost = 8000, backpackid = 2001},

[9020] = {itemid = 7588, quantperslot = 100, cost = 8000, backpackid = 2000},

[9021] = {itemid = 7589, quantperslot = 100, cost = 8000, backpackid = 2001}, 

[9022] = {itemid = 7591, quantperslot = 100, cost = 8000, backpackid = 2000}, 

[9023] = {itemid = 7590, quantperslot = 100, cost = 12000, backpackid = 2001}, 

[9024] = {itemid = 8473, quantperslot = 100, cost = 14000, backpackid = 9774}, 

[9025] = {itemid = 8472, quantperslot = 100, cost = 14000, backpackid = 1988}, 

[9026] = {itemid = 2262, quantperslot = 100, cost = 9000, backpackid = 10521}, 

[9027] = {itemid = 2305, quantperslot = 100, cost = 8000, backpackid = 10519}, 

[9028] = {itemid = 2274, quantperslot = 100, cost = 6500, backpackid = 2002}, 

[9029] = {itemid = 2269, quantperslot = 100, cost = 6000, backpackid = 2002}, 

[9030] = {itemid = 2273, quantperslot = 100, cost = 6000, backpackid = 2002}, 

[9031] = {itemid = 2278, quantperslot = 100, cost = 8000, backpackid = 5949}, 

[9032] = {itemid = 2268, quantperslot = 100, cost = 15000, backpackid = 5926}, 

[9033] = {itemid = 2261, quantperslot = 100, cost = 8000, backpackid = 2003}, 

[9034] = {itemid = 2293, quantperslot = 100, cost = 6000, backpackid = 2004},

[9035] = {itemid = 7618, quantperslot = 100, cost = 4000, backpackid = 2000}, 

[9036] = {itemid = 7620, quantperslot = 100, cost = 8000, backpackid = 2001},

[9037] = {itemid = 7588, quantperslot = 100, cost = 8000, backpackid = 2000},

[9038] = {itemid = 7589, quantperslot = 100, cost = 8000, backpackid = 2001}, 

[9039] = {itemid = 7591, quantperslot = 100, cost = 8000, backpackid = 2000}, 

[9040] = {itemid = 7590, quantperslot = 100, cost = 12000, backpackid = 2001}, 

[9041] = {itemid = 8473, quantperslot = 100, cost = 14000, backpackid = 9774}, 

[9042] = {itemid = 8472, quantperslot = 100, cost = 14000, backpackid = 1988}, 

[9043] = {itemid = 2262, quantperslot = 100, cost = 9000, backpackid = 10521}, 

[9044] = {itemid = 2305, quantperslot = 100, cost = 8000, backpackid = 10519}, 

[9045] = {itemid = 2274, quantperslot = 100, cost = 6500, backpackid = 2002}, 

[9046] = {itemid = 2269, quantperslot = 100, cost = 6000, backpackid = 2002}, 

[9047] = {itemid = 2273, quantperslot = 100, cost = 6000, backpackid = 2002}, 

[9048] = {itemid = 2278, quantperslot = 100, cost = 8000, backpackid = 5949}, 

[9049] = {itemid = 2268, quantperslot = 100, cost = 15000, backpackid = 5926}, 

[9050] = {itemid = 2261, quantperslot = 100, cost = 8000, backpackid = 2003}, 

[9051] = {itemid = 2293, quantperslot = 100, cost = 6000, backpackid = 2004},

[9052] = {itemid = 7618, quantperslot = 100, cost = 4000, backpackid = 2000}, 

[9053] = {itemid = 7620, quantperslot = 100, cost = 8000, backpackid = 2001},

[9054] = {itemid = 7588, quantperslot = 100, cost = 8000, backpackid = 2000},

[9055] = {itemid = 7589, quantperslot = 100, cost = 8000, backpackid = 2001}, 

[9056] = {itemid = 7591, quantperslot = 100, cost = 8000, backpackid = 2000}, 

[9057] = {itemid = 7590, quantperslot = 100, cost = 12000, backpackid = 2001}, 

[9058] = {itemid = 8473, quantperslot = 100, cost = 14000, backpackid = 9774}, 

[9059] = {itemid = 8472, quantperslot = 100, cost = 14000, backpackid = 1988}, 

[9060] = {itemid = 2262, quantperslot = 100, cost = 9000, backpackid = 10521}, 

[9061] = {itemid = 2305, quantperslot = 100, cost = 8000, backpackid = 10519}, 

[9062] = {itemid = 2274, quantperslot = 100, cost = 6500, backpackid = 2002}, 

[9063] = {itemid = 2269, quantperslot = 100, cost = 6000, backpackid = 2002}, 

[9064] = {itemid = 2273, quantperslot = 100, cost = 6000, backpackid = 2002}, 

[9065] = {itemid = 2278, quantperslot = 100, cost = 8000, backpackid = 5949}, 

[9066] = {itemid = 2268, quantperslot = 100, cost = 15000, backpackid = 5926}, 

[9067] = {itemid = 2261, quantperslot = 100, cost = 8000, backpackid = 2003}, 

[9068] = {itemid = 2293, quantperslot = 100, cost = 6000, backpackid = 2004},

[9069] = {itemid = 7618, quantperslot = 100, cost = 4000, backpackid = 2000}, 

[9070] = {itemid = 7620, quantperslot = 100, cost = 8000, backpackid = 2001},

[9071] = {itemid = 7588, quantperslot = 100, cost = 8000, backpackid = 2000},

[9072] = {itemid = 7589, quantperslot = 100, cost = 8000, backpackid = 2001}, 

[9073] = {itemid = 7591, quantperslot = 100, cost = 8000, backpackid = 2000}, 

[9074] = {itemid = 7590, quantperslot = 100, cost = 12000, backpackid = 2001}, 

[9075] = {itemid = 8473, quantperslot = 100, cost = 14000, backpackid = 9774}, 

[9076] = {itemid = 8472, quantperslot = 100, cost = 14000, backpackid = 1988}, 

[9077] = {itemid = 2262, quantperslot = 100, cost = 9000, backpackid = 10521}, 

[9078] = {itemid = 2305, quantperslot = 100, cost = 8000, backpackid = 10519}, 

[9079] = {itemid = 2274, quantperslot = 100, cost = 6500, backpackid = 2002}, 

[9080] = {itemid = 2269, quantperslot = 100, cost = 6000, backpackid = 2002}, 

[9081] = {itemid = 2273, quantperslot = 100, cost = 6000, backpackid = 2002}, 

[9082] = {itemid = 2278, quantperslot = 100, cost = 8000, backpackid = 5949}, 

[9083] = {itemid = 2268, quantperslot = 100, cost = 15000, backpackid = 5926}, 

[9084] = {itemid = 2261, quantperslot = 100, cost = 8000, backpackid = 2003}, 

[9085] = {itemid = 2293, quantperslot = 100, cost = 6000, backpackid = 2004},

[9086] = {itemid = 7618, quantperslot = 100, cost = 4000, backpackid = 2000}, 

[9087] = {itemid = 7620, quantperslot = 100, cost = 8000, backpackid = 2001},

[9088] = {itemid = 7588, quantperslot = 100, cost = 8000, backpackid = 2000},

[9089] = {itemid = 7589, quantperslot = 100, cost = 8000, backpackid = 2001}, 

[9090] = {itemid = 7591, quantperslot = 100, cost = 8000, backpackid = 2000}, 

[9091] = {itemid = 7590, quantperslot = 100, cost = 12000, backpackid = 2001}, 

[9092] = {itemid = 8473, quantperslot = 100, cost = 14000, backpackid = 9774}, 

[9093] = {itemid = 8472, quantperslot = 100, cost = 14000, backpackid = 1988}, 

[9094] = {itemid = 2262, quantperslot = 100, cost = 9000, backpackid = 10521}, 

[9095] = {itemid = 2305, quantperslot = 100, cost = 8000, backpackid = 10519}, 

[9096] = {itemid = 2274, quantperslot = 100, cost = 6500, backpackid = 2002}, 

[9097] = {itemid = 2269, quantperslot = 100, cost = 6000, backpackid = 2002}, 

[9098] = {itemid = 2273, quantperslot = 100, cost = 6000, backpackid = 2002}, 

[9099] = {itemid = 2278, quantperslot = 100, cost = 8000, backpackid = 5949}, 

[9100] = {itemid = 2268, quantperslot = 100, cost = 15000, backpackid = 5926}, 

[9101] = {itemid = 2261, quantperslot = 100, cost = 8000, backpackid = 2003}, 

[9102] = {itemid = 2293, quantperslot = 100, cost = 6000, backpackid = 2004},

[9103] = {itemid = 7618, quantperslot = 100, cost = 4000, backpackid = 2000}, 

[9104] = {itemid = 7620, quantperslot = 100, cost = 8000, backpackid = 2001},

[9105] = {itemid = 7588, quantperslot = 100, cost = 8000, backpackid = 2000},

[9106] = {itemid = 7589, quantperslot = 100, cost = 8000, backpackid = 2001}, 

[9107] = {itemid = 7591, quantperslot = 100, cost = 8000, backpackid = 2000}, 

[9108] = {itemid = 7590, quantperslot = 100, cost = 12000, backpackid = 2001}, 

[9109] = {itemid = 8473, quantperslot = 100, cost = 14000, backpackid = 9774}, 

[9110] = {itemid = 8472, quantperslot = 100, cost = 14000, backpackid = 1988}, 

[9111] = {itemid = 2262, quantperslot = 100, cost = 9000, backpackid = 10521}, 

[9112] = {itemid = 2305, quantperslot = 100, cost = 8000, backpackid = 10519}, 

[9113] = {itemid = 2274, quantperslot = 100, cost = 6500, backpackid = 2002}, 

[9114] = {itemid = 2269, quantperslot = 100, cost = 6000, backpackid = 2002}, 

[9115] = {itemid = 2273, quantperslot = 100, cost = 6000, backpackid = 2002}, 

[9116] = {itemid = 2278, quantperslot = 100, cost = 8000, backpackid = 5949}, 

[9117] = {itemid = 2268, quantperslot = 100, cost = 15000, backpackid = 5926}, 

[9118] = {itemid = 2261, quantperslot = 100, cost = 8000, backpackid = 2003}, 

[9119] = {itemid = 2293, quantperslot = 100, cost = 6000, backpackid = 2004},

[9120] = {itemid = 2293, quantperslot = 100, cost = 6000, backpackid = 2004},

[9121] = {itemid = 7618, quantperslot = 100, cost = 4000, backpackid = 2000}, 

[9122] = {itemid = 7620, quantperslot = 100, cost = 8000, backpackid = 2001},

[9123] = {itemid = 7588, quantperslot = 100, cost = 8000, backpackid = 2000},

[9124] = {itemid = 7589, quantperslot = 100, cost = 8000, backpackid = 2001}, 

[9125] = {itemid = 7591, quantperslot = 100, cost = 8000, backpackid = 2000}, 

[9126] = {itemid = 7590, quantperslot = 100, cost = 12000, backpackid = 2001}, 

[9127] = {itemid = 8473, quantperslot = 100, cost = 14000, backpackid = 9774}, 

[9128] = {itemid = 8472, quantperslot = 100, cost = 14000, backpackid = 1988}, 

[9129] = {itemid = 2262, quantperslot = 100, cost = 9000, backpackid = 10521}, 

[9130] = {itemid = 2305, quantperslot = 100, cost = 8000, backpackid = 10519}, 

[9131] = {itemid = 2274, quantperslot = 100, cost = 6500, backpackid = 2002}, 

[9132] = {itemid = 2269, quantperslot = 100, cost = 6000, backpackid = 2002}, 

[9133] = {itemid = 2273, quantperslot = 100, cost = 6000, backpackid = 2002}, 

[9134] = {itemid = 2278, quantperslot = 100, cost = 8000, backpackid = 5949}, 

[9135] = {itemid = 2268, quantperslot = 100, cost = 15000, backpackid = 5926}, 

[9136] = {itemid = 2261, quantperslot = 100, cost = 8000, backpackid = 2003}, 

[9137] = {itemid = 2293, quantperslot = 100, cost = 6000, backpackid = 2004}

}
local coinid = 2148 -- Use o id da gold coin (2148) se voce quizer usar o sistema de dinheiro mesmo. (Caso o itemid for 2148 o cost sera de gps ou seja 30 = 30 gps)
if configs[item.actionid] then
if getPlayerFreeCap(cid) >= math.ceil((getPlayerFreeCap(configs[item.actionid].itemid, configs[item.actionid].quantperslot)*20)+getItemCap(configs[item.actionid].backpackid)) then
if coinid ~= 2148 and getPlayerItemCount(cid, coinid) >= configs[item.actionid].cost or doPlayerRemoveMoney(cid, configs[item.actionid].cost) then
local backpack = doPlayerAddItem(cid, configs[item.actionid].backpackid)
for i = 1, 20 do
doAddContainerItem(backpack, configs[item.actionid].itemid, configs[item.actionid].quantperslot)
end
doPlayerRemoveItem(cid, coinid == 2148 and 0000 or coinid, configs[item.actionid].cost)
else
return doPlayerSendCancel(cid, ("You need " .. configs[item.actionid].cost) .. (coinid == 2148 and " gold coins" or (" " .. getItemPluralNameById(coinid):lower())) .. " to buy this item.")
end
else
return doPlayerSendCancel(cid, "You need " .. math.ceil((getItemCap(configs[item.actionid].itemid, configs[item.actionid].quantperslot)*20)+getItemCap(configs[item.actionid].backpackid)) .. " cap for buy that.")
end
doSendMagicEffect(fromPosition, CONST_ME_GIFT_WRAPS)
doSendAnimatedText(fromPosition, "Comprado", TEXTCOLOR_RED)
end
return TRUE
end

 

Você tem o código disponível? Se tiver publique-o aqui: 

 

 

Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 

 

Postado

Pelo que eu consegui entender, o erro está nesta função  getItemInfo(), essa função não existe na SOURCE da sua base/distro.

Você terá que adiciona-la manualmente,depois compilar a sua distro ai sim ela pode ser utilizada no seu script LUA.

Contribuições:
 

=> Distribuições/Servidores

  1. [8.60] The Forgotten Server 1.3 (COMPILADO WIN x64)

 

=> Scripts/Códigos/Tutoriais

  1. Pokemon pescado aparece em volta do seu pokemon
  2. [Gesior]Dobrar pontos PagSeguro a partir de x valor doado

 

 Gostou de alguma contribuição? Rep +?

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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo