moja pierwszy skrypt więc proszę o surowe ocenki ;D
dla silników wykorzystujących
Kod:
getPlayerItemCount(uid,id)
1)Bolts runa (w której trzeba płacić 100gp za 100bolts)
boltsrune.lua w folderze actions
Kod:
-- Bolts Rune by Masiar --
function onUse(cid, item, frompos, item2, topos)
local mag = getPlayerMagLevel(cid)
if mag >= 4 then
if getPlayerItemCount(cid,2148) >= 100 or getPlayerItemCount(cid,2152) >= 1 then
doPlayerAddItem(cid,2543,100)
doPlayerSendTextMessage(cid,22,'Kupiles 100 boltow za 100gp.')
doPlayerRemoveMoney(cid,100)
else
doPlayerSendTextMessage(cid,22,'Nie masz tyle pieniedzy lub masz za maly mlvl.')
if item.type > 1 then
doChangeTypeItem(item.uid,item.type-1)
else
doRemoveItem(item.uid,1)
end
else
return 1
end
end
A w actions.xml:
Kod:
<action itemid="2294" script="boltsrune.lua" />
2)Bolts runka w której są darmowe bolty ^_^
Kod:
-- free bolts by Masiar --
function onUse(cid, item, frompos, item2, topos)
if item.itemid == 2294 and item.type > 1 then
doPlayerAddItem(cid,2543,100)
doChangeTypeItem(item.uid,item.type-1)
doSendMagicEffect(topos,12)
doPlayerSay(cid,"Aaaaah te bolty...",16)
else
doRemoveItem(item.uid,1)
end
return 1
end
w actions.xml
<action itemid="2294" script="bolts.lua" />
3) Najprostrza Bolt Runka
Kod:
-- Bolts Rune by Masiar --
function onUse(cid, item, frompos, item2, topos)
itemid = 2294 -- Rune ID
item2id = 2543 -- Bolts ID
doCreateItem(item2id, 100, frompos)
end
@down
co tu nie rozumiesz? ^^
masz runke naciskasz na nią i w bp pojawia ci się 100 boltów. i jeden ładunek z runki znika.