Talkaction.xml
and change back:
but what should i do to alow changing with X count? like change 500cc to 5 nuggets with:
Data/talkaction/changegold/Crystal to Nugget.lua<talkaction words="!crystaltonugget" event="script" value="changegold/Crystal to Nugget.lua"/>
<talkaction words="!nuggettocrystal" event="script" value="changegold/Nugget to Crystal.lua"/>
function onSay(cid, words, param)
if doPlayerRemoveItem(cid,2160,100) then
doPlayerAddItem(cid,2157,1)
doSendMagicEffect(getPlayerPosition(cid),12)
doPlayerSendTextMessage(cid,21,"You have changed 100 Crystal coins to 1 Gold nugget!")
else
doPlayerSendCancel(cid,"You don't have enough money.")
doSendMagicEffect(getPlayerPosition(cid),2)
end
return TRUE
end
and change back:
function onSay(cid, words, param)
if doPlayerRemoveItem(cid,2157,1) then
doPlayerAddItem(cid,2160,100)
doSendMagicEffect(getPlayerPosition(cid),12)
doPlayerSendTextMessage(cid,22,"You have changed 1 Gold nugget to 100 Crystal coins!")
else
doPlayerSendCancel(cid,"You don't have enough money.")
doSendMagicEffect(getPlayerPosition(cid),2)
end
return TRUE
end
but what should i do to alow changing with X count? like change 500cc to 5 nuggets with:
HTML:
!crystaltonugget 5