Autor Wiadomość
son_of_sillve
PostWysłany: Sob 14:14, 12 Maj 2007    Temat postu: Skrypt na zmianę 'waluty' po użyciu

Wiem, że w Darkoni był jakiś bug z kasą... te skrypty na moim ots przynajmniej nie sprawiają problemów

robimy plik gold.lua i wklejamy to:

Kod:
function onUse(cid, item, frompos, item2, topos)
      if item.itemid == 2148 and item.type == 100 then
         doRemoveItem(item.uid,item.type)
         doPlayerAddItem(cid,2152,1)
         doPlayerSendTextMessage(cid,22,"You have changed 100 gp to 1 platnium coin")
      elseif item.itemid == 2148 and item.type < 100 then
         doPlayerSendTextMessage(cid,22,"You have to got 100 gp's to change for platinum coin")
      end
   end


następnie robimy plik platinum.lua i wklejamy to:

Kod:
function onUse(cid, item, frompos, item2, topos)
      if item.itemid == 2152 and item.type == 100 then
         doRemoveItem(item.uid,item.type)
         doPlayerAddItem(cid,2160,1)
         doPlayerSendTextMessage(cid,22,"You have changed 100 platinum to 1 crystal coin")
      elseif item.itemid == 2152 and item.type < 100 then
         doRemoveItem(item.uid,1)
         doPlayerAddItem(cid,2148,100)
         doPlayerSendTextMessage(cid,22,"You have changed 1 platinum to 100 gold coins")
      end
   end


do actions.xml dodajemy:

Kod:
<action itemid="2148" script="gold.lua" />
<action itemid="2152" script="platinum.lua" />


dziękuję i do zobaczenia ponownie ;]

Powered by phpBB © 2001,2002 phpBB Group