function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerVocation(cid) ~= 5 and getPlayerVocation(cid) ~= 10 then
return doPlayerSendCancel(cid, "you need to be a blacksmith.")
elseif isInArray({0, 65535}, toPosition.x) then
return doPlayerSendCancel(cid, "Sorry, not possible.")
elseif getTileItemById(toPosition, 2555).uid == 0 then
return doPlayerSendCancel(cid, "You must put your ingredients in an anvil.")
end
local recipe = nil
for _, v in ipairs(Recipes) do
recipe = v:get(toPosition)
if(recipe ~= false) then
break
end
end
if(recipe) then
recipe:create(cid)
else
doPlayerSendCancel(cid, "This is not a valid recipe.")
end
return true
end
Espero ter ajudado ![]()






info
Grupo: Campones
Registrado: 08/07/07
Posts: 31
Reputação: 0
Gênero: Masculino
- Bom meu problema é o seguinte, estou usando um sistema de forja no meu server onde a Vocação BLACKSMITH coloca os itens em cima de uma ANVIL Clica no Iron Hammer e Clica nos itens e Faz um novo ITEM...
- Porem a vocação BlackSmith (5) que eu criei quando é promovida vira FORJE MASTER (10), ai o sistema não deixa mais ele Forjar os itens. No script eu coloquei assim para ficar para a Vocação Blacksmith:
if getPlayerVocation(cid) == 5 then
Porem para tentar colocar o FORJE MASTER no mesmo script ja tentei de tudo ( if getPlayerVocation(cid) == 5 or getPlayerVocation(cid) == 10 then) Dentre outras formas, mas mesmo assim sem sucesso....
Se alguem por gentileza poder me ajudar seria muito grato...
Vou Postar o Script abaixo:
________________________________________________________________________________________________________________________
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerVocation(cid) ~= 5 then
return doPlayerSendCancel(cid, "you need to be a blacksmith.")
elseif isInArray({0, 65535}, toPosition.x) then
return doPlayerSendCancel(cid, "Sorry, not possible.")
elseif getTileItemById(toPosition, 2555).uid == 0 then
return doPlayerSendCancel(cid, "You must put your ingredients in an anvil.")
end
local recipe = nil
for _, v in ipairs(Recipes) do
recipe = v:get(toPosition)
if(recipe ~= false) then
break
end
end
if(recipe) then
recipe:create(cid)
else
doPlayerSendCancel(cid, "This is not a valid recipe.")
end
return true
end
_______________________________________________________________________________________________________________________