<action itemid="2545" event="script" value="arrowsnapoison.lua"/>
function onUse(cid, item, FromPosition, itemEx, toPosition)
[B]local arrows = 20[/B]
[B]local mana = 200[/B]
[B]local posionarrows = 5[/B]
[B]local idpoison = 2545[/B]
if(getPlayerItemCount(cid, item.itemid) >= arrows) then
if(getCreatureMana(cid) >= mana) then
doCreatureAddMana(cid, -mana)
doPlayerRemoveItem(cid, item.itemid, arrows)
doPlayerAddItem(cid, idpoison, poisonarrows)
else
doPlayerSendTextMessage(cid, 22, "Potrzebujesz "..mana..", aby zamienic strzaly na zatrute strzaly!")
return true
end
else
doPlayerSendTextMessage(cid, 22, "Potrzebujesz "..arrows.." strzal, aby je zamienic na zatrute strzaly!")
return true
end
return true
end
Kilka skryptow z actions niedziala wraz z twoim(reszty nie sprawdzalem)...Permission denied.
function onUse(cid, item, frompos, item2, topos)
local arrows = 20
local mana = 200
local posionarrows = 5
local idpoison = 2545
if(getPlayerItemCount(cid, item.itemid) >= arrows) then
if(getPlayerMana(cid) >= mana) then
doPlayerAddMana(cid, -mana)
doPlayerRemoveItem(cid, item.itemid, arrows)
doPlayerAddItem(cid, idpoison, poisonarrows)
else
doPlayerSendTextMessage(cid, 22, "Potrzebujesz "..mana..", aby zamienic strzaly na zatrute strzaly!")
return true
end
else
doPlayerSendTextMessage(cid, 22, "Potrzebujesz "..arrows.." strzal, aby je zamienic na zatrute strzaly!")
return true
end
return true
end