zduna
Banned User
- Joined
- May 3, 2010
- Messages
- 201
- Reaction score
- 0
--[[
Potion Script v1.0
by Shawak
]]--
local config = {
[5601] = {potion = 8473, cost = 1000, backpack_id = 2000}, -- uhp
[5602] = {potion = 7588, cost = 2500, backpack_id = 2000}, -- strong health potion
[5603] = {potion = 7591, cost = 5000, backpack_id = 2000}, -- great health potion
[5604] = {potion = 8472, cost = 5000, backpack_id = 2001}, -- dla pala
[5605] = {potion = 7589, cost = 5000, backpack_id = 2001}, -- string mana potion
[5606] = {potion = 7590, cost = 5000, backpack_id = 2001}, -- great mana potion
} -- config end --
function onUse(cid, item, fromPosition, itemEx, toPosition)
local potion = config[item.uid]
if isInArray({1945, 1946}, item.itemid) ~= TRUE then
return TRUE
end
if doPlayerBuyItemContainer(cid, potion.backpack_id, potion.potion, 1, potion.cost, 1) == TRUE then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You bought a backpack "..getItemNameById(potion.potion).." for "..potion.cost.." gold coins.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need "..potion.cost.." gold coins for a backpack "..getItemNameById(potion.potion)..".")
end
return TRUE
end
Jak przerobic to tak zeby dawal same potiony bez bp